unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Alex Kost <alezost@gmail.com>
To: hector <hectorlahoz@gmail.com>
Cc: help-gnu-emacs@gnu.org
Subject: Re: setting line-length for mediawiki-mode?
Date: Thu, 16 Mar 2017 23:52:36 +0300	[thread overview]
Message-ID: <87ziglaqqz.fsf@gmail.com> (raw)
In-Reply-To: <jwvtw6tnipn.fsf-monnier+gmane.emacs.help@gnu.org> (Stefan Monnier's message of "Thu, 16 Mar 2017 15:08:11 -0400")

Stefan Monnier (2017-03-16 15:08 -0400) wrote:

>>   '(lambda ()
>
> Running for the Useless Use of Quote award?

To make it clear: Stefan wanted to say that there is no point to quote
lambda; see <https://www.emacswiki.org/emacs/QuotedLambda> for details.

I would also advise to avoid putting lambdas in hooks.  The reason is:
what if you would want to remove it from hook?  If you added a function
name to a hook, it would be much easier to remove it.  For example:

(defun some-stuff-for-mediawiki ()
  (toggle-truncate-lines 0)
  (abbrev-mode 1)
  (set-fill-column 65000)
  (auto-fill-mode 0))

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

Now if you want to remove this function from the hook, you can do it
simply by evaluating:

(remove-hook 'mediawiki-mode-hook 'some-stuff-for-mediawiki)

-- 
Alex



  reply	other threads:[~2017-03-16 20:52 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 [this message]
2017-03-16 21:20       ` hector
2017-03-17 19:45       ` Nathanael Schweers

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=87ziglaqqz.fsf@gmail.com \
    --to=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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).