help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Why is it not possible to use "nil" any more in init files ?


From: Alexandre Oberlin
Subject: Re: Why is it not possible to use "nil" any more in init files ?
Date: Tue, 25 Nov 2014 17:10:21 +0100
User-agent: Opera Mail/12.16 (Linux)

Toggling functions are obviously not always suitable for config files or scripts, though there are situations where they simplify code.

Toggling functions remain quite convenient on the command line, with the new state displaying in the minibuffer, and I am glad to see that this has been respected. Now IMHO, it is fundamental that toggling functions like all functions behave the same when called from a file or interactively. They could maybe report a warning in the former case, but trigger a revolution and create unending and potentially serious problems in legacy code? How many million users had reported to have trouble with such functions in scripts? Were they not able to learn good principles?

On top of that, not having the explicit arguments work as once expected does not help. Really, ain’t it a bit confusing to have
(cua-mode -1)
return nil and
(cua-mode nil)
return t ?


Downgrading ASAP,


Alexandre


--
In the long run, every program becomes rococco, and then rubble.
                Alan Perlis

Thanks Stefan for this explanation. So IIUC that trick broke some correct
.emacs in order to magically fix some broken ones?

Yup, and not just for .emacs files but also for calls made from one
package to another.  Basically, experience shows that *toggling* is
very rarely what we want when writing the Elisp code.

99.9% of calls of the form (foo-mode nil) or (foo-mode) either were
meant to enable the mode (the vast majority), or were meant to disable
the mode (a minority, but not an insignificant one).

A small proportion of those calls were correct (because the context
made sure that the mode was always either enabled or disabled), but
after yet-another bug report of someone not understanding why his
font-lock was not enabled in such and such circumstance, I decided that
it was time to break the small proportion of those minority cases which
expected (and with reason) the call to disable the mode.

This change was made more than 5 years ago, and it hasn't caused much of
a ruckus and even fewer bug reports, so I think I made the right call.


        Stefan




--


reply via email to

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