Add `+indent-rigidly'

This works line-wise if the region isn't active.
This commit is contained in:
Case Duckworth 2022-05-01 09:28:11 -05:00
parent 8360e66d11
commit 4e562b202c
2 changed files with 11 additions and 0 deletions

View File

@ -42,6 +42,7 @@
"C-w" #'+kill-word-backward-or-region
"C-x C-m" #'execute-extended-command ; original: coding systems
"C-<backspace>" #'+backward-kill-word
"C-x TAB" #'+indent-rigidly
;; Alright, Yegge... NOPE! C-x t is tab prefix ... (maybe F6 or something?)
;; "C-x t" #'beginning-of-buffer
;; "C-x e" #'end-of-buffer

View File

@ -417,5 +417,15 @@ NOMODE will be set when called with \\[universal-argument]."
(when paste (insert paste))
(get-buffer bufname)))
(defun +indent-rigidly (arg &optional interactive)
"Indent all lines in the region, or the current line.
This calls `indent-rigidly' and passes ARG to it."
(interactive "P\np")
(unless (region-active-p)
(push-mark)
(push-mark (line-beginning-position) nil t)
(goto-char (line-end-position)))
(call-interactively #'indent-rigidly))
(provide 'acdw)
;;; acdw.el ends here