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

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

[elpa] externals/compat 327cb6b6e6 04/13: Allow specifying a condition t


From: ELPA Syncer
Subject: [elpa] externals/compat 327cb6b6e6 04/13: Allow specifying a condition to test defaliasing prefix functions
Date: Sun, 13 Mar 2022 19:57:32 -0400 (EDT)

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

    Allow specifying a condition to test defaliasing prefix functions
---
 compat-macs.el | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/compat-macs.el b/compat-macs.el
index a0e2bfb68d..1a565c35c3 100644
--- a/compat-macs.el
+++ b/compat-macs.el
@@ -54,6 +54,9 @@ ignored:
 - :cond :: Only install the compatibility code, iff the value
   evaluates to non-nil.
 
+  For prefixed functions, this can be interpreted as a test to
+  `defalias' an existing definition or not.
+
 - :no-highlight :: Do not highlight this definition as
   compatibility function.
 
@@ -109,7 +112,8 @@ DEF-FN, INSTALL-FN, CHECK-FN, ATTR and TYPE."
            (string-match "\\`compat-\\(.+\\)\\'" (symbol-name name))
            (let* ((actual-name (intern (match-string 1 (symbol-name name))))
                   (body (funcall install-fn actual-name  version)))
-             (when (fboundp actual-name)
+             (when (and (or (null cond) (eval cond t))
+                        (fboundp actual-name))
                `(,@check
                  ,(if feature
                       ;; See https://nullprogram.com/blog/2018/02/22/:



reply via email to

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