[Top][All Lists]

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

Re: turn-on-*-mode

From: Kevin Rodgers
Subject: Re: turn-on-*-mode
Date: Tue, 16 May 2006 10:02:44 -0600
User-agent: Thunderbird (Windows/20060308)

Kim F. Storm wrote:
Lennart Borgman <address@hidden> writes:

Sam Steingold wrote:
* Richard Stallman <address@hidden> [2006-05-16 00:28:34 -0400]:

    What is the policy on the turn-on-*-mode and turn-off-*-mode functions?
    Which modes get it and which don't?

We don't need to have a general policy.

We could have a general policy to _discurage_ having such functions!

We do: neither define-minor-mode nor define-global-minor-mode define
turn-on-MODE-mode and turn-off-MODE-mode functions, or even provide
an option to do so.

OK, so if I want turn-on-flyspell-mode, do I just add it?

You are free to add whatever you like to your own .emacs file :-)

I think that even if Richard says that we do not need a general policy
there are some advantages (and some drawbacks too of course) with
having similar structures. The main advantage in my opinion is
usability. Similar structures reduces unnecessary complexity. It is
therefore more easy to remember for a user if things works in a
similar way.

At least I want people using this software to be able to do things
easily. That way I hope they are doing more of the things I like.

There are only three "turn-on-" and on "turn-off-" functions defined
in my Emacs with my normal .emacs.  Loading more packages may define
more of them, but I really don't want more of them, as this is still
an inconsistent interactive interface!  And for non-interactive use,
doing (*-mode 1) and (*-mode -1) is the preferred interface.

The reason the turn-on-*-mode and turn-off-*-mode functions exist in the
first place is that the (*-mode 1) and (*-mode -1) calls have to be wrapped in a function definition (either a lambda form or a user-defined
function) in order to be added to a hook.

I think the turn-on-*-mode and turn-off-*-mode functions should be
provided for all local minor modes to provide a simpler idiom for that.
Global minor modes aren't used that way, are they?

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

We could even make a M-x toggle command which could toggle any mode
(it should provide a list of known modes as completion choices).
That would also be a good way to learn about new modes.

There was a long discussion recently about how to programmatically
determine the minor-mode functions and/or variables, partly for the
purpose of presenting them to the user...

It might even toggle any boolean variable given a C-u prefix...

I had such a command in my .emacs many years ago, but never used it
much.  `M-x toggle-truncate-lines' is a lot more convenient than
`M-x set-variable RET truncate-lines RET ... RET' though!

.. after the release!

I hope I live to see it!


reply via email to

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