diff options
| author | Alan Mackenzie | 2014-10-15 15:23:27 +0000 |
|---|---|---|
| committer | Alan Mackenzie | 2014-10-15 15:23:27 +0000 |
| commit | e68b715772834050960289e8ef7fecd86d1c8fe3 (patch) | |
| tree | 0f510809d8f7566bfc71b84f4172190d04934f72 | |
| parent | 55aa96681c1a419ba01f91f107c11ae04b506e50 (diff) | |
| download | emacs-e68b715772834050960289e8ef7fecd86d1c8fe3.tar.gz emacs-e68b715772834050960289e8ef7fecd86d1c8fe3.zip | |
cus-edit.el (custom-command-apply): Specify the return value in the doc
string.
(Custom-reset-standard): Save custom-file (e.g. .emacs) only when
custom-command-apply has returned non-nil.
| -rw-r--r-- | lisp/ChangeLog | 7 | ||||
| -rw-r--r-- | lisp/cus-edit.el | 21 |
2 files changed, 18 insertions, 10 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 7e09336183c..6b0c8a67b79 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,10 @@ | |||
| 1 | 2014-10-15 Alan Mackenzie <acm@muc.de> | ||
| 2 | |||
| 3 | * cus-edit.el (custom-command-apply): Specify the return value in | ||
| 4 | the doc string. | ||
| 5 | (Custom-reset-standard): Save custom-file (e.g. .emacs) only when | ||
| 6 | custom-command-apply has returned non-nil. | ||
| 7 | |||
| 1 | 2014-10-15 Stefan Monnier <monnier@iro.umontreal.ca> | 8 | 2014-10-15 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 9 | ||
| 3 | * emacs-lisp/lisp.el (lisp--local-variables-1): Handle `quote'. | 10 | * emacs-lisp/lisp.el (lisp--local-variables-1): Handle `quote'. |
diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el index b54898a171c..c8e9b90437d 100644 --- a/lisp/cus-edit.el +++ b/lisp/cus-edit.el | |||
| @@ -779,7 +779,8 @@ when the action is chosen.") | |||
| 779 | "Call function FUN on all widgets in `custom-options'. | 779 | "Call function FUN on all widgets in `custom-options'. |
| 780 | If there is more than one widget, ask user for confirmation using | 780 | If there is more than one widget, ask user for confirmation using |
| 781 | the query string QUERY, using `y-or-n-p' if STRONG-QUERY is nil, | 781 | the query string QUERY, using `y-or-n-p' if STRONG-QUERY is nil, |
| 782 | and `yes-or-no-p' otherwise." | 782 | and `yes-or-no-p' otherwise. Return non-nil if the functionality |
| 783 | has been executed, nil otherwise." | ||
| 783 | (if (or (and (= 1 (length custom-options)) | 784 | (if (or (and (= 1 (length custom-options)) |
| 784 | (memq (widget-type (car custom-options)) | 785 | (memq (widget-type (car custom-options)) |
| 785 | '(custom-variable custom-face))) | 786 | '(custom-variable custom-face))) |
| @@ -892,16 +893,16 @@ making them as if they had never been customized at all." | |||
| 892 | ;; Bind these temporarily. | 893 | ;; Bind these temporarily. |
| 893 | (let ((custom-reset-standard-variables-list '(t)) | 894 | (let ((custom-reset-standard-variables-list '(t)) |
| 894 | (custom-reset-standard-faces-list '(t))) | 895 | (custom-reset-standard-faces-list '(t))) |
| 895 | (custom-command-apply | 896 | (if (custom-command-apply |
| 896 | (lambda (widget) | 897 | (lambda (widget) |
| 897 | (and (or (null (widget-get widget :custom-standard-value)) | 898 | (and (or (null (widget-get widget :custom-standard-value)) |
| 898 | (widget-apply widget :custom-standard-value)) | 899 | (widget-apply widget :custom-standard-value)) |
| 899 | (memq (widget-get widget :custom-state) | 900 | (memq (widget-get widget :custom-state) |
| 900 | '(modified set changed saved rogue)) | 901 | '(modified set changed saved rogue)) |
| 901 | (widget-apply widget :custom-mark-to-reset-standard))) | 902 | (widget-apply widget :custom-mark-to-reset-standard))) |
| 902 | "The settings will revert to their default values, in this | 903 | "The settings will revert to their default values, in this |
| 903 | and future sessions. Really erase customizations? " t) | 904 | and future sessions. Really erase customizations? " t) |
| 904 | (custom-reset-standard-save-and-update))) | 905 | (custom-reset-standard-save-and-update)))) |
| 905 | 906 | ||
| 906 | ;;; The Customize Commands | 907 | ;;; The Customize Commands |
| 907 | 908 | ||