emacs-devel
[Top][All Lists]
Advanced

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

Re: address@hidden: Re: erase customization does not work]


From: Luc Teirlinck
Subject: Re: address@hidden: Re: erase customization does not work]
Date: Thu, 17 Nov 2005 18:54:28 -0600 (CST)

Richard Stallman wrote:

   Could someone please debug this and ack?

The problem is that the current code assumes that, in a group
customization buffer, the mapc in Custom-reset-default will loop over
all variables and faces in the Custom buffer, calling
custom-{face,variable}-reset-standard on all of them.  This assumption
is false.  The mapc loop has only one single iteration: it calls
`custom-group-reset-standard' on the buffer's group.
`custom-group-reset-standard' then iterates over the variables and
faces.  The group widget has a nil :custom-standard-value and no
'standard-value.  Hence, in a group customization buffer,
Custom-reset-default produced an error before your latest change and
is a no-op after that change.

The following would make the buffer-wide "Erase Customization" button
work probably as well as the "Reset" and "Reset to saved" buttons:

(defun Custom-reset-standard (&rest ignore)
  "Erase all customization (either current or saved) for the group members.
The immediate result is to restore them to their standard settings.
This operation eliminates any saved settings for the group members,
making them as if they had never been customized at all."
  (interactive)
  (let ((children custom-options))
    (mapc (lambda (widget)
            (when (memq (widget-get widget :custom-state)
                        '(modified set changed saved rogue))
              (widget-apply widget :custom-reset-standard)))
          children)))

*I did not heavily test the above function* and do not recommend
installing it, but if somebody else wants to install it (without
attributing it to me), then that is OK with me.  The problem is that I
believe that this is a dangerous button, that could make people loose
a lot of customizations carefully built up over the years, by
inadvertently clicking mouse-1 on it (just to give focus to the
frame).  When that happens, I prefer them to blame somebody else,
rather than me.  Although other people will probably not agree with me
on this, I personally believe that the best thing would be to get rid
of these buffer-wide buttons altogether, _except_ for buffers customizing
single options, where they are OK and convenient.

The buffer-wide "Erase Customization" button has apparently *never*
worked _in a group customization buffer_ in any released Emacs
version.  Nobody ever noticed until now (after 8 years and seven
months).  The other two buttons ("Reset" and "Reset to saved")
apparently only started working until a change by Markus Rost made
them work in 2002 after nearly six years.  Before that, nobody
apparently noticed that they did not work.  All evidence that barely
anybody ever uses them.

I know that there was a thread (I participated in it) in which people
claimed that most people would actually always use the buffer-wide
buttons, because that is what they are used to from other
applications.  How come it took six, respectively eight and a half,
years for _somebody_ among all those people to notice that the buttons
they were using were actually no-ops (or threw errors) in group
customization buffers?

Sincerely,

Luc.





reply via email to

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