emacs-devel
[Top][All Lists]
Advanced

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

Re: Problems with whole buffer Custom functions.


From: martin rudalics
Subject: Re: Problems with whole buffer Custom functions.
Date: Mon, 23 Jan 2006 19:04:43 +0100
User-agent: Mozilla Thunderbird 1.0 (Windows/20041206)

> Instead I think it should preserve the ordinary undo list when you set
> the variable.  Currently, setting the variable discards the undo list,
> which is more or less a bug.

Undo in customization buffers is peculiar in other ways as well:

1. With emacs -Q do M-x customize-group RET paren-showing-faces RET,
show both faces, and set the background of `show-paren-match' to
"turquoise1" and the background of `show-paren-mismatch' to "purple1".
Doing C-_ twice will now get you "No further undo information" - you
can't undo the change to `show-paren-match'.

Now change the face of `show-paren-match' to "turquoise" and that of
`show-paren-mismatch' to "purple" and do C-_ twice again.  This time
both modifications are undone.  Hence whether a modification can be
undone may depend on whether this or another modification is the first
editing change for a specific option.


2. With emacs -Q do M-x customize-group RET paren-showing-faces RET,
show the `show-paren-match' face, set the background of
`show-paren-match' to "paleturquoise", and do C-_.  At this moment point
is somewhere left of the foreground color checkbox.

The reason for this is that editing also changes some magic text from
"STANDARD." to "EDITED, shown value does not take effect until you set
or save it.".  This modification is, however, not recorded in
`buffer-undo-list' and the buffer position recorded before editing
started becomes invalid with respect to the actual buffer contents.


3. With emacs -Q do M-x customize-group RET paren-showing-faces RET,
show the `show-paren-mismatch' face, set the background of
`show-paren-mismatch' to "mediumpurple4", do C-_, then C-f (to make the
next undo a redo), and C-_.  At this moment the line of the background
color reads as

             [X] Background: mediumpurple4mple)

It's a mildly amusing exercise to erase your customization buffer with
an appropriate sequence of undos and redos.  One culprit here is the
mechanism adjusting field sizes in `widget-after-change'.  On the other
hand, wid-edit uses `before-change-functions' to detect whether the user
attempts to "change text outside editable field".  The corresponding
check in `widget-before-change', however, is performed if and only if
`inhibit-read-only' is nil.  And `primitive-undo' sets this to t.  Hence
the undo / redo mechanism obtains control over non-editable parts of the
customization buffer.






reply via email to

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