From 9af70cbf60e78309a3902315a7d444877677fdfe Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Thu, 1 Apr 2021 16:41:41 -0500 Subject: Define `acdw/reindent-buffer' and hook into elisp Hopefully this will put a halt to all of my whitespace commits. Of course, this commit also includes whitespace-only diffs. --- lisp/acdw.el | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'lisp') diff --git a/lisp/acdw.el b/lisp/acdw.el index 6409f89..8096a70 100644 --- a/lisp/acdw.el +++ b/lisp/acdw.el @@ -58,6 +58,13 @@ Ready for use with `after-focus-change-function'." (run-at-time sunset-time (* 60 60 24) sunset-command) (run-at-time "12:00am" (* 60 60 24) sunset-command))) +;;;; Re-indent a buffer +(defun acdw/reindent-buffer () + "Call `indent-region' on the whole buffer." + (interactive) + (save-excursion + (indent-region (point-min) (point-max)))) + ;;; Garbage collection hacks (defconst acdw/gc-cons-threshold-basis (* 800 1024) @@ -97,7 +104,7 @@ directory." ;;; Reading mode (define-minor-mode acdw/reading-mode - "A mode for reading." + "A mode for reading." :init-value t :lighter " Read" (if acdw/reading-mode @@ -144,7 +151,7 @@ directory." "A keymap for my custom bindings.") (define-minor-mode acdw/mode - "A mode for `acdw/map'." + "A mode for `acdw/map'." :init-value t :lighter " acdw" :keymap acdw/map) -- cgit 1.4.1-21-gabe81