aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Mendler <mail@daniel-mendler.de>2023-01-04 00:58:02 +0100
committerDaniel Mendler <mail@daniel-mendler.de>2023-01-04 00:58:02 +0100
commit7af72fd86b71c2613cfef336d8d5147040dca7d3 (patch)
tree91d593b69f37acc51bc4843be7a5df29512e3a2e
parent8562b207580d5a4222f11b5ad877f1e1ef5a1438 (diff)
Ensure that realname is always bound
-rw-r--r--compat-macs.el23
1 files changed, 13 insertions, 10 deletions
diff --git a/compat-macs.el b/compat-macs.el
index 1a10b3b..4fc6019 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)))