]> git.eshelyaron.com Git - emacs.git/commitdiff
Remove non-option variable handling from customize-apropos
authorChong Yidong <cyd@gnu.org>
Mon, 23 Apr 2012 12:37:55 +0000 (20:37 +0800)
committerChong Yidong <cyd@gnu.org>
Mon, 23 Apr 2012 12:37:55 +0000 (20:37 +0800)
and enable use of word lists for customize-apropos-options etc.

* lisp/apropos.el (apropos-read-pattern): Make prompt less cryptic.

* lisp/cus-edit.el (customize-apropos, customize-apropos-options):
Disable matching of non-option variables.
(customize-option, customize-option-other-window)
(customize-changed-options): Doc fix.
(customize-apropos-options, customize-apropos-faces)
(customize-apropos-groups): Use apropos-read-pattern.

Fixes: debbugs:11176
etc/NEWS
lisp/ChangeLog
lisp/apropos.el
lisp/cus-edit.el

index e728002230c0825c2725d1136b233063af36cdf7..c4f89ab4a3bf02d0ec312b7a6088ebac7caec4d1 100644 (file)
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -78,6 +78,10 @@ character when doing minibuffer filename prompts.
 
 *** `custom-reset-button-menu' now defaults to t.
 
+*** Non-option variables are never matched in `customize-apropos' and
+`customize-apropos-options' (i.e. the prefix argument does nothing for
+these commands now).
+
 ** erc will look up server/channel names via auth-source and use the
 channel keys found, if any.
 
index 09245416423f50d2542e3f11093652e5a0ef69b8..41b00159aeef32ea51c47ffa026ccc19b240441a 100644 (file)
@@ -1,3 +1,14 @@
+2012-04-23  Chong Yidong  <cyd@gnu.org>
+
+       * cus-edit.el (customize-apropos, customize-apropos-options):
+       Disable matching of non-option variables (Bug#11176).
+       (customize-option, customize-option-other-window)
+       (customize-changed-options): Doc fix.
+       (customize-apropos-options, customize-apropos-faces)
+       (customize-apropos-groups): Use apropos-read-pattern (Bug#11124).
+
+       * apropos.el (apropos-read-pattern): Make prompt less cryptic.
+
 2012-04-23  Michael Albinus  <michael.albinus@gmx.de>
 
        * net/xesam.el (xesam-mode-map): Use let-bound map in
index 56b27e9b9b43d631ad258d6244f1255783ab51d8..6bf396a1632c8cc0c36a7802ea90aed8447d267f 100644 (file)
@@ -333,7 +333,7 @@ literally, or a string which is used as a regexp to search for.
 SUBJECT is a string that is included in the prompt to identify what
 kind of objects to search."
   (let ((pattern
-        (read-string (concat "Apropos " subject " (word list or regexp): "))))
+        (read-string (concat "Search for " subject " (word list or regexp): "))))
     (if (string-equal (regexp-quote pattern) pattern)
        ;; Split into words
        (split-string pattern "[ \t]+")
index 924cbcddfc8705144a0df3e98736b9e3e8031f8c..4a003f2d04310ee982234eb80158f3b831c47c01 100644 (file)
@@ -1131,7 +1131,7 @@ If OTHER-WINDOW is non-nil, display in another window."
 
 ;;;###autoload
 (defun customize-option (symbol)
-  "Customize SYMBOL, which must be a user option variable."
+  "Customize SYMBOL, which must be a user option."
   (interactive (custom-variable-prompt))
   (unless symbol
     (error "No variable specified"))
@@ -1147,7 +1147,7 @@ If OTHER-WINDOW is non-nil, display in another window."
 
 ;;;###autoload
 (defun customize-option-other-window (symbol)
-  "Customize SYMBOL, which must be a user option variable.
+  "Customize SYMBOL, which must be a user option.
 Show the buffer in another window, but don't select it."
   (interactive (custom-variable-prompt))
   (unless symbol
@@ -1201,9 +1201,10 @@ the official name of the package, such as MH-E or Gnus.")
 ;;;###autoload
 (defun customize-changed-options (&optional since-version)
   "Customize all settings whose meanings have changed in Emacs itself.
-This includes new user option variables and faces, and new
-customization groups, as well as older options and faces whose meanings
-or default values have changed since the previous major Emacs release.
+This includes new user options and faces, and new customization
+groups, as well as older options and faces whose meanings or
+default values have changed since the previous major Emacs
+release.
 
 With argument SINCE-VERSION (a string), customize all settings
 that were added or redefined since that version."
@@ -1411,7 +1412,7 @@ suggest to customize that face, if it's customizable."
 
 ;;;###autoload
 (defun customize-apropos (pattern &optional type)
-  "Customize all loaded options, faces and groups matching PATTERN.
+  "Customize loaded options, faces and groups matching PATTERN.
 PATTERN can be a word, a list of words (separated by spaces),
 or a regexp (using some regexp special characters).  If it is a word,
 search for matches for that word as a substring.  If it is a list of words,
@@ -1419,62 +1420,50 @@ search for matches for any two (or more) of those words.
 
 If TYPE is `options', include only options.
 If TYPE is `faces', include only faces.
-If TYPE is `groups', include only groups.
-If TYPE is t (interactively, with prefix arg), include variables
-that are not customizable options, as well as faces and groups
-\(but we recommend using `apropos-variable' instead)."
-  (interactive (list (apropos-read-pattern "symbol") current-prefix-arg))
+If TYPE is `groups', include only groups."
+  (interactive (list (apropos-read-pattern "symbol") nil))
   (require 'apropos)
+  (unless (memq type '(nil options faces groups))
+    (error "Invalid setting type %s" (symbol-name type)))
   (apropos-parse-pattern pattern)
   (let (found)
     (mapatoms
      `(lambda (symbol)
        (when (string-match apropos-regexp (symbol-name symbol))
-         ,(if (not (memq type '(faces options)))
+         ,(if (memq type '(nil groups))
               '(if (get symbol 'custom-group)
                    (push (list symbol 'custom-group) found)))
-         ,(if (not (memq type '(options groups)))
+         ,(if (memq type '(nil faces))
               '(if (custom-facep symbol)
                    (push (list symbol 'custom-face) found)))
-         ,(if (not (memq type '(groups faces)))
+         ,(if (memq type '(nil options))
               `(if (and (boundp symbol)
                         (eq (indirect-variable symbol) symbol)
                         (or (get symbol 'saved-value)
-                            (custom-variable-p symbol)
-                            ,(if (not (memq type '(nil options)))
-                                 '(get symbol 'variable-documentation))))
+                            (custom-variable-p symbol)))
                    (push (list symbol 'custom-variable) found))))))
-    (if (not found)
-       (error "No %s matching %s"
-              (if (eq type t)
-                  "items"
-                (format "customizable %s"
-                        (if (memq type '(options faces groups))
-                            (symbol-name type)
-                          "items")))
-              pattern)
-      (custom-buffer-create
-       (custom-sort-items found t custom-buffer-order-groups)
-       "*Customize Apropos*"))))
+    (unless found
+      (error "No customizable %s matching %s" (symbol-name type) pattern))
+    (custom-buffer-create
+     (custom-sort-items found t custom-buffer-order-groups)
+     "*Customize Apropos*")))
 
 ;;;###autoload
-(defun customize-apropos-options (regexp &optional arg)
-  "Customize all loaded customizable options matching REGEXP.
-With prefix ARG, include variables that are not customizable options
-\(but it is better to use `apropos-variable' if you want to find those)."
-  (interactive "sCustomize options (regexp): \nP")
-  (customize-apropos regexp (or arg 'options)))
+(defun customize-apropos-options (regexp &optional ignored)
+  "Customize all loaded customizable options matching REGEXP."
+  (interactive (list (apropos-read-pattern "options")))
+  (customize-apropos regexp 'options))
 
 ;;;###autoload
 (defun customize-apropos-faces (regexp)
   "Customize all loaded faces matching REGEXP."
-  (interactive "sCustomize faces (regexp): \n")
+  (interactive (list (apropos-read-pattern "faces")))
   (customize-apropos regexp 'faces))
 
 ;;;###autoload
 (defun customize-apropos-groups (regexp)
   "Customize all loaded groups matching REGEXP."
-  (interactive "sCustomize groups (regexp): \n")
+  (interactive (list (apropos-read-pattern "groups")))
   (customize-apropos regexp 'groups))
 
 ;;; Buffer.