aboutsummaryrefslogtreecommitdiff
path: root/compat-macs.el
diff options
context:
space:
mode:
authorPhilip Kaludercic <philipk@posteo.net>2021-10-16 20:06:50 +0200
committerPhilip Kaludercic <philipk@posteo.net>2021-10-16 20:06:50 +0200
commitf4c0979e411bf572fab9b071fc7584bb98a1feec (patch)
tree5e11d2652c57aec7938c27f9ea9f018132d0e70f /compat-macs.el
parent2bb6c107a8db6c3c62f3cfab7c1b45fc697ecb94 (diff)
Prevent shadowing declarations in functional compatibility code
Previously the advice check inserted a redundant nil at the beginning of every function or macro definition. This prevented defun/defmacro from parsing any declare hints.
Diffstat (limited to 'compat-macs.el')
-rw-r--r--compat-macs.el6
1 files changed, 3 insertions, 3 deletions
diff --git a/compat-macs.el b/compat-macs.el
index 41dc3da..f8d0c65 100644
--- a/compat-macs.el
+++ b/compat-macs.el
@@ -145,9 +145,9 @@ attributes (see `compat-generate-common')."
;; Advice may use the implicit variable `oldfun', but
;; to avoid triggering the byte compiler, we make
;; sure the argument is used at least once.
- ,(and (eq type 'advice) '(ignore oldfun))
- ;; Insert the actual body now.
- ,@body))
+ ,@(if (eq type 'advice)
+ (cons '(ignore oldfun) body)
+ body)))
(lambda (realname version)
(cond
((memq type '(func macro))