all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alan Mackenzie <acm@muc.de>
To: gnu-emacs-bug@moderators.isc.org
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)	[thread overview]
Message-ID: <m1lj7g$20c9$1@colin.muc.de> (raw)
In-Reply-To: <20141014220426.GD6430@acm.acm>

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	other threads:[~2014-10-15 10:45 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.11143.1413324683.1147.bug-gnu-emacs@gnu.org>
2014-10-14 22:04 ` bug#18725: Emacs 24.4. Say "no" to "erase customizations?". .emacs gets written Alan Mackenzie
2014-10-15 10:45   ` Alan Mackenzie [this message]
2014-10-15 11:37     ` bug#18725: [PATCH]: " Ivan Shmakov
2014-10-15 14:39     ` Stefan Monnier
2014-10-15 15:40       ` Alan Mackenzie
2014-10-15 15:59         ` replying to Debbugs Ivan Shmakov
2014-10-15 16:07         ` bug#18725: [PATCH]: Emacs 24.4. Say "no" to "erase customizations?". .emacs gets written Glenn Morris
2014-10-15 16:58         ` Michael Albinus
2014-10-15 17:07           ` replying to Debbugs Ivan Shmakov
2014-10-15 22:35             ` Glenn Morris
2014-10-16  2:03               ` Richard Stallman
2014-10-16  7:16                 ` Glenn Morris
2014-10-16  7:34                   ` Eli Zaretskii
2014-10-16 15:49                     ` Glenn Morris
2014-10-16  9:21                   ` Alan Mackenzie
2014-10-16 16:02                     ` Glenn Morris
2014-10-16 16:43                       ` James Cloos
2014-10-16 18:12                   ` Richard Stallman
2014-10-29 11:12               ` news:gnu.emacs.* Ivan Shmakov
2014-10-29 17:29                 ` news:gnu.emacs.* Glenn Morris
2014-10-30  7:33                   ` news:gnu.emacs.* Ivan Shmakov
2014-10-15 18:04         ` bug#18725: [PATCH]: Emacs 24.4. Say "no" to "erase customizations?". .emacs gets written Stefan Monnier
2014-10-16  9:13           ` replying to Debbugs [ was: bug#18725: ] Alan Mackenzie
2014-10-16 13:53             ` Stefan Monnier
2014-10-15 15:52       ` bug#18725: [PATCH]: Emacs 24.4. Say "no" to "erase customizations?". .emacs gets written Glenn Morris
2014-10-15 18:09         ` Stefan Monnier
2014-10-15 12:55   ` Alan Mackenzie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='m1lj7g$20c9$1@colin.muc.de' \
    --to=acm@muc.de \
    --cc=gnu-emacs-bug@moderators.isc.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.