diff options
Diffstat (limited to 'lisp/emacs-lisp/nadvice.el')
| -rw-r--r-- | lisp/emacs-lisp/nadvice.el | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lisp/emacs-lisp/nadvice.el b/lisp/emacs-lisp/nadvice.el index 5326c520601..36df143a82a 100644 --- a/lisp/emacs-lisp/nadvice.el +++ b/lisp/emacs-lisp/nadvice.el | |||
| @@ -185,7 +185,7 @@ DOC is a string where \"FUNCTION\" and \"OLDFUN\" are expected.") | |||
| 185 | (defun advice--interactive-form-1 (function) | 185 | (defun advice--interactive-form-1 (function) |
| 186 | "Like `interactive-form' but preserves the static context if needed." | 186 | "Like `interactive-form' but preserves the static context if needed." |
| 187 | (let ((if (interactive-form function))) | 187 | (let ((if (interactive-form function))) |
| 188 | (if (or (null if) (not (eq 'closure (car-safe function)))) | 188 | (if (not (and if (interpreted-function-p function))) |
| 189 | if | 189 | if |
| 190 | (cl-assert (eq 'interactive (car if))) | 190 | (cl-assert (eq 'interactive (car if))) |
| 191 | (let ((form (cadr if))) | 191 | (let ((form (cadr if))) |
| @@ -193,14 +193,14 @@ DOC is a string where \"FUNCTION\" and \"OLDFUN\" are expected.") | |||
| 193 | if | 193 | if |
| 194 | ;; The interactive is expected to be run in the static context | 194 | ;; The interactive is expected to be run in the static context |
| 195 | ;; that the function captured. | 195 | ;; that the function captured. |
| 196 | (let ((ctx (nth 1 function))) | 196 | (let ((ctx (aref function 2))) |
| 197 | `(interactive | 197 | `(interactive |
| 198 | ,(let* ((f (if (eq 'function (car-safe form)) (cadr form) form))) | 198 | ,(let* ((f (if (eq 'function (car-safe form)) (cadr form) form))) |
| 199 | ;; If the form jut returns a function, preserve the fact that | 199 | ;; If the form jut returns a function, preserve the fact that |
| 200 | ;; it just returns a function, which is an info we use in | 200 | ;; it just returns a function, which is an info we use in |
| 201 | ;; `advice--make-interactive-form'. | 201 | ;; `advice--make-interactive-form'. |
| 202 | (if (eq 'lambda (car-safe f)) | 202 | (if (eq 'lambda (car-safe f)) |
| 203 | `',(eval form ctx) | 203 | (eval form ctx) |
| 204 | `(eval ',form ',ctx)))))))))) | 204 | `(eval ',form ',ctx)))))))))) |
| 205 | 205 | ||
| 206 | (defun advice--interactive-form (function) | 206 | (defun advice--interactive-form (function) |