diff options
author | Richard M. Stallman <rms@gnu.org> | 1998-05-24 23:19:37 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 1998-05-24 23:19:37 +0000 |
commit | 9a909b3c4258dca64eb91065a6c07925232babf6 (patch) | |
tree | 6e4a33778a598c5497e1bf0f9b4858226088097b /lisp/apropos.el | |
parent | 05942d060ed2ef46e3358ad5ec22ed7fb90f0578 (diff) | |
download | emacs-9a909b3c4258dca64eb91065a6c07925232babf6.tar.gz |
(apropos-command): If DO-ALL is set, search functions, not variables.
Diffstat (limited to 'lisp/apropos.el')
-rw-r--r-- | lisp/apropos.el | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/lisp/apropos.el b/lisp/apropos.el index 94701b8f27a..34dabdf0b2c 100644 --- a/lisp/apropos.el +++ b/lisp/apropos.el @@ -165,15 +165,15 @@ normal variables." (defun apropos-command (apropos-regexp &optional do-all var-predicate) "Show commands (interactively callable functions) that match REGEXP. With optional prefix ARG, or if `apropos-do-all' is non-nil, also show -user option variables. +noninteractive functions. -If VAR-PREDICATE is non-nil, show only variables that +If VAR-PREDICATE is non-nil, show only variables, and only those that satisfy the predicate VAR-PREDICATE." (interactive (list (read-string (concat "Apropos command " (if (or current-prefix-arg apropos-do-all) - "or variable ") + "or function ") "(regexp): ")) current-prefix-arg)) (let ((message @@ -182,12 +182,8 @@ satisfy the predicate VAR-PREDICATE." (or do-all (setq do-all apropos-do-all)) (setq apropos-accumulator (apropos-internal apropos-regexp - (if do-all - (lambda (symbol) (or (commandp symbol) - (user-variable-p symbol))) + (if do-all 'functionp (or var-predicate 'commandp)))) - (if do-all - (setq var-predicate 'user-variable-p)) (let ((tem apropos-accumulator)) (while tem (if (get (car tem) 'apropos-inhibit) @@ -200,11 +196,11 @@ satisfy the predicate VAR-PREDICATE." (while p (setcar p (list (setq symbol (car p)) - (if (or do-all (not var-predicate)) - (if (commandp symbol) - (if (setq doc (documentation symbol t)) - (substring doc 0 (string-match "\n" doc)) - "(not documented)"))) + (unless var-predicate + (if (functionp symbol) + (if (setq doc (documentation symbol t)) + (substring doc 0 (string-match "\n" doc)) + "(not documented)"))) (and var-predicate (funcall var-predicate symbol) (if (setq doc (documentation-property |