From 141462223d6f8063bf01692c2f41ecc58baea506 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Mon, 19 Nov 2012 16:30:55 -0500 Subject: * lisp/emacs-lisp/byte-run.el (defun-declarations-alist): Allow compiler-macros to be lambda expressions. * lisp/progmodes/python.el: Use cl-lib. Move var declarations outside of eval-when-compile. (python-syntax-context): Add compiler-macro. (python-font-lock-keywords): Simplify with De Morgan. --- lisp/emacs-lisp/byte-run.el | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'lisp/emacs-lisp/byte-run.el') diff --git a/lisp/emacs-lisp/byte-run.el b/lisp/emacs-lisp/byte-run.el index 462b4a25154..06f404d615c 100644 --- a/lisp/emacs-lisp/byte-run.el +++ b/lisp/emacs-lisp/byte-run.el @@ -81,8 +81,14 @@ The return value of this function is not used." #'(lambda (f _args new-name when) `(make-obsolete ',f ',new-name ,when))) (list 'compiler-macro - #'(lambda (f _args compiler-function) - `(put ',f 'compiler-macro #',compiler-function))) + #'(lambda (f args compiler-function) + ;; FIXME: Make it possible to just reuse `args'. + `(eval-and-compile + (put ',f 'compiler-macro + ,(if (eq (car-safe compiler-function) 'lambda) + `(lambda ,(append (cadr compiler-function) args) + ,@(cddr compiler-function)) + #',compiler-function))))) (list 'doc-string #'(lambda (f _args pos) (list 'put (list 'quote f) ''doc-string-elt (list 'quote pos)))) -- cgit v1.2.3 From 3837d988dd8892064c86ee483c6f09b2bacd7604 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Tue, 20 Nov 2012 12:54:00 -0500 Subject: * lisp/emacs-lisp/byte-run.el (defun-declarations-alist): Fix last change. --- lisp/ChangeLog | 2 ++ lisp/emacs-lisp/byte-run.el | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'lisp/emacs-lisp/byte-run.el') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 4be61545f7f..edb1a65266e 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,7 @@ 2012-11-20 Stefan Monnier + * emacs-lisp/byte-run.el (defun-declarations-alist): Fix last change. + * subr.el (called-interactively-p-functions): New var. (internal--called-interactively-p--get-frame): New macro. (called-interactively-p, interactive-p): Rewrite in Lisp. diff --git a/lisp/emacs-lisp/byte-run.el b/lisp/emacs-lisp/byte-run.el index 06f404d615c..b4582a41d6c 100644 --- a/lisp/emacs-lisp/byte-run.el +++ b/lisp/emacs-lisp/byte-run.el @@ -88,7 +88,7 @@ The return value of this function is not used." ,(if (eq (car-safe compiler-function) 'lambda) `(lambda ,(append (cadr compiler-function) args) ,@(cddr compiler-function)) - #',compiler-function))))) + `#',compiler-function))))) (list 'doc-string #'(lambda (f _args pos) (list 'put (list 'quote f) ''doc-string-elt (list 'quote pos)))) -- cgit v1.2.3