[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/compat 7af72fd86b 1/5: Ensure that realname is always b
From: |
ELPA Syncer |
Subject: |
[elpa] externals/compat 7af72fd86b 1/5: Ensure that realname is always bound |
Date: |
Tue, 3 Jan 2023 19:57:25 -0500 (EST) |
branch: externals/compat
commit 7af72fd86b71c2613cfef336d8d5147040dca7d3
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>
Ensure that realname is always bound
---
compat-macs.el | 23 +++++++++++++----------
1 file changed, 13 insertions(+), 10 deletions(-)
diff --git a/compat-macs.el b/compat-macs.el
index 1a10b3b38f..4fc6019f1a 100644
--- a/compat-macs.el
+++ b/compat-macs.el
@@ -185,16 +185,19 @@ If this is not documented on yourself system, you can
check \
"29.1"))
`((defalias ',realname #',(intern (format "compat--%s"
oldname))))))))
(lambda (realname _version)
- ;; Functions and macros are installed by aliasing the name of the
- ;; compatible function to the name of the compatibility function.
- (if (and (plist-get rest :explicit) (string= realname oldname))
- `(progn
- (defalias ',name ',realname)
- (make-obsolete
- ',name
- "Use `compat-call' or `compat-function' instead"
- "29.1"))
- `(defalias ',name #',realname)))
+ `(progn
+ ;; Functions and macros are installed by aliasing the name of the
+ ;; compatible function to the name of the compatibility function.
+ (defalias ',name #',realname)
+ ,@(when (and (plist-get rest :realname)
+ (not (string= (plist-get rest :realname) name))
+ (not (string= (plist-get rest :realname) realname)))
+ `((defalias ',(plist-get rest :realname) #',realname)))
+ ,@(when (and (plist-get rest :explicit) (string= realname oldname))
+ `((make-obsolete
+ ',name
+ "Use `compat-call' or `compat-function' instead"
+ "29.1")))))
(lambda ()
`(not (fboundp ',name)))
rest)))