5 Jan 2008 19:42
Re: multiple queries to delete excess backup version w/ custom
Tom Tromey <tromey <at> redhat.com>
2008-01-05 18:42:42 GMT
2008-01-05 18:42:42 GMT
>>>>> "martin" == martin rudalics <rudalics <at> gmx.at> writes:
martin> Could you please try to edebug `Custom-save' and/or
martin> `custom-save-all' to find out why and how it's getting called
martin> repeatedly. This should get fixed for Emacs 22.2.
I read through the code a little.
Custom-save does this:
(custom-command-apply
(lambda (child)
(when (memq (widget-get child :custom-state)
'(modified set changed rogue))
(widget-apply child :custom-save)))
"Save all settings in this buffer? " t)
Which, AFAICT, means "send the :custom-save message to each modified
widget".
Searching for :custom-save shows that it maps to things like
custom-variable-save, custom-face-save, etc.
Looking at custom-variable-save, it calls custom-save-all toward the
end. I suppose this makes sense because you can save a single setting
via the State menu.
At least, that's my analysis. I'm sorry, but I didn't actually step
through with the debugger.
I can think of a few ways to fix this.
One idea would be a global which tells custom-save-all not to call
save-buffer. Then, bind this when sending :custom-save to the widgets
in Custom-save.
Another idea would be to turn off backups for the custom file, or to
otherwise arrange not to ask the user questions when saving.
Tom
RSS Feed