[Top][All Lists]

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

bug#19328: [PATCH] Add mechanism to prompt about unsaved customizations

From: Drew Adams
Subject: bug#19328: [PATCH] Add mechanism to prompt about unsaved customizations
Date: Tue, 9 Dec 2014 08:24:31 -0800 (PST)

> > Why is this in etc/TODO?
> If you're asking me in particular, I don't know. I just found it
> there and thought I'd help out.

Thanks for helping out!  The question is for Emacs Dev in general,
i.e., for this bug thread.

> > This already exists, no?  I've been using this for years:
> >
> > (add-hook 'kill-emacs-query-functions
> >          (lambda ()
> >            (condition-case nil
> >                (customize-unsaved)
> >              (error t))))
> A named function is probably more suitable for an end user than an
> arbitrary lambda, no?  Plus using error handling for control flow is
> generally not considered a best practice, especially when it's as
> broad in scope as `(condition-case nil ...)`.

That's what *I* use.  I'm not saying that everyone should use it.
My .emacs is used for multiple Emacs versions.  You might prefer
`ignore-errors', which does not exist in older versions.  Or you
might prefer not to ignore errors...

If you want a named function and no error handling, then, well,
try `customize-unsaved'.

My point was that `customized-unsaved' already exists.  It is
precisely a "mechanism to prompt about unsaved customizations".
Unless I'm missing something.  AFAICT, it is exactly what is
described in that TODO item:

   A function to check for customizable options that have been
   set but not saved, and ask the user whether to save them.
   This could go in kill-emacs-query-functions, to remind people
   to save their changes. If the user says yes, show them
   in a Custom buffer using customize-customized.

reply via email to

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