From ad235a8b88e353d6e51dafc62d020d8ff647857f Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Wed, 2 Jan 2013 16:43:46 -0800 Subject: [PATCH] defun fix for cl declarations + interactive forms * lisp/emacs-lisp/byte-run.el (defun): Place cl declarations after any interactive spec. Fixes: debbugs:13265 --- lisp/ChangeLog | 5 +++++ lisp/emacs-lisp/byte-run.el | 8 +++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 35fe446f066..0b92be63916 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2013-01-03 Glenn Morris + + * emacs-lisp/byte-run.el (defun): Place cl declarations + after any interactive spec. (Bug#13265) + 2012-12-31 Andreas Schwab * emacs-lisp/byte-run.el (defmacro): Use same argument parsing as diff --git a/lisp/emacs-lisp/byte-run.el b/lisp/emacs-lisp/byte-run.el index e3179a66070..7322c0fbe6f 100644 --- a/lisp/emacs-lisp/byte-run.el +++ b/lisp/emacs-lisp/byte-run.el @@ -195,7 +195,13 @@ The return value is undefined. (memq (car x) ;C.f. cl-do-proclaim. '(special inline notinline optimize warn))) (push (list 'declare x) - (if (stringp docstring) (cdr body) body)) + (if (stringp docstring) + (if (eq (car-safe (cadr body)) 'interactive) + (cddr body) + (cdr body)) + (if (eq (car-safe (car body)) 'interactive) + (cdr body) + body))) nil) (t (message "Warning: Unknown defun property `%S' in %S" (car x) name))))) -- 2.39.5