emacs-devel
[Top][All Lists]
Advanced

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

Re: turning on minor modes from hooks


From: Miles Bader
Subject: Re: turning on minor modes from hooks
Date: Sun, 30 Aug 2009 12:58:13 +0900

"Drew Adams" <address@hidden> writes:
>> > So interactively a nil arg will toggle, but in Lisp a nil 
>> > arg will turn it on? And just why is that a great idea?
>> 
>> Er, because it works the command work "as expected" in all contexts,
>> instead of in just one.
>
> Er, and why would one "expect" a nil arg to work differently between Lisp and
> interactive use?

One "wouldn't", because it _won't_ work differently.  The meaning of `nil'
will change (from "toggle" to "set").  The argument passed to the function
when invoked interactively is determined by the (interactive ...) form, so
the (interactive ...) form will be changed to pass `toggle' instead of
nil.

> And why would one "expect" the _particular_ behavior difference you define?

The toggling nature when invoked M-x is very natural, and ingrained;
we've also observed that people expect the "set" behavior when using a
mode as a hook.

> I already agreed that most Lisp uses are not for toggling. I don't agree that
> toggling in Lisp is so rare that it should be ignored. Especially if no real
> advantage to doing so is given.

It won't be "ignored", it will still be possible via use of `toggle' as an 
argument.

The advantage is more natural use (and thus fewer usage bugs).

[The rest of your email then completely ignores everything I've said
before and proceeds to ask questions already answered.  Maybe you truly
didn't understand the answers and are honestly asking, but I'm sorry, I
don't have the stomach for these long drawn out and insanely verbose
arguing-for-the-sake-of-arguing threads.]

-Miles

-- 
"Though they may have different meanings, the cries of 'Yeeeee-haw!' and
 'Allahu akbar!' are, in spirit, not actually all that different."




reply via email to

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