diff options
| author | Chong Yidong | 2012-04-23 20:37:55 +0800 |
|---|---|---|
| committer | Chong Yidong | 2012-04-23 20:37:55 +0800 |
| commit | 775c916bd7fb488b1a6cb907ee5522c0279d435c (patch) | |
| tree | b3e0e63113ecbee33a417424d223441a6df95632 | |
| parent | 2df41f9c6f22d4e001082df4301c73dccfd01ef0 (diff) | |
| download | emacs-775c916bd7fb488b1a6cb907ee5522c0279d435c.tar.gz emacs-775c916bd7fb488b1a6cb907ee5522c0279d435c.zip | |
Remove non-option variable handling from customize-apropos
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
| -rw-r--r-- | etc/NEWS | 4 | ||||
| -rw-r--r-- | lisp/ChangeLog | 11 | ||||
| -rw-r--r-- | lisp/apropos.el | 2 | ||||
| -rw-r--r-- | lisp/cus-edit.el | 63 |
4 files changed, 42 insertions, 38 deletions
| @@ -78,6 +78,10 @@ character when doing minibuffer filename prompts. | |||
| 78 | 78 | ||
| 79 | *** `custom-reset-button-menu' now defaults to t. | 79 | *** `custom-reset-button-menu' now defaults to t. |
| 80 | 80 | ||
| 81 | *** Non-option variables are never matched in `customize-apropos' and | ||
| 82 | `customize-apropos-options' (i.e. the prefix argument does nothing for | ||
| 83 | these commands now). | ||
| 84 | |||
| 81 | ** erc will look up server/channel names via auth-source and use the | 85 | ** erc will look up server/channel names via auth-source and use the |
| 82 | channel keys found, if any. | 86 | channel keys found, if any. |
| 83 | 87 | ||
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 09245416423..41b00159aee 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,14 @@ | |||
| 1 | 2012-04-23 Chong Yidong <cyd@gnu.org> | ||
| 2 | |||
| 3 | * cus-edit.el (customize-apropos, customize-apropos-options): | ||
| 4 | Disable matching of non-option variables (Bug#11176). | ||
| 5 | (customize-option, customize-option-other-window) | ||
| 6 | (customize-changed-options): Doc fix. | ||
| 7 | (customize-apropos-options, customize-apropos-faces) | ||
| 8 | (customize-apropos-groups): Use apropos-read-pattern (Bug#11124). | ||
| 9 | |||
| 10 | * apropos.el (apropos-read-pattern): Make prompt less cryptic. | ||
| 11 | |||
| 1 | 2012-04-23 Michael Albinus <michael.albinus@gmx.de> | 12 | 2012-04-23 Michael Albinus <michael.albinus@gmx.de> |
| 2 | 13 | ||
| 3 | * net/xesam.el (xesam-mode-map): Use let-bound map in | 14 | * net/xesam.el (xesam-mode-map): Use let-bound map in |
diff --git a/lisp/apropos.el b/lisp/apropos.el index 56b27e9b9b4..6bf396a1632 100644 --- a/lisp/apropos.el +++ b/lisp/apropos.el | |||
| @@ -333,7 +333,7 @@ literally, or a string which is used as a regexp to search for. | |||
| 333 | SUBJECT is a string that is included in the prompt to identify what | 333 | SUBJECT is a string that is included in the prompt to identify what |
| 334 | kind of objects to search." | 334 | kind of objects to search." |
| 335 | (let ((pattern | 335 | (let ((pattern |
| 336 | (read-string (concat "Apropos " subject " (word list or regexp): ")))) | 336 | (read-string (concat "Search for " subject " (word list or regexp): ")))) |
| 337 | (if (string-equal (regexp-quote pattern) pattern) | 337 | (if (string-equal (regexp-quote pattern) pattern) |
| 338 | ;; Split into words | 338 | ;; Split into words |
| 339 | (split-string pattern "[ \t]+") | 339 | (split-string pattern "[ \t]+") |
diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el index 924cbcddfc8..4a003f2d043 100644 --- a/lisp/cus-edit.el +++ b/lisp/cus-edit.el | |||
| @@ -1131,7 +1131,7 @@ If OTHER-WINDOW is non-nil, display in another window." | |||
| 1131 | 1131 | ||
| 1132 | ;;;###autoload | 1132 | ;;;###autoload |
| 1133 | (defun customize-option (symbol) | 1133 | (defun customize-option (symbol) |
| 1134 | "Customize SYMBOL, which must be a user option variable." | 1134 | "Customize SYMBOL, which must be a user option." |
| 1135 | (interactive (custom-variable-prompt)) | 1135 | (interactive (custom-variable-prompt)) |
| 1136 | (unless symbol | 1136 | (unless symbol |
| 1137 | (error "No variable specified")) | 1137 | (error "No variable specified")) |
| @@ -1147,7 +1147,7 @@ If OTHER-WINDOW is non-nil, display in another window." | |||
| 1147 | 1147 | ||
| 1148 | ;;;###autoload | 1148 | ;;;###autoload |
| 1149 | (defun customize-option-other-window (symbol) | 1149 | (defun customize-option-other-window (symbol) |
| 1150 | "Customize SYMBOL, which must be a user option variable. | 1150 | "Customize SYMBOL, which must be a user option. |
| 1151 | Show the buffer in another window, but don't select it." | 1151 | Show the buffer in another window, but don't select it." |
| 1152 | (interactive (custom-variable-prompt)) | 1152 | (interactive (custom-variable-prompt)) |
| 1153 | (unless symbol | 1153 | (unless symbol |
| @@ -1201,9 +1201,10 @@ the official name of the package, such as MH-E or Gnus.") | |||
| 1201 | ;;;###autoload | 1201 | ;;;###autoload |
| 1202 | (defun customize-changed-options (&optional since-version) | 1202 | (defun customize-changed-options (&optional since-version) |
| 1203 | "Customize all settings whose meanings have changed in Emacs itself. | 1203 | "Customize all settings whose meanings have changed in Emacs itself. |
| 1204 | This includes new user option variables and faces, and new | 1204 | This includes new user options and faces, and new customization |
| 1205 | customization groups, as well as older options and faces whose meanings | 1205 | groups, as well as older options and faces whose meanings or |
| 1206 | or default values have changed since the previous major Emacs release. | 1206 | default values have changed since the previous major Emacs |
| 1207 | release. | ||
| 1207 | 1208 | ||
| 1208 | With argument SINCE-VERSION (a string), customize all settings | 1209 | With argument SINCE-VERSION (a string), customize all settings |
| 1209 | that were added or redefined since that version." | 1210 | that were added or redefined since that version." |
| @@ -1411,7 +1412,7 @@ suggest to customize that face, if it's customizable." | |||
| 1411 | 1412 | ||
| 1412 | ;;;###autoload | 1413 | ;;;###autoload |
| 1413 | (defun customize-apropos (pattern &optional type) | 1414 | (defun customize-apropos (pattern &optional type) |
| 1414 | "Customize all loaded options, faces and groups matching PATTERN. | 1415 | "Customize loaded options, faces and groups matching PATTERN. |
| 1415 | PATTERN can be a word, a list of words (separated by spaces), | 1416 | PATTERN can be a word, a list of words (separated by spaces), |
| 1416 | or a regexp (using some regexp special characters). If it is a word, | 1417 | or a regexp (using some regexp special characters). If it is a word, |
| 1417 | search for matches for that word as a substring. If it is a list of words, | 1418 | 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. | |||
| 1419 | 1420 | ||
| 1420 | If TYPE is `options', include only options. | 1421 | If TYPE is `options', include only options. |
| 1421 | If TYPE is `faces', include only faces. | 1422 | If TYPE is `faces', include only faces. |
| 1422 | If TYPE is `groups', include only groups. | 1423 | If TYPE is `groups', include only groups." |
| 1423 | If TYPE is t (interactively, with prefix arg), include variables | 1424 | (interactive (list (apropos-read-pattern "symbol") nil)) |
| 1424 | that are not customizable options, as well as faces and groups | ||
| 1425 | \(but we recommend using `apropos-variable' instead)." | ||
| 1426 | (interactive (list (apropos-read-pattern "symbol") current-prefix-arg)) | ||
| 1427 | (require 'apropos) | 1425 | (require 'apropos) |
| 1426 | (unless (memq type '(nil options faces groups)) | ||
| 1427 | (error "Invalid setting type %s" (symbol-name type))) | ||
| 1428 | (apropos-parse-pattern pattern) | 1428 | (apropos-parse-pattern pattern) |
| 1429 | (let (found) | 1429 | (let (found) |
| 1430 | (mapatoms | 1430 | (mapatoms |
| 1431 | `(lambda (symbol) | 1431 | `(lambda (symbol) |
| 1432 | (when (string-match apropos-regexp (symbol-name symbol)) | 1432 | (when (string-match apropos-regexp (symbol-name symbol)) |
| 1433 | ,(if (not (memq type '(faces options))) | 1433 | ,(if (memq type '(nil groups)) |
| 1434 | '(if (get symbol 'custom-group) | 1434 | '(if (get symbol 'custom-group) |
| 1435 | (push (list symbol 'custom-group) found))) | 1435 | (push (list symbol 'custom-group) found))) |
| 1436 | ,(if (not (memq type '(options groups))) | 1436 | ,(if (memq type '(nil faces)) |
| 1437 | '(if (custom-facep symbol) | 1437 | '(if (custom-facep symbol) |
| 1438 | (push (list symbol 'custom-face) found))) | 1438 | (push (list symbol 'custom-face) found))) |
| 1439 | ,(if (not (memq type '(groups faces))) | 1439 | ,(if (memq type '(nil options)) |
| 1440 | `(if (and (boundp symbol) | 1440 | `(if (and (boundp symbol) |
| 1441 | (eq (indirect-variable symbol) symbol) | 1441 | (eq (indirect-variable symbol) symbol) |
| 1442 | (or (get symbol 'saved-value) | 1442 | (or (get symbol 'saved-value) |
| 1443 | (custom-variable-p symbol) | 1443 | (custom-variable-p symbol))) |
| 1444 | ,(if (not (memq type '(nil options))) | ||
| 1445 | '(get symbol 'variable-documentation)))) | ||
| 1446 | (push (list symbol 'custom-variable) found)))))) | 1444 | (push (list symbol 'custom-variable) found)))))) |
| 1447 | (if (not found) | 1445 | (unless found |
| 1448 | (error "No %s matching %s" | 1446 | (error "No customizable %s matching %s" (symbol-name type) pattern)) |
| 1449 | (if (eq type t) | 1447 | (custom-buffer-create |
| 1450 | "items" | 1448 | (custom-sort-items found t custom-buffer-order-groups) |
| 1451 | (format "customizable %s" | 1449 | "*Customize Apropos*"))) |
| 1452 | (if (memq type '(options faces groups)) | ||
| 1453 | (symbol-name type) | ||
| 1454 | "items"))) | ||
| 1455 | pattern) | ||
| 1456 | (custom-buffer-create | ||
| 1457 | (custom-sort-items found t custom-buffer-order-groups) | ||
| 1458 | "*Customize Apropos*")))) | ||
| 1459 | 1450 | ||
| 1460 | ;;;###autoload | 1451 | ;;;###autoload |
| 1461 | (defun customize-apropos-options (regexp &optional arg) | 1452 | (defun customize-apropos-options (regexp &optional ignored) |
| 1462 | "Customize all loaded customizable options matching REGEXP. | 1453 | "Customize all loaded customizable options matching REGEXP." |
| 1463 | With prefix ARG, include variables that are not customizable options | 1454 | (interactive (list (apropos-read-pattern "options"))) |
| 1464 | \(but it is better to use `apropos-variable' if you want to find those)." | 1455 | (customize-apropos regexp 'options)) |
| 1465 | (interactive "sCustomize options (regexp): \nP") | ||
| 1466 | (customize-apropos regexp (or arg 'options))) | ||
| 1467 | 1456 | ||
| 1468 | ;;;###autoload | 1457 | ;;;###autoload |
| 1469 | (defun customize-apropos-faces (regexp) | 1458 | (defun customize-apropos-faces (regexp) |
| 1470 | "Customize all loaded faces matching REGEXP." | 1459 | "Customize all loaded faces matching REGEXP." |
| 1471 | (interactive "sCustomize faces (regexp): \n") | 1460 | (interactive (list (apropos-read-pattern "faces"))) |
| 1472 | (customize-apropos regexp 'faces)) | 1461 | (customize-apropos regexp 'faces)) |
| 1473 | 1462 | ||
| 1474 | ;;;###autoload | 1463 | ;;;###autoload |
| 1475 | (defun customize-apropos-groups (regexp) | 1464 | (defun customize-apropos-groups (regexp) |
| 1476 | "Customize all loaded groups matching REGEXP." | 1465 | "Customize all loaded groups matching REGEXP." |
| 1477 | (interactive "sCustomize groups (regexp): \n") | 1466 | (interactive (list (apropos-read-pattern "groups"))) |
| 1478 | (customize-apropos regexp 'groups)) | 1467 | (customize-apropos regexp 'groups)) |
| 1479 | 1468 | ||
| 1480 | ;;; Buffer. | 1469 | ;;; Buffer. |