emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/compat 603860f9ee 1/2: Use advice-add if available on E


From: ELPA Syncer
Subject: [elpa] externals/compat 603860f9ee 1/2: Use advice-add if available on Emacs 24.3
Date: Tue, 8 Feb 2022 09:57:22 -0500 (EST)

branch: externals/compat
commit 603860f9eee078480e201726ed47055540b1bf51
Author: Philip Kaludercic <philipk@posteo.net>
Commit: Philip Kaludercic <philipk@posteo.net>

    Use advice-add if available on Emacs 24.3
    
    If the ELPA package nadvice has been installed, we can make use of
    that instead of our own ersatz-system.
---
 compat-macs.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/compat-macs.el b/compat-macs.el
index f2bcc21e7a..6f3236cf9a 100644
--- a/compat-macs.el
+++ b/compat-macs.el
@@ -166,7 +166,8 @@ attributes (see `compat-generate-common')."
         ((eq type 'advice)
          ;; nadvice.el was introduced in Emacs 24.4, so older versions
          ;; have to advise the function using advice.el's `defadvice'.
-         (if (version<= "24.4" emacs-version)
+         (if (or (version<= "24.4" emacs-version)
+                 (fboundp 'advice-add)) ;via ELPA
              `(advice-add ',name :around #',realname)
            (let ((oldfun (make-symbol (format "compat--oldfun-%S" realname))))
              `(progn



reply via email to

[Prev in Thread] Current Thread [Next in Thread]