comparison lisp/bytecomp-runtime.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 ac37a5f7e5be
children 855b667dea13
comparison
equal deleted inserted replaced
5505:3b220aa03f89 5506:b0d87f92e60b
36 ;; interface to selectively inlining functions. 36 ;; interface to selectively inlining functions.
37 ;; This only happens when source-code optimization is turned on. 37 ;; This only happens when source-code optimization is turned on.
38 38
39 ;;; Code: 39 ;;; Code:
40 40
41 ;; We define macro-declaration-function here because it is needed to
42 ;; handle declarations in macro definitions and this is the first file
43 ;; loaded by loadup.el that uses declarations in macros.
44 (defun macro-declaration-function (macro decl)
45 "Process a declaration found in a macro definition.
46 This is set as the value of the variable `macro-declaration-function'.
47 MACRO is the name of the macro being defined.
48 DECL is a list `(declare ...)' containing the declarations.
49 The return value of this function is not used.
50
51 XEmacs; any forms handed to the function described by the variable
52 `macro-declaration-function' will also (eventually) be handled by the
53 `declare' macro; see its documentation for further details of this."
54 ;; We can't use `dolist' or `cadr' yet for bootstrapping reasons.
55 (let (d)
56 ;; Ignore the first element of `decl' (it's always `declare').
57 (while (setq decl (cdr decl))
58 (setq d (car decl))
59 (if (and (consp d)
60 (listp (cdr d))
61 (null (cdr (cdr d))))
62 (cond ((eq (car d) 'indent)
63 (put macro 'lisp-indent-function (car (cdr d))))
64 ((eq (car d) 'debug)
65 (put macro 'edebug-form-spec (car (cdr d))))
66 ((eq (car d) 'doc-string)
67 ;;; #### XEmacs; not sure that this does anything sensible.
68 (put macro 'doc-string-elt (car (cdr d))))
69 ;; XEmacs; don't warn about the known XEmacs declarations.
70 ((memq (car d) '(special inline notinline optimize warn)))
71 (t
72 (message "Unknown declaration %s" d)))
73 (message "Invalid declaration %s" d)))))
74
75 (setq macro-declaration-function 'macro-declaration-function)
76
77
41 ;; Redefined in byte-optimize.el. 78 ;; Redefined in byte-optimize.el.
42 ;; This is not documented--it's not clear that we should promote it. 79 ;; This is not documented--it's not clear that we should promote it.
43 (fset 'inline 'progn) 80 (fset 'inline 'progn)
44 (put 'inline 'lisp-indent-hook 0) 81 (put 'inline 'lisp-indent-hook 0)
45 82