|
From: | Helmut Eller |
Subject: | Re: Idempotency of add-hook wrt lambda expressions |
Date: | Thu, 05 Mar 2009 17:33:16 +0100 |
User-agent: | Gnus/5.13 (Gnus v5.13) Emacs/23.0.90 (gnu/linux) |
* Alan Mackenzie [2009-03-05 17:45+0100] writes: > One of the reasons for using a lambda is to save having to think up a > function name, and to save cluttering up one's .emacs, or whatever. > Compare > > (add-hook 'foo-mode-hook (lambda (some-minor-mode 1))) > > with > > (defun switch-some-minor-mode-on () > (some-minor-mode 1)) > (add-hook 'foo-mode-hook 'switch-some-minor-mode-on) > I've seen this idiom in several places: (add-hook 'foo-mode-hook (defun switch-some-minor-mode-on () (some-minor-mode 1))) Helmut.
[Prev in Thread] | Current Thread | [Next in Thread] |