Add new command apropos-function (Bug#41021)

* lisp/apropos.el (apropos-function): New command.
* etc/NEWS: Announce it.
This commit is contained in:
Stefan Kangas 2020-05-02 12:29:13 +02:00
parent 4fc066a640
commit 170faae31b
2 changed files with 17 additions and 0 deletions

View file

@ -529,6 +529,9 @@ prefix on the Subject line in various languages.
These new navigation commands are bound to 'n' and 'p' in
'apropos-mode'.
*** New command 'apropos-function'.
This works like 'C-u M-x apropos-command' but is more discoverable.
** CC Mode
*** Added support for Doxygen documentation style.

View file

@ -543,6 +543,20 @@ will be buffer-local when set."
(and (local-variable-if-set-p symbol)
(get symbol 'variable-documentation)))))
;;;###autoload
(defun apropos-function (pattern)
"Show functions that match PATTERN.
PATTERN can be a word, a list of words (separated by spaces),
or a regexp (using some regexp special characters). If it is a word,
search for matches for that word as a substring. If it is a list of words,
search for matches for any two (or more) of those words.
This is the same as running `apropos-command' with a \\[universal-argument] prefix,
or a non-nil `apropos-do-all' argument."
(interactive (list (apropos-read-pattern "function")))
(apropos-command pattern t))
;; For auld lang syne:
;;;###autoload
(defalias 'command-apropos 'apropos-command)