[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: setting line-length for mediawiki-mode?
From: |
Alex Kost |
Subject: |
Re: setting line-length for mediawiki-mode? |
Date: |
Thu, 16 Mar 2017 23:52:36 +0300 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) |
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