branch: externals/compat commit 61d31970e21a2d23fb0d113fb4ff3ab3b100ca8c Author: Philip Kaludercic <phil...@posteo.net> Commit: Philip Kaludercic <phil...@posteo.net>
Check version before defaliasing a prefixed function Since :cond cannot be combined with :prefix, the previous check was meaningless. What actually should be expressed is that a compatibility function should only then do the same thing, if we know by the indicated version that the actual function implements the right behaviour. --- compat-macs.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compat-macs.el b/compat-macs.el index a53404b0eb..d95e3529ee 100644 --- a/compat-macs.el +++ b/compat-macs.el @@ -111,8 +111,8 @@ DEF-FN, INSTALL-FN, CHECK-FN, ATTR and TYPE." ((and (plist-get attr :prefix) (memq type '(func macro)) (string-match "\\`compat-\\(.+\\)\\'" (symbol-name name)) (let* ((actual-name (intern (match-string 1 (symbol-name name)))) - (body (funcall install-fn actual-name version))) - (when (and (or (null cond) (eval cond t)) + (body (funcall install-fn actual-name version))) + (when (and (version<= version emacs-version) (fboundp actual-name)) `(,@check ,(if feature