[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] emacs-24 r117588: cus-edit.el (custom-command-apply): Spec
From: |
Alan Mackenzie |
Subject: |
[Emacs-diffs] emacs-24 r117588: cus-edit.el (custom-command-apply): Specify the return value in the doc |
Date: |
Wed, 15 Oct 2014 15:30:27 +0000 |
User-agent: |
Bazaar (2.6b2) |
------------------------------------------------------------
revno: 117588
revision-id: address@hidden
parent: address@hidden
committer: Alan Mackenzie <address@hidden>
branch nick: emacs-24
timestamp: Wed 2014-10-15 15:23:27 +0000
message:
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.
modified:
lisp/ChangeLog changelog-20091113204419-o5vbwnq5f7feedwu-1432
lisp/cus-edit.el cusedit.el-20091113204419-o5vbwnq5f7feedwu-1091
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog 2014-10-15 02:00:20 +0000
+++ b/lisp/ChangeLog 2014-10-15 15:23:27 +0000
@@ -1,3 +1,10 @@
+2014-10-15 Alan Mackenzie <address@hidden>
+
+ * 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.
+
2014-10-15 Stefan Monnier <address@hidden>
* emacs-lisp/lisp.el (lisp--local-variables-1): Handle `quote'.
=== modified file 'lisp/cus-edit.el'
--- a/lisp/cus-edit.el 2014-06-29 02:33:50 +0000
+++ b/lisp/cus-edit.el 2014-10-15 15:23:27 +0000
@@ -779,7 +779,8 @@
"Call function FUN on all widgets in `custom-options'.
If there is more than one widget, ask user for confirmation using
the query string QUERY, using `y-or-n-p' if STRONG-QUERY is nil,
-and `yes-or-no-p' otherwise."
+and `yes-or-no-p' otherwise. Return non-nil if the functionality
+has been executed, nil otherwise."
(if (or (and (= 1 (length custom-options))
(memq (widget-type (car custom-options))
'(custom-variable custom-face)))
@@ -892,16 +893,16 @@
;; Bind these temporarily.
(let ((custom-reset-standard-variables-list '(t))
(custom-reset-standard-faces-list '(t)))
- (custom-command-apply
- (lambda (widget)
- (and (or (null (widget-get widget :custom-standard-value))
- (widget-apply widget :custom-standard-value))
- (memq (widget-get widget :custom-state)
- '(modified set changed saved rogue))
- (widget-apply widget :custom-mark-to-reset-standard)))
- "The settings will revert to their default values, in this
+ (if (custom-command-apply
+ (lambda (widget)
+ (and (or (null (widget-get widget :custom-standard-value))
+ (widget-apply widget :custom-standard-value))
+ (memq (widget-get widget :custom-state)
+ '(modified set changed saved rogue))
+ (widget-apply widget :custom-mark-to-reset-standard)))
+ "The settings will revert to their default values, in this
and future sessions. Really erase customizations? " t)
- (custom-reset-standard-save-and-update)))
+ (custom-reset-standard-save-and-update))))
;;; The Customize Commands
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] emacs-24 r117588: cus-edit.el (custom-command-apply): Specify the return value in the doc,
Alan Mackenzie <=