aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBastien Guerry2013-01-07 23:00:55 +0100
committerBastien Guerry2013-01-07 23:00:55 +0100
commitacfe10b71c260718f72445cd984327c1d96063ab (patch)
tree46b774b32c4625c8b0a4991485d48ffc0ef0fbfc
parent62bcf6709991d2c5dda92dc931e308f7e040c123 (diff)
downloademacs-acfe10b71c260718f72445cd984327c1d96063ab.tar.gz
emacs-acfe10b71c260718f72445cd984327c1d96063ab.zip
Introduce `apropos-user-option' and update `apropos-variable'. (Bug#13276)
-rw-r--r--doc/emacs/ChangeLog5
-rw-r--r--doc/emacs/help.texi9
-rw-r--r--lisp/ChangeLog15
-rw-r--r--lisp/apropos.el40
-rw-r--r--lisp/menu-bar.el4
5 files changed, 64 insertions, 9 deletions
diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog
index 601949af88e..1b5bdc8fb53 100644
--- a/doc/emacs/ChangeLog
+++ b/doc/emacs/ChangeLog
@@ -1,3 +1,8 @@
12013-01-07 Bastien Guerry <bzg@gnu.org>
2
3 * help.texi (Apropos): Document `apropos-user-option' and update
4 the doc for `apropos-variable'.
5
12013-01-05 Glenn Morris <rgm@gnu.org> 62013-01-05 Glenn Morris <rgm@gnu.org>
2 7
3 * text.texi (HTML Mode): Remove deleted nxml C-RET binding. 8 * text.texi (HTML Mode): Remove deleted nxml C-RET binding.
diff --git a/doc/emacs/help.texi b/doc/emacs/help.texi
index 0a0a3865d2d..75b250d0f40 100644
--- a/doc/emacs/help.texi
+++ b/doc/emacs/help.texi
@@ -295,11 +295,16 @@ search for noninteractive functions too.
295Search for functions and variables. Both interactive functions 295Search for functions and variables. Both interactive functions
296(commands) and noninteractive functions can be found by this. 296(commands) and noninteractive functions can be found by this.
297 297
298@item M-x apropos-variable 298@item M-x apropos-user-option
299@findex apropos-variable 299@findex apropos-user-option
300Search for user-customizable variables. With a prefix argument, 300Search for user-customizable variables. With a prefix argument,
301search for non-customizable variables too. 301search for non-customizable variables too.
302 302
303@item M-x apropos-variable
304@findex apropos-variable
305Search for variables. With a prefix argument, search for
306customizable variables only.
307
303@item M-x apropos-value 308@item M-x apropos-value
304@findex apropos-value 309@findex apropos-value
305Search for variables whose values match the specified pattern. With a 310Search for variables whose values match the specified pattern. With a
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index ac7401aba56..185bf74bc05 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,18 @@
12013-01-07 Bastien Guerry <bzg@gnu.org>
2
3 * menu-bar.el (menu-bar-search-documentation-menu): Use
4 `apropos-user-option' and fix the help message.
5
62013-01-07 Bastien Guerry <bzg@gnu.org>
7
8 * apropos.el (apropos-do-all): Update docstring.
9 (apropos-user-option-button): New face.
10 (apropos-user-option): Rename from `apropos-variable' and update
11 docstring.
12 (apropos-variable): Rewrite, now show all variables by default.
13 (apropos-print): Mention "User option" instead of "Variable" when
14 printing doc for user options. (Bug#13276)
15
12013-01-07 Jürgen Hötzel <juergen@archlinux.org> 162013-01-07 Jürgen Hötzel <juergen@archlinux.org>
2 17
3 * net/tramp-adb.el (tramp-do-parse-file-attributes-with-ls): 18 * net/tramp-adb.el (tramp-do-parse-file-attributes-with-ls):
diff --git a/lisp/apropos.el b/lisp/apropos.el
index 5f481f54e57..000d2d87d05 100644
--- a/lisp/apropos.el
+++ b/lisp/apropos.el
@@ -69,7 +69,7 @@
69 "Non nil means apropos commands will search more extensively. 69 "Non nil means apropos commands will search more extensively.
70This may be slower. This option affects the following commands: 70This may be slower. This option affects the following commands:
71 71
72`apropos-variable' will search all variables, not just user variables. 72`apropos-user-option' will search all variables, not just user options.
73`apropos-command' will also search non-interactive functions. 73`apropos-command' will also search non-interactive functions.
74`apropos' will search all symbols, not just functions, variables, faces, 74`apropos' will search all symbols, not just functions, variables, faces,
75and those with property lists. 75and those with property lists.
@@ -115,6 +115,12 @@ include key-binding information in its output."
115 :group 'apropos 115 :group 'apropos
116 :version "24.3") 116 :version "24.3")
117 117
118(defface apropos-user-option-button
119 '((t (:inherit (font-lock-variable-name-face button))))
120 "Button face indicating a user option in Apropos."
121 :group 'apropos
122 :version "24.4")
123
118(defface apropos-misc-button 124(defface apropos-misc-button
119 '((t (:inherit (font-lock-constant-face button)))) 125 '((t (:inherit (font-lock-constant-face button))))
120 "Button face indicating a miscellaneous object type in Apropos." 126 "Button face indicating a miscellaneous object type in Apropos."
@@ -261,6 +267,15 @@ term, and the rest of the words are alternative terms.")
261 'action (lambda (button) 267 'action (lambda (button)
262 (describe-variable (button-get button 'apropos-symbol)))) 268 (describe-variable (button-get button 'apropos-symbol))))
263 269
270(define-button-type 'apropos-user-option
271 'apropos-label "User option"
272 'apropos-short-label "o"
273 'face 'apropos-user-option-button
274 'help-echo "mouse-2, RET: Display more help on this user option"
275 'follow-link t
276 'action (lambda (button)
277 (describe-variable (button-get button 'apropos-symbol))))
278
264(define-button-type 'apropos-face 279(define-button-type 'apropos-face
265 'apropos-label "Face" 280 'apropos-label "Face"
266 'apropos-short-label "F" 281 'apropos-short-label "F"
@@ -461,15 +476,15 @@ This requires that at least 2 keywords (unless only one was given)."
461This is used to decide whether to print the result's type or not.") 476This is used to decide whether to print the result's type or not.")
462 477
463;;;###autoload 478;;;###autoload
464(defun apropos-variable (pattern &optional do-all) 479(defun apropos-user-option (pattern &optional do-all)
465 "Show user variables that match PATTERN. 480 "Show user options that match PATTERN.
466PATTERN can be a word, a list of words (separated by spaces), 481PATTERN can be a word, a list of words (separated by spaces),
467or a regexp (using some regexp special characters). If it is a word, 482or a regexp (using some regexp special characters). If it is a word,
468search for matches for that word as a substring. If it is a list of words, 483search for matches for that word as a substring. If it is a list of words,
469search for matches for any two (or more) of those words. 484search for matches for any two (or more) of those words.
470 485
471With \\[universal-argument] prefix, or if `apropos-do-all' is non-nil, also show 486With \\[universal-argument] prefix, or if `apropos-do-all' is non-nil, also show
472normal variables." 487variables, not just user options."
473 (interactive (list (apropos-read-pattern 488 (interactive (list (apropos-read-pattern
474 (if (or current-prefix-arg apropos-do-all) 489 (if (or current-prefix-arg apropos-do-all)
475 "variable" "user option")) 490 "variable" "user option"))
@@ -481,6 +496,17 @@ normal variables."
481 (get symbol 'variable-documentation))) 496 (get symbol 'variable-documentation)))
482 'custom-variable-p))) 497 'custom-variable-p)))
483 498
499;;;###autoload
500(defun apropos-variable (pattern &optional do-not-all)
501 "Show variables that match PATTERN.
502When DO-NOT-ALL is not-nil, show user options only, i.e. behave
503like `apropos-user-option'."
504 (interactive (list (apropos-read-pattern
505 (if current-prefix-arg "user option" "variable"))
506 current-prefix-arg))
507 (let ((apropos-do-all (if do-not-all nil t)))
508 (apropos-user-option pattern)))
509
484;; For auld lang syne: 510;; For auld lang syne:
485;;;###autoload 511;;;###autoload
486(defalias 'command-apropos 'apropos-command) 512(defalias 'command-apropos 'apropos-command)
@@ -1099,7 +1125,11 @@ If non-nil TEXT is a string that will be printed as a heading."
1099 'apropos-macro 1125 'apropos-macro
1100 'apropos-function)) 1126 'apropos-function))
1101 (not nosubst)) 1127 (not nosubst))
1102 (apropos-print-doc 3 'apropos-variable (not nosubst)) 1128 (apropos-print-doc 3
1129 (if (custom-variable-p symbol)
1130 'apropos-user-option
1131 'apropos-variable)
1132 (not nosubst))
1103 (apropos-print-doc 7 'apropos-group t) 1133 (apropos-print-doc 7 'apropos-group t)
1104 (apropos-print-doc 6 'apropos-face t) 1134 (apropos-print-doc 6 'apropos-face t)
1105 (apropos-print-doc 5 'apropos-widget t) 1135 (apropos-print-doc 5 'apropos-widget t)
diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el
index 024e2237cae..60f2bc2999f 100644
--- a/lisp/menu-bar.el
+++ b/lisp/menu-bar.el
@@ -1637,8 +1637,8 @@ key, a click, or a menu-item"))
1637 '(menu-item "Find Options by Value..." apropos-value 1637 '(menu-item "Find Options by Value..." apropos-value
1638 :help "Find variables whose values match a regexp")) 1638 :help "Find variables whose values match a regexp"))
1639 (bindings--define-key menu [find-options-by-name] 1639 (bindings--define-key menu [find-options-by-name]
1640 '(menu-item "Find Options by Name..." apropos-variable 1640 '(menu-item "Find Options by Name..." apropos-user-option
1641 :help "Find variables whose names match a regexp")) 1641 :help "Find user options whose names match a regexp"))
1642 (bindings--define-key menu [find-commands-by-name] 1642 (bindings--define-key menu [find-commands-by-name]
1643 '(menu-item "Find Commands by Name..." apropos-command 1643 '(menu-item "Find Commands by Name..." apropos-command
1644 :help "Find commands whose names match a regexp")) 1644 :help "Find commands whose names match a regexp"))