+2014-12-14 Cameron Desautels <camdez@gmail.com>
+
+ * custom.texi (Saving Customizations): Mention
+ `custom-prompt-customize-unsaved-options'.
+
2014-12-08 Lars Magne Ingebrigtsen <larsi@gnus.org>
* misc.texi (Network Security): Mention the new protocol-level
customizations from such a session would wipe out all the other
customizations you might have on your initialization file.
+ Please note that any customizations you have not chosen to save for
+future sessions will be lost when you terminate Emacs. If you'd like
+to be prompted about unsaved customizations at termination time, add
+the following to your initialization file:
+
+@example
+(add-hook 'kill-emacs-query-functions
+ 'custom-prompt-customize-unsaved-options)
+@end example
+
@node Face Customization
@subsection Customizing Faces
@cindex customizing faces
+2014-12-14 Cameron Desautels <camdez@gmail.com>
+
+ * NEWS: Mention `custom-prompt-customize-unsaved-options'.
+
+ * TODO: Remove its entry.
+
2014-12-13 Paul Eggert <eggert@cs.ucla.edu>
Convert Czech and Slovakian refcards to UTF-8
\f
* Changes in Emacs 25.1
+** New function `custom-prompt-customize-unsaved-options' checks for
+unsaved customizations and prompts user to customize (if found).
+
+++
** Network security (TLS/SSL certificate validity and the like) is
added via the new Network Security Manager (NSM) and controlled via
** Make byte-optimization warnings issue accurate line numbers.
-** 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.
-
** Record the sxhash of the default value for customized variables
and notify the user (maybe by adding a menu item or toolbar button,
as the detection can occur during autoload time) when the default
+2014-12-14 Cameron Desautels <camdez@gmail.com>
+
+ * cus-edit.el (custom-prompt-customize-unsaved-options): Add a
+ mechanism for prompting user about unsaved customizations.
+ (Bug#19328)
+
2014-12-14 Dmitry Gutov <dgutov@yandex.ru>
* fringe.el (fringe-bitmap-p): Fix 2014-12-05 breakage.
(or (face-at-point t t) "all faces") t)))
(customize-face face t))
-(defalias 'customize-customized 'customize-unsaved)
-
-;;;###autoload
-(defun customize-unsaved ()
- "Customize all options and faces set in this session but not saved."
- (interactive)
+(defun custom-unsaved-options ()
+ "List of options and faces set in this session but not saved.
+Each entry is of the form (SYMBOL TYPE), where TYPE is one of the
+symbols `custom-face' or `custom-variable'."
(let ((found nil))
(mapatoms (lambda (symbol)
(and (or (get symbol 'customized-face)
(get symbol 'customized-variable-comment))
(boundp symbol)
(push (list symbol 'custom-variable) found))))
+ found))
+
+(defalias 'customize-customized 'customize-unsaved)
+
+;;;###autoload
+(defun customize-unsaved ()
+ "Customize all options and faces set in this session but not saved."
+ (interactive)
+ (let ((found (custom-unsaved-options)))
(if (not found)
(error "No user options are set but unsaved")
(custom-buffer-create (custom-sort-items found t nil)
(interactive (list (apropos-read-pattern "groups")))
(customize-apropos regexp 'groups))
+;;;###autoload
+(defun custom-prompt-customize-unsaved-options ()
+ "Prompt user to customize any unsaved customization options.
+Return non-nil if user chooses to customize, for use in
+`kill-emacs-query-functions'."
+ (not (and (custom-unsaved-options)
+ (yes-or-no-p "Some customized options have not been saved; Examine? ")
+ (customize-unsaved)
+ t)))
+
;;; Buffer.
(defcustom custom-buffer-style 'links