branch: externals/compat commit a983e8c1129d21f1da35cc6d69244e22a4b3a66f Author: Philip Kaludercic <phil...@posteo.net> Commit: Philip Kaludercic <phil...@posteo.net>
Install advice using advice instead of nadvice for Emacs 24.3 --- compat-macs.el | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/compat-macs.el b/compat-macs.el index 31bb7b1..2c00f68 100644 --- a/compat-macs.el +++ b/compat-macs.el @@ -148,8 +148,15 @@ attributes (see `compat-generate-common')." ;; function. `(defalias ',name #',realname)) ((eq type 'advice) - ;; Advice is installed the usual way. - `(advice-add ',name :around #',realname)))) + ;; nadvice.el was introduced in Emacs 24.4, so + ;; older versions have to use `defadvice'. + (if (version<= "24.4" emacs-version) + `(advice-add ',name :around #',realname) + `(ad-add-advice + ',name + (list ,(format "setup:%S" name) + nil t (cons 'advice ,(lambda ())) + 'around 'first)))))) (lambda () (cond ((memq type '(func macro))