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).
next prev parent reply other threads:[~2014-10-15 10:45 UTC|newest]
Thread overview: 11+ 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 16:07 ` Glenn Morris
2014-10-15 16:58 ` Michael Albinus
2014-10-15 18:04 ` Stefan Monnier
2014-10-15 15:52 ` 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
List information: https://www.gnu.org/software/emacs/
* 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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).