1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-23 22:20:24 -08:00

* 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.
This commit is contained in:
Stefan Monnier 2012-11-19 16:30:55 -05:00
parent 1000d89524
commit 141462223d
3 changed files with 60 additions and 35 deletions

View file

@ -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))))