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

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

[elpa] externals/compat 3f755dbbba 4/5: Move compat-def check into compa


From: ELPA Syncer
Subject: [elpa] externals/compat 3f755dbbba 4/5: Move compat-def check into compat body
Date: Sat, 26 Feb 2022 08:57:22 -0500 (EST)

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

    Move compat-def check into compat body
    
    As it is possible for multiple compat definitions to be given for the
    same function, the important thing is not to prevent this, but to
    ensure that the conditions prevent both to be applied.
---
 compat-macs.el | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/compat-macs.el b/compat-macs.el
index 4d50745e9b..211f3cc5a8 100644
--- a/compat-macs.el
+++ b/compat-macs.el
@@ -87,6 +87,9 @@ TYPE is used to set the symbol property `compat-type' for 
NAME."
          (realname (or (plist-get attr :realname)
                        (intern (format "compat--%S" name))))
          (body `(progn
+                  (when (get ',name 'compat-def)
+                    (error "Duplicate compatibility definition: %s" ',name))
+                  (put ',name 'compat-def ',realname)
                   ,(unless (plist-get attr :no-highlight)
                      `(font-lock-add-keywords
                        'emacs-lisp-mode
@@ -99,9 +102,6 @@ TYPE is used to set the symbol property `compat-type' for 
NAME."
        (put ',realname 'compat-type ',type)
        (put ',realname 'compat-version ,version)
        (put ',realname 'compat-doc ,(plist-get attr :note))
-       (when (get ',name 'compat-def)
-         (error "Duplicate compatibility definition: %s" ',name))
-       (put ',name 'compat-def ',realname)
        ,(funcall def-fn realname version)
        (,@(cond
            ((or (and min-version



reply via email to

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