diff options
author | Case Duckworth | 2022-05-01 09:28:11 -0500 |
---|---|---|
committer | Case Duckworth | 2022-05-01 09:36:07 -0500 |
commit | 4e562b202c2a54d38bc11fea5c872ef95e555e31 (patch) | |
tree | 2fad2715f5e343b518dbe17ea778bd3bfe59f119 | |
parent | Allow passing a list of modes to `+mapc-some-buffers' (diff) | |
download | emacs-4e562b202c2a54d38bc11fea5c872ef95e555e31.tar.gz emacs-4e562b202c2a54d38bc11fea5c872ef95e555e31.zip |
Add `+indent-rigidly'
This works line-wise if the region isn't active.
-rw-r--r-- | init.el | 1 | ||||
-rw-r--r-- | lisp/acdw.el | 10 |
2 files changed, 11 insertions, 0 deletions
diff --git a/init.el b/init.el index b696572..75d558b 100644 --- a/init.el +++ b/init.el | |||
@@ -42,6 +42,7 @@ | |||
42 | "C-w" #'+kill-word-backward-or-region | 42 | "C-w" #'+kill-word-backward-or-region |
43 | "C-x C-m" #'execute-extended-command ; original: coding systems | 43 | "C-x C-m" #'execute-extended-command ; original: coding systems |
44 | "C-<backspace>" #'+backward-kill-word | 44 | "C-<backspace>" #'+backward-kill-word |
45 | "C-x TAB" #'+indent-rigidly | ||
45 | ;; Alright, Yegge... NOPE! C-x t is tab prefix ... (maybe F6 or something?) | 46 | ;; Alright, Yegge... NOPE! C-x t is tab prefix ... (maybe F6 or something?) |
46 | ;; "C-x t" #'beginning-of-buffer | 47 | ;; "C-x t" #'beginning-of-buffer |
47 | ;; "C-x e" #'end-of-buffer | 48 | ;; "C-x e" #'end-of-buffer |
diff --git a/lisp/acdw.el b/lisp/acdw.el index ac17e46..2f41e15 100644 --- a/lisp/acdw.el +++ b/lisp/acdw.el | |||
@@ -417,5 +417,15 @@ NOMODE will be set when called with \\[universal-argument]." | |||
417 | (when paste (insert paste)) | 417 | (when paste (insert paste)) |
418 | (get-buffer bufname))) | 418 | (get-buffer bufname))) |
419 | 419 | ||
420 | (defun +indent-rigidly (arg &optional interactive) | ||
421 | "Indent all lines in the region, or the current line. | ||
422 | This calls `indent-rigidly' and passes ARG to it." | ||
423 | (interactive "P\np") | ||
424 | (unless (region-active-p) | ||
425 | (push-mark) | ||
426 | (push-mark (line-beginning-position) nil t) | ||
427 | (goto-char (line-end-position))) | ||
428 | (call-interactively #'indent-rigidly)) | ||
429 | |||
420 | (provide 'acdw) | 430 | (provide 'acdw) |
421 | ;;; acdw.el ends here | 431 | ;;; acdw.el ends here |