From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Luc Teirlinck Newsgroups: gmane.emacs.devel Subject: Re: [Martin.Buchmann@uni-jena.de: Re: erase customization does not work] Date: Mon, 21 Nov 2005 22:24:40 -0600 (CST) Message-ID: <200511220424.jAM4OeU00610@raven.dms.auburn.edu> References: <200511180054.jAI0sSh07595@raven.dms.auburn.edu> NNTP-Posting-Host: main.gmane.org X-Trace: sea.gmane.org 1132633639 7930 80.91.229.2 (22 Nov 2005 04:27:19 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 22 Nov 2005 04:27:19 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Nov 22 05:27:16 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EePj1-0001tk-Nd for ged-emacs-devel@m.gmane.org; Tue, 22 Nov 2005 05:25:48 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EePj0-0003zv-FU for ged-emacs-devel@m.gmane.org; Mon, 21 Nov 2005 23:25:46 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EePih-0003z0-QP for emacs-devel@gnu.org; Mon, 21 Nov 2005 23:25:27 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EePig-0003xg-BB for emacs-devel@gnu.org; Mon, 21 Nov 2005 23:25:27 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EePig-0003xW-7S for emacs-devel@gnu.org; Mon, 21 Nov 2005 23:25:26 -0500 Original-Received: from [131.204.53.104] (helo=manatee.dms.auburn.edu) by monty-python.gnu.org with esmtp (Exim 4.34) id 1EePif-0008Ur-42; Mon, 21 Nov 2005 23:25:25 -0500 Original-Received: from raven.dms.auburn.edu (raven.dms.auburn.edu [131.204.53.29]) by manatee.dms.auburn.edu (8.13.3+Sun/8.13.3) with ESMTP id jAM4POnF003159; Mon, 21 Nov 2005 22:25:24 -0600 (CST) Original-Received: (from teirllm@localhost) by raven.dms.auburn.edu (8.11.7p1+Sun/8.11.7) id jAM4OeU00610; Mon, 21 Nov 2005 22:24:40 -0600 (CST) X-Authentication-Warning: raven.dms.auburn.edu: teirllm set sender to teirllm@dms.auburn.edu using -f Original-To: rms@gnu.org In-reply-to: (rms@gnu.org) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0.1 (manatee.dms.auburn.edu [131.204.53.104]); Mon, 21 Nov 2005 22:25:24 -0600 (CST) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:46424 Archived-At: There was a mistake in my previous patch. Below is a corrected version. Also, unlike what I told before, the question would always be asked in group buffers, even if they contained only one item (which is rare), but not in buffers gotten with customize-option or customize-face (my main concern). The question would also not be asked in non-group buffers with only one option, say buffers gotten with customize-apropos, where the search yielded only one result. (These are the ones that are difficult to distinguish from customize-{option,face} buffers.) Corrected patch: ===File ~/cus-edit-diff===================================== *** cus-edit.el 17 Nov 2005 10:24:20 -0600 1.241 --- cus-edit.el 21 Nov 2005 22:15:33 -0600 *************** *** 800,812 **** making them as if they had never been customized at all." (interactive) (let ((children custom-options)) ! (mapc (lambda (widget) ! (and (widget-get widget :custom-standard-value) ! (widget-apply widget :custom-standard-value) ! (if (memq (widget-get widget :custom-state) ! '(modified set changed saved rogue)) ! (widget-apply widget :custom-reset-standard)))) ! children))) ;;; The Customize Commands --- 800,816 ---- making them as if they had never been customized at all." (interactive) (let ((children custom-options)) ! (when (or (and (= 1 (length children)) ! (widget-get (car children) :custom-standard-value)) ! (yes-or-no-p "Really erase all customizations in this buffer? ")) ! (mapc (lambda (widget) ! (and (if (widget-get widget :custom-standard-value) ! (widget-apply widget :custom-standard-value) ! t) ! (memq (widget-get widget :custom-state) ! '(modified set changed saved rogue)) ! (widget-apply widget :custom-reset-standard))) ! children)))) ;;; The Customize Commands ============================================================