From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Oliver Scholz Newsgroups: gmane.emacs.help Subject: Re: Canonical add-hook idiom Date: Sat, 15 Nov 2003 09:25:14 +0100 Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <87vfpm3uol.fsf@ID-87814.user.dfncis.de> References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: sea.gmane.org 1068885026 15379 80.91.224.253 (15 Nov 2003 08:30:26 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 15 Nov 2003 08:30:26 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Nov 15 09:30:24 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AKvp2-000591-00 for ; Sat, 15 Nov 2003 09:30:24 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AKwlr-0001AP-8a for geh-help-gnu-emacs@m.gmane.org; Sat, 15 Nov 2003 04:31:11 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!headwall.stanford.edu!fu-berlin.de!uni-berlin.de!pd9e2c6eb.dip.t-dialin.NET!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 20 Original-NNTP-Posting-Host: pd9e2c6eb.dip.t-dialin.net (217.226.198.235) Original-X-Trace: news.uni-berlin.de 1068884744 53414087 217.226.198.235 (16 [87814]) X-Attribution: os X-Face: "HgH2sgK|bfH$; PiOJI6|qUCf.ve<51_Od(%ynHr?=>znn#~#oS>",F%B8&\vus),2AsPYb -n>PgddtGEn}s7kH?7kH{P_~vu?]OvVN^qD(L)>G^gDCl(U9n{:d>'DkilN!_K"eNzjrtI4Ya6; Td% IZGMbJ{lawG+'J>QXPZD&TwWU@^~A}f^zAb[Ru;CT(UA]c& User-Agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3.50 (gnu/linux) Cancel-Lock: sha1:GT91M0r4gRdz1Oskx8LfegyyZJ0= Original-Xref: shelby.stanford.edu gnu.emacs.help:118305 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:14246 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:14246 Bob Nelson writes: > What is the preferred approach given these examples: > > 1). (add-hook 'some-mode-hook (lambda () [...] > 2). (add-hook 'some-mode-hook '(lambda () [...] > 3). (add-hook 'some-mode-hook (function (lambda () [...] > 4). None of the above -- please explain. [...] I definitely prefer (1). Some would prefer #'(lambda () ...), which for the Lisp interpreter is the same as (3). But AFAIK this is just a Common Lisp idiom and it makes no difference in Emacs Lisp. Oliver -- 25 Brumaire an 212 de la Révolution Liberté, Egalité, Fraternité!