From 7c17e7aac2d54501d8ac34bcbcd0edb0b9fd1936 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Mon, 23 Sep 2024 13:57:20 +0200 Subject: emacs: Rename advice to x-no-tab-indentation --- .config/emacs/init.el | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to '.config/emacs/init.el') 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 -- cgit v1.2.3