diff options
| author | Richard M. Stallman | 1995-04-03 21:38:06 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1995-04-03 21:38:06 +0000 |
| commit | 4de5599d7dd288baa6621b5d6466451a0e291e7e (patch) | |
| tree | cfcfd221f529c4ab2e64f4bd25ee64e7ad977b1f | |
| parent | 38832b4c51178aaf2fc0664cf8c9b7c4fe4a5a7b (diff) | |
| download | emacs-4de5599d7dd288baa6621b5d6466451a0e291e7e.tar.gz emacs-4de5599d7dd288baa6621b5d6466451a0e291e7e.zip | |
(apropos): Use apropos-worthy-symbol-p as default predicate.
(apropos-worthy-symbol-p): New function.
| -rw-r--r-- | lisp/apropos.el | 11 |
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 @@ | |||
| 50 | Makes them run 2 or 3 times slower. Set this non-nil if you have a fast | 50 | Makes them run 2 or 3 times slower. Set this non-nil if you have a fast |
| 51 | machine.") | 51 | machine.") |
| 52 | 52 | ||
| 53 | (defun apropos-worthy-symbol-p (symbol) | ||
| 54 | "Return non-nil if SYMBOL is not worthless." | ||
| 55 | (or (fboundp symbol) | ||
| 56 | (boundp symbol) | ||
| 57 | (symbol-plist symbol))) | ||
| 58 | |||
| 53 | ;;;###autoload | 59 | ;;;###autoload |
| 54 | (defun apropos (regexp &optional do-all pred no-header) | 60 | (defun apropos (regexp &optional do-all pred no-header) |
| 55 | "Show all symbols whose names contain matches for REGEXP. | 61 | "Show all symbols whose names contain matches for REGEXP. |
| 56 | If optional argument DO-ALL is non-nil (prefix argument if interactive), | 62 | If optional argument DO-ALL is non-nil (prefix argument if interactive), |
| 57 | or if `apropos-do-all' is non-nil, does more (time-consuming) work such as | 63 | or if `apropos-do-all' is non-nil, does more (time-consuming) work such as |
| 58 | showing key bindings. Optional argument PRED is called with each symbol, and | 64 | showing key bindings. Optional argument PRED is called with each symbol, and |
| 59 | if it returns nil, the symbol is not shown. | 65 | if it returns nil, the symbol is not shown. If PRED is nil, the |
| 66 | default predicate is that the symbol has a value, function definition | ||
| 67 | or property list. | ||
| 60 | 68 | ||
| 61 | Optional argument NO-HEADER means don't print `Function:' or `Variable:' | 69 | Optional argument NO-HEADER means don't print `Function:' or `Variable:' |
| 62 | in the output. | 70 | in the output. |
| @@ -64,6 +72,7 @@ in the output. | |||
| 64 | Returns list of symbols and documentation found." | 72 | Returns list of symbols and documentation found." |
| 65 | (interactive "sApropos (regexp): \nP") | 73 | (interactive "sApropos (regexp): \nP") |
| 66 | (setq do-all (or apropos-do-all do-all)) | 74 | (setq do-all (or apropos-do-all do-all)) |
| 75 | (setq pred (or pred 'apropos-worthy-symbol-p)) | ||
| 67 | (let ((apropos-accumulate (apropos-internal regexp pred))) | 76 | (let ((apropos-accumulate (apropos-internal regexp pred))) |
| 68 | (if (null apropos-accumulate) | 77 | (if (null apropos-accumulate) |
| 69 | (message "No apropos matches for `%s'" regexp) | 78 | (message "No apropos matches for `%s'" regexp) |