diff options
author | Thomas Voss <mail@thomasvoss.com> | 2023-08-16 01:27:14 +0200 |
---|---|---|
committer | Thomas Voss <mail@thomasvoss.com> | 2023-08-16 01:27:14 +0200 |
commit | cc3a49d8ca6df13f6a7bff99c4119ffbc0bfed5b (patch) | |
tree | ea424529c262831df19f137525357c6e5d6eb020 /.config | |
parent | 191286765d6e5483ef7935adfdd01f884e2de20b (diff) |
emacs: Use new-style advice
Diffstat (limited to '.config')
-rw-r--r-- | .config/emacs/config.org | 14 |
1 files changed, 9 insertions, 5 deletions
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 |