all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Nathanael Schweers <NSchweers@mailbox.org>
To: Alex Kost <alezost@gmail.com>
Cc: help-gnu-emacs@gnu.org, hector <hectorlahoz@gmail.com>
Subject: Re: setting line-length for mediawiki-mode?
Date: Fri, 17 Mar 2017 20:45:33 +0100	[thread overview]
Message-ID: <87pohfoffm.fsf@mailbox.org> (raw)
In-Reply-To: <87ziglaqqz.fsf@gmail.com> (Alex Kost's message of "Thu, 16 Mar 2017 23:52:36 +0300")

Alex Kost <alezost@gmail.com> writes:

Just a small remark: If I recall correctly, it’s better to
function-quote function arguments, so this code:
> (add-hook 'mediawiki-mode-hook 'some-stuff-for-mediawiki)
should rather look like this:

(add-hook 'mediawiki-mode-hook #'some-stuff-for-mediawiki)

This has the benefit of adding some compiler warning in case it cannot
be known that the function will be defined.

If I’m not entirely mistaken, it might even be good for performance, as
the function value of the passed symbol (in the first form) has to be
looked up every time it’s called, while the second form gives the
function object directly.  Take this last piece of “advice“ with a grain
of salt though.

In any case, #' is read syntax for function-quote, just as ' is read
syntax for quote.

-- Nathanael Schweers



      parent reply	other threads:[~2017-03-17 19:45 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-16 16:51 setting line-length for mediawiki-mode? Sharon Kimble
2017-03-16 17:51 ` hector
2017-03-16 19:08   ` Stefan Monnier
2017-03-16 20:52     ` Alex Kost
2017-03-16 21:20       ` hector
2017-03-17 19:45       ` Nathanael Schweers [this message]

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=87pohfoffm.fsf@mailbox.org \
    --to=nschweers@mailbox.org \
    --cc=alezost@gmail.com \
    --cc=hectorlahoz@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /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.