diff options
| author | Cameron Desautels | 2014-12-14 06:49:06 -0500 |
|---|---|---|
| committer | Ted Zlatanov | 2014-12-14 06:51:17 -0500 |
| commit | 4c4f970c8d10b346acc6d231f3755c1d1f5827fb (patch) | |
| tree | 201898796452a831786f584abfe67dd54ed42365 | |
| parent | f7572b72fd448c8ab6002bc6a545dfb765bbc520 (diff) | |
| download | emacs-4c4f970c8d10b346acc6d231f3755c1d1f5827fb.tar.gz emacs-4c4f970c8d10b346acc6d231f3755c1d1f5827fb.zip | |
Provide custom-prompt-customize-unsaved-options.
* doc/emacs/custom.texi (Saving Customizations): Mention
`custom-prompt-customize-unsaved-options'.
* etc/NEWS: Mention `custom-prompt-customize-unsaved-options'.
* etc/TODO: Remove its entry.
* lisp/cus-edit.el (custom-prompt-customize-unsaved-options): Add a
mechanism for prompting user about unsaved customizations.
(Bug#19328)
| -rw-r--r-- | doc/emacs/ChangeLog | 5 | ||||
| -rw-r--r-- | doc/emacs/custom.texi | 10 | ||||
| -rw-r--r-- | etc/ChangeLog | 6 | ||||
| -rw-r--r-- | etc/NEWS | 3 | ||||
| -rw-r--r-- | etc/TODO | 6 | ||||
| -rw-r--r-- | lisp/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/cus-edit.el | 29 |
7 files changed, 53 insertions, 12 deletions
diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog index 3ed8c1309bd..cd46d9fc474 100644 --- a/doc/emacs/ChangeLog +++ b/doc/emacs/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2014-12-14 Cameron Desautels <camdez@gmail.com> | ||
| 2 | |||
| 3 | * custom.texi (Saving Customizations): Mention | ||
| 4 | `custom-prompt-customize-unsaved-options'. | ||
| 5 | |||
| 1 | 2014-12-08 Lars Magne Ingebrigtsen <larsi@gnus.org> | 6 | 2014-12-08 Lars Magne Ingebrigtsen <larsi@gnus.org> |
| 2 | 7 | ||
| 3 | * misc.texi (Network Security): Mention the new protocol-level | 8 | * misc.texi (Network Security): Mention the new protocol-level |
diff --git a/doc/emacs/custom.texi b/doc/emacs/custom.texi index 0d0013f5ace..6c392cbc70d 100644 --- a/doc/emacs/custom.texi +++ b/doc/emacs/custom.texi | |||
| @@ -405,6 +405,16 @@ customizations in your initialization file. This is because saving | |||
| 405 | customizations from such a session would wipe out all the other | 405 | customizations from such a session would wipe out all the other |
| 406 | customizations you might have on your initialization file. | 406 | customizations you might have on your initialization file. |
| 407 | 407 | ||
| 408 | Please note that any customizations you have not chosen to save for | ||
| 409 | future sessions will be lost when you terminate Emacs. If you'd like | ||
| 410 | to be prompted about unsaved customizations at termination time, add | ||
| 411 | the following to your initialization file: | ||
| 412 | |||
| 413 | @example | ||
| 414 | (add-hook 'kill-emacs-query-functions | ||
| 415 | 'custom-prompt-customize-unsaved-options) | ||
| 416 | @end example | ||
| 417 | |||
| 408 | @node Face Customization | 418 | @node Face Customization |
| 409 | @subsection Customizing Faces | 419 | @subsection Customizing Faces |
| 410 | @cindex customizing faces | 420 | @cindex customizing faces |
diff --git a/etc/ChangeLog b/etc/ChangeLog index 0a22f9f20bd..f344e2437b0 100644 --- a/etc/ChangeLog +++ b/etc/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2014-12-14 Cameron Desautels <camdez@gmail.com> | ||
| 2 | |||
| 3 | * NEWS: Mention `custom-prompt-customize-unsaved-options'. | ||
| 4 | |||
| 5 | * TODO: Remove its entry. | ||
| 6 | |||
| 1 | 2014-12-13 Paul Eggert <eggert@cs.ucla.edu> | 7 | 2014-12-13 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 8 | ||
| 3 | Convert Czech and Slovakian refcards to UTF-8 | 9 | Convert Czech and Slovakian refcards to UTF-8 |
| @@ -54,6 +54,9 @@ so if you want to use it, you can always take a copy from an older Emacs. | |||
| 54 | 54 | ||
| 55 | * Changes in Emacs 25.1 | 55 | * Changes in Emacs 25.1 |
| 56 | 56 | ||
| 57 | ** New function `custom-prompt-customize-unsaved-options' checks for | ||
| 58 | unsaved customizations and prompts user to customize (if found). | ||
| 59 | |||
| 57 | +++ | 60 | +++ |
| 58 | ** Network security (TLS/SSL certificate validity and the like) is | 61 | ** Network security (TLS/SSL certificate validity and the like) is |
| 59 | added via the new Network Security Manager (NSM) and controlled via | 62 | added via the new Network Security Manager (NSM) and controlled via |
| @@ -419,12 +419,6 @@ rather than interactively. This a trivial one-liner in easy-mode.el. | |||
| 419 | 419 | ||
| 420 | ** Make byte-optimization warnings issue accurate line numbers. | 420 | ** Make byte-optimization warnings issue accurate line numbers. |
| 421 | 421 | ||
| 422 | ** A function to check for customizable options that have been | ||
| 423 | set but not saved, and ask the user whether to save them. | ||
| 424 | This could go in kill-emacs-query-functions, to remind people | ||
| 425 | to save their changes. If the user says yes, show them | ||
| 426 | in a Custom buffer using customize-customized. | ||
| 427 | |||
| 428 | ** Record the sxhash of the default value for customized variables | 422 | ** Record the sxhash of the default value for customized variables |
| 429 | and notify the user (maybe by adding a menu item or toolbar button, | 423 | and notify the user (maybe by adding a menu item or toolbar button, |
| 430 | as the detection can occur during autoload time) when the default | 424 | as the detection can occur during autoload time) when the default |
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 75e84765320..f97a887b821 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2014-12-14 Cameron Desautels <camdez@gmail.com> | ||
| 2 | |||
| 3 | * cus-edit.el (custom-prompt-customize-unsaved-options): Add a | ||
| 4 | mechanism for prompting user about unsaved customizations. | ||
| 5 | (Bug#19328) | ||
| 6 | |||
| 1 | 2014-12-14 Dmitry Gutov <dgutov@yandex.ru> | 7 | 2014-12-14 Dmitry Gutov <dgutov@yandex.ru> |
| 2 | 8 | ||
| 3 | * fringe.el (fringe-bitmap-p): Fix 2014-12-05 breakage. | 9 | * fringe.el (fringe-bitmap-p): Fix 2014-12-05 breakage. |
diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el index c8e9b90437d..a6da50e13ae 100644 --- a/lisp/cus-edit.el +++ b/lisp/cus-edit.el | |||
| @@ -1356,12 +1356,10 @@ suggest to customize that face, if it's customizable." | |||
| 1356 | (or (face-at-point t t) "all faces") t))) | 1356 | (or (face-at-point t t) "all faces") t))) |
| 1357 | (customize-face face t)) | 1357 | (customize-face face t)) |
| 1358 | 1358 | ||
| 1359 | (defalias 'customize-customized 'customize-unsaved) | 1359 | (defun custom-unsaved-options () |
| 1360 | 1360 | "List of options and faces set in this session but not saved. | |
| 1361 | ;;;###autoload | 1361 | Each entry is of the form (SYMBOL TYPE), where TYPE is one of the |
| 1362 | (defun customize-unsaved () | 1362 | symbols `custom-face' or `custom-variable'." |
| 1363 | "Customize all options and faces set in this session but not saved." | ||
| 1364 | (interactive) | ||
| 1365 | (let ((found nil)) | 1363 | (let ((found nil)) |
| 1366 | (mapatoms (lambda (symbol) | 1364 | (mapatoms (lambda (symbol) |
| 1367 | (and (or (get symbol 'customized-face) | 1365 | (and (or (get symbol 'customized-face) |
| @@ -1372,6 +1370,15 @@ suggest to customize that face, if it's customizable." | |||
| 1372 | (get symbol 'customized-variable-comment)) | 1370 | (get symbol 'customized-variable-comment)) |
| 1373 | (boundp symbol) | 1371 | (boundp symbol) |
| 1374 | (push (list symbol 'custom-variable) found)))) | 1372 | (push (list symbol 'custom-variable) found)))) |
| 1373 | found)) | ||
| 1374 | |||
| 1375 | (defalias 'customize-customized 'customize-unsaved) | ||
| 1376 | |||
| 1377 | ;;;###autoload | ||
| 1378 | (defun customize-unsaved () | ||
| 1379 | "Customize all options and faces set in this session but not saved." | ||
| 1380 | (interactive) | ||
| 1381 | (let ((found (custom-unsaved-options))) | ||
| 1375 | (if (not found) | 1382 | (if (not found) |
| 1376 | (error "No user options are set but unsaved") | 1383 | (error "No user options are set but unsaved") |
| 1377 | (custom-buffer-create (custom-sort-items found t nil) | 1384 | (custom-buffer-create (custom-sort-items found t nil) |
| @@ -1477,6 +1484,16 @@ If TYPE is `groups', include only groups." | |||
| 1477 | (interactive (list (apropos-read-pattern "groups"))) | 1484 | (interactive (list (apropos-read-pattern "groups"))) |
| 1478 | (customize-apropos regexp 'groups)) | 1485 | (customize-apropos regexp 'groups)) |
| 1479 | 1486 | ||
| 1487 | ;;;###autoload | ||
| 1488 | (defun custom-prompt-customize-unsaved-options () | ||
| 1489 | "Prompt user to customize any unsaved customization options. | ||
| 1490 | Return non-nil if user chooses to customize, for use in | ||
| 1491 | `kill-emacs-query-functions'." | ||
| 1492 | (not (and (custom-unsaved-options) | ||
| 1493 | (yes-or-no-p "Some customized options have not been saved; Examine? ") | ||
| 1494 | (customize-unsaved) | ||
| 1495 | t))) | ||
| 1496 | |||
| 1480 | ;;; Buffer. | 1497 | ;;; Buffer. |
| 1481 | 1498 | ||
| 1482 | (defcustom custom-buffer-style 'links | 1499 | (defcustom custom-buffer-style 'links |