summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1995-04-03 21:38:06 +0000
committerRichard M. Stallman <rms@gnu.org>1995-04-03 21:38:06 +0000
commitd91210fa6c0ac40eeb767b5877ad63a34ae7bfcd (patch)
tree7e920a4440f2fe7cd70b8c309d1810dbeec21f66
parent66d57ebc9e4e4c2a3b172a67aba065d489f0e4bd (diff)
downloademacs-d91210fa6c0ac40eeb767b5877ad63a34ae7bfcd.tar.gz
(apropos): Use apropos-worthy-symbol-p as default predicate.
(apropos-worthy-symbol-p): New function.
-rw-r--r--lisp/apropos.el11
1 files changed, 10 insertions, 1 deletions
diff --git a/lisp/apropos.el b/lisp/apropos.el
index 28487ff7f1d..5b3c164e690 100644
--- a/lisp/apropos.el
+++ b/lisp/apropos.el
@@ -50,13 +50,21 @@
Makes them run 2 or 3 times slower. Set this non-nil if you have a fast
machine.")
+(defun apropos-worthy-symbol-p (symbol)
+ "Return non-nil if SYMBOL is not worthless."
+ (or (fboundp symbol)
+ (boundp symbol)
+ (symbol-plist symbol)))
+
;;;###autoload
(defun apropos (regexp &optional do-all pred no-header)
"Show all symbols whose names contain matches for REGEXP.
If optional argument DO-ALL is non-nil (prefix argument if interactive),
or if `apropos-do-all' is non-nil, does more (time-consuming) work such as
showing key bindings. Optional argument PRED is called with each symbol, and
-if it returns nil, the symbol is not shown.
+if it returns nil, the symbol is not shown. If PRED is nil, the
+default predicate is that the symbol has a value, function definition
+or property list.
Optional argument NO-HEADER means don't print `Function:' or `Variable:'
in the output.
@@ -64,6 +72,7 @@ in the output.
Returns list of symbols and documentation found."
(interactive "sApropos (regexp): \nP")
(setq do-all (or apropos-do-all do-all))
+ (setq pred (or pred 'apropos-worthy-symbol-p))
(let ((apropos-accumulate (apropos-internal regexp pred)))
(if (null apropos-accumulate)
(message "No apropos matches for `%s'" regexp)