From: Thorsten Jolitz <tjolitz@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: How to get a list of all commands with given prefix?
Date: Wed, 19 Mar 2014 01:09:01 +0100 [thread overview]
Message-ID: <87zjkngici.fsf@gmail.com> (raw)
In-Reply-To: 87r45z1j1l.fsf@gmail.com
Jambunathan K <kjambunathan@gmail.com> writes:
> Thorsten Jolitz <tjolitz@gmail.com> writes:
>
>> Hi List,
>>
>> I wonder how I can easily get a list of all interactive commands with a
>> given prefix 'foo-' in a program (non-interactively)?
>
>
> Use this as a starter.
>
> (require 'cl)
> (remove-if-not 'commandp obarray)
thanks, that brought me on the right track. So its really easy to get
a list of the impressive number of org-mode commands:
#+begin_src emacs-lisp
(setq org-cmds nil)
(defun omm-get-org-cmd-syms (s)
"Return a list of all symbols in obarray that are Org commands."
(and (commandp s)
(string-match "\\(^org-\\|^orgtbl-\\)" (symbol-name s))
(push s org-cmds)))
(mapatoms 'omm-get-org-cmd-syms)
(length org-cmds)
#+end_src
#+results:
: 639
--
cheers,
Thorsten
next prev parent reply other threads:[~2014-03-19 0:09 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 [this message]
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
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87zjkngici.fsf@gmail.com \
--to=tjolitz@gmail.com \
--cc=help-gnu-emacs@gnu.org \
/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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).