comparison lisp/bytecomp.el @ 5506:b0d87f92e60b

Complete support for macro-declaration-function, bytecomp{,-runtime}.el lisp/ChangeLog addition: 2011-05-07 Aidan Kehoe <kehoea@parhasard.net> * bytecomp-runtime.el: * bytecomp.el (byte-compile-file-form-defmumble): * bytecomp-runtime.el (macro-declaration-function): New. * subr.el: * subr.el (macro-declaration-function): Removed. Add support for macro-declaration-function, which is a GNU mechanism for indicating indentation and edebug information in macros (and only in macros). src/ChangeLog addition: 2011-05-07 Aidan Kehoe <kehoea@parhasard.net> * eval.c: * eval.c (Fdefmacro): * eval.c (syms_of_eval): Support macro-declaration-function in defmacro, incompletely and without documentation. * lisp.h: Declare Fnth here, necessary for the previous changes.
author Aidan Kehoe <kehoea@parhasard.net>
date Sun, 08 May 2011 09:19:25 +0100
parents 7b5946dbfb96
children b90c153730c7
comparison
equal deleted inserted replaced
5505:3b220aa03f89 5506:b0d87f92e60b
2295 (symbolp (car-safe (cdr-safe body))) 2295 (symbolp (car-safe (cdr-safe body)))
2296 (car-safe (cdr-safe body)) 2296 (car-safe (cdr-safe body))
2297 (stringp (car-safe (cdr-safe (cdr-safe body))))) 2297 (stringp (car-safe (cdr-safe (cdr-safe body)))))
2298 (byte-compile-warn "Probable `\"' without `\\' in doc string of %s" 2298 (byte-compile-warn "Probable `\"' without `\\' in doc string of %s"
2299 (nth 1 form)))) 2299 (nth 1 form))))
2300
2301 ;; Generate code for declarations in macro definitions.
2302 ;; Remove declarations from the body of the macro definition.
2303 (when macrop
2304 (let ((byte-compile-defmacro-body (nthcdr 3 form)))
2305 (if (stringp (car byte-compile-defmacro-body))
2306 (setq byte-compile-defmacro-body (nthcdr 4 form)))
2307 (when (and (consp byte-compile-defmacro-body)
2308 (eq 'declare (car-safe (car byte-compile-defmacro-body))))
2309 (if (eq 'declare (car-safe (car-safe
2310 (cdr byte-compile-defmacro-body))))
2311 (byte-compile-warn "Multiple macro-specific `declare' calls \
2312 not supported by XEmacs."))
2313 (setq byte-compile-output-preface
2314 (byte-compile-top-level
2315 `(progn (and macro-declaration-function
2316 (funcall macro-declaration-function
2317 ',name
2318 ',(car byte-compile-defmacro-body)))
2319 ,byte-compile-output-preface) t 'file)))))
2300 (let* ((new-one (byte-compile-lambda (cons 'lambda (nthcdr 2 form)))) 2320 (let* ((new-one (byte-compile-lambda (cons 'lambda (nthcdr 2 form))))
2301 (code (byte-compile-byte-code-maker new-one)) 2321 (code (byte-compile-byte-code-maker new-one))
2302 (docform-info 2322 (docform-info
2303 (cond ((atom code) ; compiled-function-p 2323 (cond ((atom code) ; compiled-function-p
2304 (if macrop '(" '(macro . #[" 4 "]))") '(" #[" 4 "])"))) 2324 (if macrop '(" '(macro . #[" 4 "]))") '(" #[" 4 "])")))