unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* elisp macros problem
@ 2004-07-24 18:39 Lowell Kirsh
  2004-07-24 19:00 ` David Kastrup
                   ` (2 more replies)
  0 siblings, 3 replies; 33+ messages in thread
From: Lowell Kirsh @ 2004-07-24 18:39 UTC (permalink / raw)


I am defining an emacs lisp macro to do:

(my-add-hook 'lisp
    ...)

which should give:

(add-hook 'lisp-mode-hook
   (lambda () ...))

I have:

(defmacro my-add-hook (hook &rest body)
   (let ((tempvar (make-symbol "cat")))
     `(flet ((,tempvar (sym str)
                       (make-symbol (concat (symbol-name sym) str))))
        (add-hook (cat ,hook "-mode-hook") (lambda () ,@body)))))

Does anyone know what's wrong with this and why it doesn't work?

Lowell

^ permalink raw reply	[flat|nested] 33+ messages in thread

end of thread, other threads:[~2004-08-03 18:44 UTC | newest]

Thread overview: 33+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-07-24 18:39 elisp macros problem Lowell Kirsh
2004-07-24 19:00 ` David Kastrup
2004-07-24 22:08   ` Lowell Kirsh
2004-07-24 23:41     ` David Kastrup
2004-07-25  1:58       ` Lowell Kirsh
2004-07-25 10:59         ` Kalle Olavi Niemitalo
2004-07-24 19:15 ` Barry Margolin
2004-07-24 19:59   ` Pascal Bourguignon
2004-07-24 20:50     ` David Kastrup
2004-07-24 21:49       ` Lowell Kirsh
2004-07-26  1:35 ` Lowell Kirsh
2004-07-26  1:55   ` Rahul Jain
2004-07-26  2:53     ` Lowell Kirsh
2004-07-26  4:05       ` Pascal Bourguignon
2004-07-26  4:13         ` Lowell Kirsh
2004-07-26  2:54     ` Lowell Kirsh
2004-07-26 22:16       ` Kalle Olavi Niemitalo
2004-07-26 22:58       ` Kevin Rodgers
2004-07-26  2:03   ` Barry Margolin
2004-07-26  3:06     ` Lowell Kirsh
2004-07-26  4:49       ` Barry Margolin
2004-07-26  5:20         ` Pascal Bourguignon
2004-07-26  6:10       ` Oliver Scholz
2004-07-26  5:55   ` David Kastrup
2004-07-27  6:38     ` Lowell Kirsh
2004-07-27  6:54     ` Lowell Kirsh
2004-07-27  7:14       ` David Kastrup
2004-07-27  8:10         ` Lowell Kirsh
2004-07-27 12:05           ` Pascal Bourguignon
2004-07-28  5:03             ` Rob Warnock
2004-07-31 20:46             ` Lowell Kirsh
2004-08-03 18:44               ` Michael Slass
2004-07-27 23:22         ` Barry Fishman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).