all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#41021: [PATCH] New command apropos-function
@ 2020-05-02 10:40 Stefan Kangas
  2020-05-02 11:02 ` Eli Zaretskii
                   ` (4 more replies)
  0 siblings, 5 replies; 16+ messages in thread
From: Stefan Kangas @ 2020-05-02 10:40 UTC (permalink / raw)
  To: 41021


[-- Attachment #1.1: Type: text/plain, Size: 666 bytes --]

Severity: wishlist

I've often found myself reaching for 'apropos-function' command, and found
it strange that it was missing.  This typically would happen by saying M-x
apropos- TAB.  So now I got frustrated again and I decided to bite the
bullet and implement it.

Of course, I quickly realized that I had actually been looking for 'C-u M-x
apropos-command' all along.  But for some reason I never thought to read
the docstring of 'apropos-command'.  (Or maybe I read it at some point but
forgot about it.)

I think a new command would help make this feature more discoverable,
especially to beginners.  Please see the attached patch.

Best regards,
Stefan Kangas

[-- Attachment #1.2: Type: text/html, Size: 865 bytes --]

[-- Attachment #2: 0001-lisp-apropos.el-apropos-function-New-command.patch --]
[-- Type: text/x-patch, Size: 1303 bytes --]

From 89626dd8ba424dedca6862af2b96da1f6a30f827 Mon Sep 17 00:00:00 2001
From: Stefan Kangas <stefankangas@gmail.com>
Date: Sat, 2 May 2020 12:29:13 +0200
Subject: [PATCH] * lisp/apropos.el (apropos-function): New command.

---
 lisp/apropos.el | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/lisp/apropos.el b/lisp/apropos.el
index e40f94ccb8..1003de8aab 100644
--- a/lisp/apropos.el
+++ b/lisp/apropos.el
@@ -534,6 +534,20 @@ apropos-local-variable
                                  (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.26.2


^ permalink raw reply related	[flat|nested] 16+ messages in thread
[parent not found: <<CADwFkmkQxhX+UvfHacDJVi3tuGuzjiv0Eb5p6ywEOKUu4zmg4w@mail.gmail.com>]

end of thread, other threads:[~2020-08-10 13:37 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-05-02 10:40 bug#41021: [PATCH] New command apropos-function Stefan Kangas
2020-05-02 11:02 ` Eli Zaretskii
2020-05-02 11:35   ` Stefan Kangas
2020-05-02 11:52     ` Eli Zaretskii
2020-05-03  3:44     ` Richard Stallman
2020-05-02 13:37 ` Dmitry Gutov
2020-05-02 20:18 ` Drew Adams
2020-05-03 14:19   ` Eli Zaretskii
2020-05-04  3:09     ` Richard Stallman
2020-05-03  3:44 ` Richard Stallman
2020-08-08 12:04 ` Lars Ingebrigtsen
2020-08-10 13:06   ` Stefan Kangas
2020-08-10 13:22     ` Lars Ingebrigtsen
2020-08-10 13:25       ` Lars Ingebrigtsen
2020-08-10 13:37         ` Stefan Kangas
     [not found] <<CADwFkmkQxhX+UvfHacDJVi3tuGuzjiv0Eb5p6ywEOKUu4zmg4w@mail.gmail.com>
     [not found] ` <<603ebaa3-3014-4f98-9e1b-a89eeebee6af@default>
     [not found]   ` <<834ksxqexm.fsf@gnu.org>
2020-05-03 20:13     ` Drew Adams

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.