diff options
author | Thomas Voss <mail@thomasvoss.com> | 2024-09-23 13:57:20 +0200 |
---|---|---|
committer | Thomas Voss <mail@thomasvoss.com> | 2024-09-23 13:57:20 +0200 |
commit | 7c17e7aac2d54501d8ac34bcbcd0edb0b9fd1936 (patch) | |
tree | 05c5106d5315d50fa3062a761c0e67a839f399e5 /.config/emacs/init.el | |
parent | a67c7f8773699e1f4fd2750b93b5d0a7aa15d955 (diff) |
emacs: Rename advice to x-no-tab-indentation
Diffstat (limited to '.config/emacs/init.el')
-rw-r--r-- | .config/emacs/init.el | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/.config/emacs/init.el b/.config/emacs/init.el index d69bc8c..7e676e7 100644 --- a/.config/emacs/init.el +++ b/.config/emacs/init.el @@ -85,6 +85,12 @@ it convenient to use in ‘thread-last’." (apply function arguments) (recenter)) +(defun x-no-tab-indentation (function &rest arguments) + "Call FUNCTION with ARGUMENTS in an environment in which +`indent-tabs-mode' is nil." + (let (indent-tabs-mode) + (apply function arguments))) + (defmacro x-comment (&rest _body) "Comment out BODY. A cleaner alternative to line-commenting a region." (declare (indent 0)) @@ -255,14 +261,8 @@ selection." (evil-collection-init)) ;;; Force Spaces For Alighment -(defun x-align-with-spaces (function &rest arguments) - "Advice to force a given function to align using spaces instead of -tabs, regardless of the value of ‘indent-tabs-mode’." - (let (indent-tabs-mode) - (apply function arguments))) - (dolist (f #'(align-regexp c-backslash-region)) - (advice-add f :around #'x-align-with-spaces)) + (advice-add f :around #'x-no-tab-indentation)) ;;; Minibuffer Improvements (use-package vertico |