unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* customize-apropos
@ 2005-12-10  3:47 Luc Teirlinck
  2005-12-10  3:51 ` customize-apropos Luc Teirlinck
                   ` (3 more replies)
  0 siblings, 4 replies; 33+ messages in thread
From: Luc Teirlinck @ 2005-12-10  3:47 UTC (permalink / raw)


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)))
  
============================================================

^ permalink raw reply	[flat|nested] 33+ messages in thread

end of thread, other threads:[~2005-12-16  5:09 UTC | newest]

Thread overview: 33+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-12-10  3:47 customize-apropos Luc Teirlinck
2005-12-10  3:51 ` customize-apropos Luc Teirlinck
2005-12-10 23:04 ` customize-apropos Kim F. Storm
2005-12-10 23:07   ` customize-apropos Luc Teirlinck
2005-12-11 16:49     ` customize-apropos Richard M. Stallman
2005-12-11  5:03 ` customize-apropos Richard M. Stallman
2005-12-11 17:57 ` customize-apropos Drew Adams
2005-12-12  5:03   ` customize-apropos Luc Teirlinck
2005-12-12  5:40     ` customize-apropos Drew Adams
2005-12-12 23:56       ` customize-apropos Luc Teirlinck
2005-12-13  0:22         ` customize-apropos Drew Adams
2005-12-13  0:45           ` customize-apropos Luc Teirlinck
2005-12-13  3:55             ` customize-apropos Drew Adams
2005-12-13  1:01           ` customize-apropos Luc Teirlinck
2005-12-13  1:29           ` customize-apropos Luc Teirlinck
2005-12-13 23:33         ` customize-apropos Richard M. Stallman
2005-12-14  1:14           ` customize-apropos Luc Teirlinck
2005-12-14  1:25             ` customize-apropos Drew Adams
2005-12-14  2:13               ` customize-apropos Luc Teirlinck
2005-12-14  3:20                 ` customize-apropos Drew Adams
2005-12-14  3:40                   ` customize-apropos Luc Teirlinck
2005-12-14  3:52                     ` customize-apropos Drew Adams
2005-12-14  5:58                       ` customize-apropos Luc Teirlinck
2005-12-14 15:07                         ` customize-apropos Drew Adams
2005-12-15  5:33                           ` customize-apropos Luc Teirlinck
2005-12-15 16:33                             ` customize-apropos Drew Adams
2005-12-16  5:09                               ` customize-apropos Richard M. Stallman
2005-12-14  3:45                   ` customize-apropos Luc Teirlinck
2005-12-14  3:54                     ` customize-apropos Drew Adams
2005-12-14 20:02             ` customize-apropos Richard M. Stallman
2005-12-15  4:18               ` customize-apropos Luc Teirlinck
2005-12-16  1:51                 ` customize-apropos Richard M. Stallman
2005-12-16  3:47                   ` customize-apropos Luc Teirlinck

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).