emacs-devel
[Top][All Lists]
Advanced

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

Re: turn-on-*-mode


From: Reiner Steib
Subject: Re: turn-on-*-mode
Date: Tue, 16 May 2006 17:48:59 +0200
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.50 (gnu/linux)

On Tue, May 16 2006, Kim F. Storm wrote:

> There are also a number of "toggle-" functions, which IMO is a much
> better interface (just one function, with a simple common prefix).

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:

(defcustom text-mode-hook nil
  "Normal hook run when entering Text mode and many related modes."
  :type 'hook
  :options '(turn-on-auto-fill flyspell-mode)
  :group 'data)

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/





reply via email to

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