From: Drew Adams <drew.adams@oracle.com>
To: Thorsten Jolitz <tjolitz@gmail.com>, help-gnu-emacs@gnu.org
Subject: RE: How to get a list of all commands with given prefix?
Date: Tue, 18 Mar 2014 16:25:53 -0700 (PDT) [thread overview]
Message-ID: <06caca3d-1b40-407b-87f3-0ce7327d3c85@default> (raw)
In-Reply-To: <87lhw7mlrg.fsf@gmail.com>
> I wonder how I can easily get a list of all interactive commands with a
> given prefix 'foo-' in a program (non-interactively)?
(defun foo (prefix &optional msgp)
(interactive "sPrefix: \np")
(let ((cmds ()))
(mapatoms
(lambda (symb) (when (and (commandp symb)
(string-match-p
(format "\\`%s" (regexp-quote prefix))
(symbol-name symb)))
(push symb cmds))))
(when msgp (pp-eval-expression 'cmds))))
(Interactive only so you can check it.)
next prev parent reply other threads:[~2014-03-18 23:25 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-18 17:58 How to get a list of all commands with given prefix? Thorsten Jolitz
2014-03-18 18:03 ` Jambunathan K
2014-03-19 0:09 ` Thorsten Jolitz
2014-03-19 15:27 ` Jambunathan K
2014-03-19 8:03 ` Thorsten Jolitz
2014-03-19 8:14 ` Thorsten Jolitz
2014-03-19 8:28 ` Jambunathan K
2014-03-19 8:29 ` Jambunathan K
2014-03-18 18:16 ` Jambunathan K
2014-03-19 7:59 ` Alex Bennée
2014-03-19 8:23 ` Thorsten Jolitz
2014-03-19 10:02 ` Michael Heerdegen
2014-03-18 23:25 ` Drew Adams [this message]
2014-03-19 1:07 ` Thorsten Jolitz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=06caca3d-1b40-407b-87f3-0ce7327d3c85@default \
--to=drew.adams@oracle.com \
--cc=help-gnu-emacs@gnu.org \
--cc=tjolitz@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.