From 4e562b202c2a54d38bc11fea5c872ef95e555e31 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Sun, 1 May 2022 09:28:11 -0500 Subject: Add `+indent-rigidly' This works line-wise if the region isn't active. --- init.el | 1 + lisp/acdw.el | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/init.el b/init.el index b696572..75d558b 100644 --- a/init.el +++ b/init.el @@ -42,6 +42,7 @@ "C-w" #'+kill-word-backward-or-region "C-x C-m" #'execute-extended-command ; original: coding systems "C-" #'+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 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]." (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 -- cgit 1.4.1-21-gabe81