emacs-devel
[Top][All Lists]
Advanced

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

Re: multiple queries to delete excess backup version w/ custom


From: martin rudalics
Subject: Re: multiple queries to delete excess backup version w/ custom
Date: Sat, 05 Jan 2008 23:29:03 +0100
User-agent: Mozilla Thunderbird 1.0 (Windows/20041206)

> 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.

And at the very end `Custom-save' hilariously calls `custom-save-all'
one more time.  Your analysis seems correct.  I wonder though why this
issue has never been brought up before.

> 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.

That's probably the way to go.  Could you propose a patch along these
lines?

> Another idea would be to turn off backups for the custom file, or to
> otherwise arrange not to ask the user questions when saving.

Rather not.  If you save your customizations in .emacs, there's quite
some chance that some silly modifications you made to it get stored
along with the customizations.  You should be able to back up from this.
Not asking questions means overriding the user's decisions.

Per what do you think?





reply via email to

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