emacs-devel
[Top][All Lists]
Advanced

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

Re: turn-on-*-mode


From: Stefan Monnier
Subject: Re: turn-on-*-mode
Date: Wed, 17 May 2006 17:24:49 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

>     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 an interesting idea.

> It would mean that there is no longer an argument you could use,
> noninteractively, to toggle the mode.

Actually there is: the symbol `toggle' does it.

> Another drawback is simply that the interactive and noninteractive
> behavior of these commands will be different.

Not really.  It just means that the argument passed to the minor mode
function in the absence of a prefix-arg won't be nil but will be `toggle'.
As a matter of fact, this is already the case.

The current code already emits a warning when the minor mode is called with
a nil argument and the minor mode is already enabled (i.e. when a nil
argument is used to toggle the mode off).


        Stefan




reply via email to

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