bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#18725: [PATCH]: Emacs 24.4. Say "no" to "erase customizations?". .em


From: Alan Mackenzie
Subject: bug#18725: [PATCH]: Emacs 24.4. Say "no" to "erase customizations?". .emacs gets written.
Date: Wed, 15 Oct 2014 10:45:04 +0000 (UTC)
User-agent: tin/2.2.0-20131224 ("Lochindaal") (UNIX) (FreeBSD/8.4-RELEASE (amd64))

Alan Mackenzie <acm@muc.de> wrote:
> In Emacs 24.4, started with a .emacs which includes a customisation for
> face show-paren-match, do

> M-x customize-group <RET> paren-showing-faces <RET>

> .  One of the widgets is "Revert ...".  Hit <RET> on this widget, then 2
> for "Erase customizations".  Emacs prompts with "Really erase
> customizations? (yes or no)".  Type  "no".

> .emacs is then written.  It shouldn't be.

Here is a possible patch for the problem:


=== modified file 'lisp/cus-edit.el'
--- lisp/cus-edit.el    2014-06-29 02:33:50 +0000
+++ lisp/cus-edit.el    2014-10-15 10:11:00 +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 t 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,17 @@
   ;; 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


-- 
Alan Mackenzie (Nuremberg, Germany).






reply via email to

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