"Richard M. Stallman" <[EMAIL PROTECTED]> writes: > Somewhat related to this, I have a patch to improve indentation of > macros that are defined with defmacro* and uses &body. The macro must > be loaded for my code to do its job. > > Could we manage to make this work without loading the macro? > Perhaps by providing another place to find the information?
The code works by checking the position of &body inside the macro argument list, and setting the lisp-indent-function property of the macro name to that number. This is the gist of the patch: Index: lisp/emacs-lisp/cl-macs.el =================================================================== RCS file: /cvsroot/emacs/emacs/lisp/emacs-lisp/cl-macs.el,v retrieving revision 1.53 diff -u -F^(def -r1.53 cl-macs.el --- lisp/emacs-lisp/cl-macs.el 4 Jul 2005 17:33:35 -0000 1.53 +++ lisp/emacs-lisp/cl-macs.el 5 Jul 2005 19:37:39 -0000 @@ -202,8 +202,15 @@ (defmacro defmacro* (name args &rest bod \(fn NAME ARGLIST [DOCSTRING] BODY...)" (let* ((res (cl-transform-lambda (cons args body) name)) - (form (list* 'defmacro name (cdr res)))) - (if (car res) (list 'progn (car res) form) form))) + (form `((defmacro ,name ,@(cdr res))))) + (if (memq '&body args) + (push `(put ',name 'lisp-indent-function ,(position '&body args)) + form)) + (if (car res) + (push (car res) form)) + (if (cdr form) + (cons 'progn form) + (car form)))) (defmacro function* (func) "Introduce a function. _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel