[Top][All Lists]

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

Re: turning on minor modes from hooks

From: Tassilo Horn
Subject: Re: turning on minor modes from hooks
Date: Mon, 31 Aug 2009 20:54:28 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux)

Daniel Colascione <address@hidden> writes:


>> A call with no arguments, as in (auto-save-mode), naturally ought to
>> toggle the mode or turn it on.  But (auto-save-mode nil) has the
>> natural meaning of turning the mode off.
>> Perhaps we could make minor mode functions take &rest arguments so
>> they can distinguish those two cases.  However, that could be a
>> painful change,
> What about some kind of enable-minor-mode function?

That's what a some minor modes already do, for example
`turn-on-eldoc-mode', `turn-on-follow-mode', or
`turn-on-gnus-dired-mode'.  For some of them there's also a turn-off

Maybe that's a good convention.  If so, then probably things like
`define-minor-mode' should generate those functions automatically.

BTW, for me the toggling has never been a problem.  When I customize
some mode by putting stuff in its hook, I always define some
`th-foo-mode-init' function where I put stuff into.  And then it makes
no difference in wether I write (some-minor-mode) or (some-minor-mode 1)
there.  But I agree that it's a problem when customizing with the
`customize' interface...


reply via email to

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