Re: Aside on elisp
Sam Steingold <[email protected]> Wed, 11 Sep 2013 11:55:18 -0400
| Newsgroups | gmane.emacs.nxml.general |
|---|---|
| Message-ID | <[email protected]> |
> * Dave Pawson <[email protected]> [2013-09-11 14:03:02 +0100]: > > http://ergoemacs.org/emacs/emacs_avoid_lambda_in_hook.html > > Most / all mine are done this way > > (add-hook 'nxml-mode-hook > (function (lambda () > (define-key nxml-mode-map [f5] 'sgml-comment) > etc. in addition to the arguments in the aforementioned link, this is wrong because it is executed for every buffer while it is enough to do it just once when nxml is loaded. TRT is to use eval-after-load, not mode-hook. -- Sam Steingold (http://sds.podval.org/) on Ubuntu 13.04 (raring) X 11.0.11303000 http://www.childpsy.net/ http://pmw.org.il http://thereligionofpeace.com http://ffii.org http://americancensorship.org http://truepeace.org A computer scientist is someone who fixes things that aren't broken.