help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: setting line-length for mediawiki-mode?


From: hector
Subject: Re: setting line-length for mediawiki-mode?
Date: Thu, 16 Mar 2017 22:20:07 +0100
User-agent: Mutt/1.5.20 (2009-06-14)

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 via email to

[Prev in Thread] Current Thread [Next in Thread]