[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: elisp macros problem
From: |
Rahul Jain |
Subject: |
Re: elisp macros problem |
Date: |
Sun, 25 Jul 2004 21:55:51 -0400 |
User-agent: |
Gnus/5.1006 (Gnus v5.10.6) XEmacs/21.4 (Reasonable Discussion, linux) |
Lowell Kirsh <lkirsh@cs.ubc.ca> writes:
> Why does this not work:
>
> (defmacro my-add-hooks (hooks &rest body)
> `(dolist (hook ,hooks)
> (my-add-hook hook ,@body)))
>
> ??
It does. In fact, every possible string of characters works as it's
supposed to.
You probably mean "why does this not do X?" but you never tell us what X
is, so we don't know how to help you achieve that.
Hint: you might want to macroexpand-1 a sample usage of the macro and
see if it expands to what you desired.
According to your definition:
(my-add-hooks '(lisp-mode-hook emacs-lisp-mode-hook)
...)
<=>
(dolist (hook '(lisp-mode-hook emacs-lisp-mode-hook))
(my-add-hook hook ...))
Is that what you wanted?
--
Rahul Jain
rjain@nyct.net
Professional Software Developer, Amateur Quantum Mechanicist
- Re: elisp macros problem, (continued)
Re: elisp macros problem, Barry Margolin, 2004/07/24
Re: elisp macros problem, Lowell Kirsh, 2004/07/25
- Re: elisp macros problem,
Rahul Jain <=
Re: elisp macros problem, Lowell Kirsh, 2004/07/25
Re: elisp macros problem, Kalle Olavi Niemitalo, 2004/07/26
Re: elisp macros problem, Kevin Rodgers, 2004/07/26
Re: elisp macros problem, Barry Margolin, 2004/07/25