From cc3a49d8ca6df13f6a7bff99c4119ffbc0bfed5b Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Wed, 16 Aug 2023 01:27:14 +0200 Subject: emacs: Use new-style advice --- .config/emacs/config.org | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to '.config') diff --git a/.config/emacs/config.org b/.config/emacs/config.org index e7bc92e..881c79f 100644 --- a/.config/emacs/config.org +++ b/.config/emacs/config.org @@ -380,11 +380,13 @@ use some advice to force the usage of spaces. #+BEGIN_SRC elisp - (defadvice align-regexp (around align-regexp-with-spaces preactivate compile) + (defun mango--align-regexp-with-spaces (old-function &rest args) "Advice to force ‘align-regexp’ to always align with spaces, regardless of the value of ‘indent-tabs-mode’." - (let ((indent-tabs-mode nil)) - ad-do-it)) + (let (indent-tabs-mode) + (apply old-function args))) + + (advice-add 'align-regexp :around #'mango--align-regexp-with-spaces) #+END_SRC @@ -875,10 +877,12 @@ the ~load-theme~ function to fire a hook. (defvar mango-after-load-theme-hook nil "Hook called after ‘load-theme’ is run.") - (defadvice load-theme (after load-theme-with-hooks preactivate compile) - "Advice to run ‘mango-after-load-theme-hook’ hooks after loading a custom theme." + (defun mango--run-after-load-theme-hook (&rest unused) + "Run the hooks in ‘mango-after-load-theme-hook’ after we load a new theme." (run-hooks 'mango-after-load-theme-hook)) + (advice-add 'load-theme :after #'mango--run-after-load-theme-hook) + #+END_SRC *** TODO Fonts -- cgit v1.2.3