From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Rahul Jain Newsgroups: gmane.emacs.help Subject: Re: elisp macros problem Date: Sun, 25 Jul 2004 21:55:51 -0400 Organization: NTT/VERIO Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <877jsrsfa0.fsf@nyct.net> References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1090807037 1428 80.91.224.253 (26 Jul 2004 01:57:17 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 26 Jul 2004 01:57:17 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Jul 26 03:57:10 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1Boujm-0006nZ-00 for ; Mon, 26 Jul 2004 03:57:10 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1Boumn-0007Yo-0g for geh-help-gnu-emacs@m.gmane.org; Sun, 25 Jul 2004 22:00:17 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!canoe.uoregon.edu!arclight.uoregon.edu!news.u.washington.edu!newspeer1.mlpsca01.us.to.verio.net!news.verio.net!newsread1.dllstx09.us.to.verio.net.POSTED!53ab2750!not-for-mail Original-Newsgroups: gnu.emacs.help,comp.lang.lisp User-Agent: Gnus/5.1006 (Gnus v5.10.6) XEmacs/21.4 (Reasonable Discussion, linux) Cancel-Lock: sha1:OYnR3jtTcjey7CmXii4AGNF6ZSc= Original-Lines: 32 Original-NNTP-Posting-Host: 66.234.32.164 Original-X-Complaints-To: abuse@verio.net Original-X-Trace: newsread1.dllstx09.us.to.verio.net 1090806954 66.234.32.164 (Mon, 26 Jul 2004 01:55:54 GMT) Original-NNTP-Posting-Date: Mon, 26 Jul 2004 01:55:54 GMT Original-Xref: shelby.stanford.edu gnu.emacs.help:124446 comp.lang.lisp:144195 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:19782 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:19782 Lowell Kirsh 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