From: Miles Bader <miles.bader@necel.com>
Subject: Re: turn-on-*-mode
Date: Wed, 17 May 2006 11:18:16 +0900 [thread overview]
Message-ID: <buohd3p1jiv.fsf@dhapc248.dev.necel.com> (raw)
In-Reply-To: <v97j4m9dhw.fsf@marauder.physik.uni-ulm.de> (Reiner Steib's message of "Tue, 16 May 2006 17:48:59 +0200")
Reiner Steib <reinersteib+gmane@imap.cc> writes:
> An advantage of turn-on-... (and turn-off-...) is that is simplifies
> adding it to a hook:
>
> (add-hook 'text-mode-hook 'turn-on-auto-fill)
> (add-hook 'text-mode-hook (lambda () (flyspell-mode 1)))
>
> BTW, AFAICS the `flyspell-mode' entry in the defcustom of
> `text-mode-hook' toggles `flyspell-mode' instead of turning it on:
Stefan had a (what I thought was) clever suggestion to deal with this:
Make "...-mode" functions toggle only when used interactively (just as
they only print a message when used interactively), and otherwise have
them just enable the state unconditionally.
This is not a strictly compatible change, but in practice probably would
fix more problems than it would cause -- nobody in their right mind puts
a mode-function in a hook with the intention to toggle the state, but
people _do_ put mode functions in hooks _thinking_ that they
unconditionally enable the mode.
A possible variant of this idea that might be more compatible is to have
`run-hooks' bind a global variable to t when running a hook
(e.g. `running-hook'), and have mode function unconditionally enable the
mode when that variable is non-nil.
-Miles
--
It wasn't the Exxon Valdez captain's driving that caused the Alaskan oil spill.
It was yours. [Greenpeace advertisement, New York Times, 25 February 1990]
next prev parent reply other threads:[~2006-05-17 2:18 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-05-15 13:32 turn-on-*-mode Sam Steingold
2006-05-16 4:28 ` turn-on-*-mode Richard Stallman
2006-05-16 12:53 ` turn-on-*-mode Sam Steingold
2006-05-16 13:29 ` turn-on-*-mode Lennart Borgman
2006-05-16 14:52 ` turn-on-*-mode Kim F. Storm
2006-05-16 15:04 ` turn-on-*-mode Sam Steingold
2006-05-16 15:31 ` turn-on-*-mode David Kastrup
2006-05-16 15:40 ` turn-on-*-mode Drew Adams
2006-05-16 16:03 ` turn-on-*-mode Lennart Borgman
2006-05-16 18:35 ` turn-on-*-mode Stuart D. Herring
2006-05-17 1:26 ` turn-on-*-mode Johan Bockgård
2006-05-17 3:45 ` turn-on-*-mode Richard Stallman
2006-05-17 3:44 ` turn-on-*-mode Richard Stallman
2006-05-30 18:38 ` turn-on-*-mode Reiner Steib
2006-05-30 18:58 ` turn-on-*-mode Sam Steingold
2006-05-30 19:07 ` turn-on-*-mode Reiner Steib
2006-05-16 15:16 ` turn-on-*-mode Drew Adams
2006-05-16 15:48 ` turn-on-*-mode Reiner Steib
2006-05-17 2:18 ` Miles Bader [this message]
2006-05-17 20:08 ` turn-on-*-mode Richard Stallman
2006-05-17 21:24 ` turn-on-*-mode Stefan Monnier
2006-05-19 2:03 ` turn-on-*-mode Richard Stallman
2006-05-19 3:30 ` turn-on-*-mode Stefan Monnier
2006-05-16 16:02 ` turn-on-*-mode Kevin Rodgers
2006-05-17 15:28 ` turn-on-*-mode Stefan Monnier
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=buohd3p1jiv.fsf@dhapc248.dev.necel.com \
--to=miles.bader@necel.com \
--cc=miles@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.