help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: elisp macros problem


From: Lowell Kirsh
Subject: Re: elisp macros problem
Date: Sat, 24 Jul 2004 18:58:30 -0700
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040322

sorry bout the bad etiquette. also, it turns out that it does seem to work. the reason that i didn't realize it was working was that i thought you could (add-hook 'some-mode ...) more than once, but really, this will just overwrite the previously added hook.

lowell

David Kastrup wrote:
Please don't copy me with Email to Usenet articles: it is a very bad
breach of netiquette to force the unwary to reply twice, once in
private and then again in public.

Lowell Kirsh <address@hidden> writes:


> (defmacro my-add-hook (hook &rest body)
>   `(add-hook ',(intern (concat (symbol-name hook) "-mode-hook"))
>         (lambda () ,@body)))
>

I just tried it out and it doesn't seem to work. I tried both:

(my-add-hook 'emacs-lisp (keyboard-translate ?\( ?\[))
             ^


Which is wrong.


and

(my-add-hook emacs-lisp (keyboard-translate ?\( ?\[))


Which results here in:

emacs-lisp-mode-hook's value is ((lambda nil
   (keyboard-translate 40 91)))


Hook run when entering Emacs Lisp mode.

You can customize this variable.

Defined in `emacs-lisp/lisp-mode'.

[back]

Looks fine to me.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]