all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: hector <hectorlahoz@gmail.com>
To: Alex Kost <alezost@gmail.com>
Cc: help-gnu-emacs@gnu.org
Subject: Re: setting line-length for mediawiki-mode?
Date: Thu, 16 Mar 2017 22:20:07 +0100	[thread overview]
Message-ID: <20170316212007.GA20711@workstation> (raw)
In-Reply-To: <87ziglaqqz.fsf@gmail.com>

On Thu, Mar 16, 2017 at 11:52:36PM +0300, Alex Kost wrote:
> 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.

Thanks for the explanation. That's what I thought.
Very cryptic though :-)

Blame it on the Emacs manual 23.2 (yes, I know). It's been fixed in
newer versions.

> 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)

Got it.



  reply	other threads:[~2017-03-16 21:20 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 [this message]
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

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

  git send-email \
    --in-reply-to=20170316212007.GA20711@workstation \
    --to=hectorlahoz@gmail.com \
    --cc=alezost@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.