emacs-devel
[Top][All Lists]
Advanced

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

Re: Eliminating "changed in Emacs outside of Customize"


From: Luc Teirlinck
Subject: Re: Eliminating "changed in Emacs outside of Customize"
Date: Wed, 2 Feb 2005 16:45:57 -0600 (CST)

Lennart Borgman wrote:

   When I now see the distinction between user variables (should
   only be changed by the user) and others it is much more clear. Should not
   this distinction should be pointed out very clearly in Info under Easy
   Customization?

There is no such generally agreed upon clear cut distinction,
especially not for hooks, which are the main problem.  From `(elisp)Hooks':

  A "hook" is a variable where you can store a function or functions to
  be called on a particular occasion by an existing program.  Emacs
  provides hooks for the sake of customization.  Most often, hooks are set
  up in the init file (*note Init File::), but Lisp programs can set them
  also.  *Note Standard Hooks::, for a list of standard hook variables.

Say `crazy-global-minor-mode' adds `crazy-fun' to before-save-hook.
`crazy-fun' only makes sense with `crazy-global-minor-mode' enabled
and leads to disaster otherwise.  Disabling `crazy-global-minor-mode'
removes the function from the hook again.  You customize
before-save-hook by adding something to it, while
`crazy-global-minor-mode' is enabled and save it to your .emacs.  Now
you also have permanently added `crazy-fun' to before-save-hook.
_Something_ should warn you about that.  That is what "Customized
outside Custom" does.

I do not believe that there would be widespread support for splitting
every single *-hook into program-*-hook and user-*-hook, which would
be the easiest way to solve the problem.

   I would prefer a marriage between set-variable and customize however.

We decided to implement changes to set-variable _after_ Emacs 21.4 is
released.  Such a change requires rewriting tons of individual :set
functions to work buffer locally.  Deciding what the best way to do
that is may be highly non-trivial and controversial for plenty of :set
functions.

   In that case customize could warn for "rouge" custom variable states.

It would warn all the time about the options you see if you do `emacs -Q'
and then `M-x customize-rogue'.  Every single variable you see there
represents a bug, but a minor one and not necessarily trivial to
correct.  Maybe we could do something about those bugs _after_ emacs
"21.4" is released.

It would _not_ warn about crazy-fun, which would be the more serious problem.

Drew Adams wrote:

    What is the specific problem that Per and Stefan think would result from
    treating "changed outside" as "set"?

Adding crazy-fun to before-save-hook in the scenario above *without warning*.
"Changed outside Custom" is a *warning*.  If you know why it as changed
outside Custom and you know it is harmless, you can ignore the warning.

Sincerely,

Luc.






reply via email to

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