[Top][All Lists]

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

default :initialize function

From: Luc Teirlinck
Subject: default :initialize function
Date: Mon, 11 Oct 2004 19:29:00 -0500 (CDT)

Drew Adams wrote:

   If I understand right, you said that clicking the Convenience group loads
   fringe.el, which executes a defcustom for fringe-mode, which calls
   set-fringe-mode-1. That means that clicking a _navigational_ button in
   customize has the side effect of changing the default-frame-alist. Not good
   (if I understand right).

Yes, just _browsing_ Custom buffers _without customizing anything_ can
easily change Emacs' behavior and override user customizations made
outside of Custom.  The reason is that the default :initialize
function is now `custom-initialize-reset' and that function can be a
real bully.  If you want to customize a user option outside of Custom,
because you do not like the :set function, then that will be to no
avail.  Loading the file will call the :set function anyway whether
the user likes it or not.

I am actually surprised that the problem arises with `fringe-mode',
because that one _seemed_ harmless.  The problem definitely used to be
very bad with the old implementation of `ielm-prompt', where attempts
to customize it to a non read-only value in .emacs got overridden by
loading ielm, which made it read-only anyway by calling a :set
function.  That _particular_ problem is now gone, because I changed
the implementation.

I wonder why `custom-initialize-reset' is now the default :initialize
function.  It completely breaks what I believe to be two fundamental
principles of Emacs.

The first one is that just loading a file should only make functions
and variables available, not actually change Emacs' behavior by
_calling_ functions or changing variables.  In particular, using Custom
for browsing purposes should not change Emacs behavior and override
user customizations.

The second one is that use of Custom is optional, not mandatory.
Non-Custom customizations made by the user in his .emacs should not be
overridden by :set functions.

I believe the 21.3 default for :initialize, `custom-initialize-set',
should be restored.



reply via email to

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