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: customize-apropos Date: Fri, 9 Dec 2005 21:47:53 -0600 (CST) Message-ID: <200512100347.jBA3lr917144@raven.dms.auburn.edu> NNTP-Posting-Host: main.gmane.org X-Trace: sea.gmane.org 1134186673 844 80.91.229.2 (10 Dec 2005 03:51:13 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 10 Dec 2005 03:51:13 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Dec 10 04:51:05 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Ekvk6-0000RC-Tx for ged-emacs-devel@m.gmane.org; Sat, 10 Dec 2005 04:49:51 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EkvkT-0005Kk-Cu for ged-emacs-devel@m.gmane.org; Fri, 09 Dec 2005 22:50:13 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Ekvk9-0005JL-6b for emacs-devel@gnu.org; Fri, 09 Dec 2005 22:49:53 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Ekvk7-0005Io-23 for emacs-devel@gnu.org; Fri, 09 Dec 2005 22:49:52 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ekvk6-0005Ie-Sx for emacs-devel@gnu.org; Fri, 09 Dec 2005 22:49:50 -0500 Original-Received: from [131.204.53.104] (helo=manatee.dms.auburn.edu) by monty-python.gnu.org with esmtp (Exim 4.34) id 1EkvlP-00044P-Li for emacs-devel@gnu.org; Fri, 09 Dec 2005 22:51:11 -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 jBA3nK2Z020673 for ; Fri, 9 Dec 2005 21:49:20 -0600 (CST) Original-Received: (from teirllm@localhost) by raven.dms.auburn.edu (8.11.7p1+Sun/8.11.7) id jBA3lr917144; Fri, 9 Dec 2005 21:47:53 -0600 (CST) X-Authentication-Warning: raven.dms.auburn.edu: teirllm set sender to teirllm@dms.auburn.edu using -f Original-To: emacs-devel@gnu.org X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0.1 (manatee.dms.auburn.edu [131.204.53.104]); Fri, 09 Dec 2005 21:49:20 -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:47362 Archived-At: I believe that there are two things wrong with `customize-apropos'. Do `M-x customize-apropos RET buffer-menu'. Note that the buffer contains: Buffer-menu-sort-column: Hide Value nil State: NO CUSTOMIZATION DATA; you should not see this. 2 for sorting by buffer names. 5 for sorting by file names. More I believe that this should not happen. Variables should not be included in the customize-apropos output just because their docstring starts with a `*'. If a variable should appear in a customization buffer, one should define it with defcustom. I believe that this "feature" is just a remnant from the early days of Custom when barely any variable had a defcustom. I do not believe that the whole buffer "Reset to Current" or "Reset to Saved" whole buffer buttons can handle this type of options. (The "Erase Customization" whole buffer button can handle them: it ignores them, as it should.) As a side remark, I believe that Buffer-menu-sort-column should either be defined with defcustom, or (more likely) its docstring should not start with a `*'. (Is this variable not purely internal?) A second problem with customize-apropos is that it can list several aliases for the same option separately. That can lead to quite some confusion, especially if somebody would ever try to use any of these dubious whole buffer buttons in such a buffer. The patch below fixes these two problems. If people absolutely want to list non-defcustomed variables in the Custom buffer, they still can after my patch, by giving customize-apropos a numeric argument. ===File ~/cus-edit-diff===================================== *** cus-edit.el 08 Dec 2005 15:14:58 -0600 1.245 --- cus-edit.el 09 Dec 2005 20:23:10 -0600 *************** *** 1252,1263 **** ;;;###autoload (defun customize-apropos (regexp &optional all) ! "Customize all user options matching REGEXP. If ALL is `options', include only options. If ALL is `faces', include only faces. If ALL is `groups', include only groups. ! If ALL is t (interactively, with prefix arg), include options which are not ! user-settable, as well as faces and groups." (interactive "sCustomize regexp: \nP") (let ((found nil)) (mapatoms (lambda (symbol) --- 1252,1263 ---- ;;;###autoload (defun customize-apropos (regexp &optional all) ! "Customize all options, faces and groups matching REGEXP. If ALL is `options', include only options. If ALL is `faces', include only faces. If ALL is `groups', include only groups. ! If ALL is t (interactively, with prefix arg), include variables ! that are not customizable options, as well as faces and groups." (interactive "sCustomize regexp: \nP") (let ((found nil)) (mapatoms (lambda (symbol) *************** *** 1270,1280 **** (push (list symbol 'custom-face) found)) (when (and (not (memq all '(groups faces))) (boundp symbol) (or (get symbol 'saved-value) (custom-variable-p symbol) ! (if (memq all '(nil options)) ! (user-variable-p symbol) ! (get symbol 'variable-documentation)))) (push (list symbol 'custom-variable) found))))) (if (not found) (error "No matches") --- 1270,1280 ---- (push (list symbol 'custom-face) found)) (when (and (not (memq all '(groups faces))) (boundp symbol) + (eq (indirect-variable symbol) symbol) (or (get symbol 'saved-value) (custom-variable-p symbol) ! (and (not (memq all '(nil options))) ! (get symbol 'variable-documentation)))) (push (list symbol 'custom-variable) found))))) (if (not found) (error "No matches") *************** *** 1284,1291 **** ;;;###autoload (defun customize-apropos-options (regexp &optional arg) ! "Customize all user options matching REGEXP. ! With prefix arg, include options which are not user-settable." (interactive "sCustomize regexp: \nP") (customize-apropos regexp (or arg 'options))) --- 1284,1291 ---- ;;;###autoload (defun customize-apropos-options (regexp &optional arg) ! "Customize all customizable options matching REGEXP. ! With prefix arg, include variables that are not customizable options." (interactive "sCustomize regexp: \nP") (customize-apropos regexp (or arg 'options))) ============================================================