all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Oliver Scholz <alkibiades@gmx.de>
Subject: Re: Canonical add-hook idiom
Date: Sat, 15 Nov 2003 09:25:14 +0100	[thread overview]
Message-ID: <87vfpm3uol.fsf@ID-87814.user.dfncis.de> (raw)
In-Reply-To: GWitb.1387$n56.744@newsread1.news.pas.earthlink.net

Bob Nelson <bnelson@nelsonbe.com> 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é!

  reply	other threads:[~2003-11-15  8:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-11-15  5:35 Canonical add-hook idiom Bob Nelson
2003-11-15  8:25 ` Oliver Scholz [this message]
2003-11-15 18:27   ` Henrik Enberg
2003-11-15 16:55 ` Jesper Harder
2003-11-16 23:26 ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87vfpm3uol.fsf@ID-87814.user.dfncis.de \
    --to=alkibiades@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.