emacs-devel
[Top][All Lists]
Advanced

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

Re: add-hook versus custom-set-variables


From: Bill Wohler
Subject: Re: add-hook versus custom-set-variables
Date: Wed, 28 Dec 2005 23:44:21 -0800
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

Stefan Monnier <address@hidden> writes:

>> Two workarounds which aren't pretty are to insist that the user add a
>> defvar in .emacs for any hook he customizes
>
> I don't understand what you're suggesting here.
> How could a defvar in .emacs help?

Please read Luc's article where he describes the technique and why.

  http://article.gmane.org/gmane.emacs.pretest.bugs/9993

>>     ;; MH-E hooks
>>     (eval-after-load 'mh-customize
>>       (progn
>>      (message "Adding mailcrypt hooks to MH-E...")
>>      (add-hook 'mh-folder-mode-hook 'mc-install-read-mode)
>>      (add-hook 'mh-letter-mode-hook 'mc-install-write-mode)))
>
> eval-after-load is a function, not a macro.  I know it's counter
> intuitive.

I don't know enough about the internals to know why this would be
counter-intuitive. I read your answer as: macros do what you expect,
functions don't. Please elaborate if this is not what you mean. Why
doesn't eval-after-load do what I expect?

-- 
Bill Wohler <address@hidden>  http://www.newt.com/wohler/  GnuPG ID:610BD9AD
Maintainer of comp.mail.mh FAQ and MH-E. Vote Libertarian!
If you're passed on the right, you're in the wrong lane.





reply via email to

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