From 170faae31b13defc35a26ee6429dcb82066a6a66 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Sat, 2 May 2020 12:29:13 +0200 Subject: [PATCH] Add new command apropos-function (Bug#41021) * lisp/apropos.el (apropos-function): New command. * etc/NEWS: Announce it. --- etc/NEWS | 3 +++ lisp/apropos.el | 14 ++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/etc/NEWS b/etc/NEWS index db2374112ac..ddb42fbb4b6 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -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. diff --git a/lisp/apropos.el b/lisp/apropos.el index 2566d44dfcf..6d8c7847b02 100644 --- a/lisp/apropos.el +++ b/lisp/apropos.el @@ -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) -- 2.39.5