From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thorsten Jolitz Newsgroups: gmane.emacs.help Subject: Re: How to get a list of all commands with given prefix? Date: Wed, 19 Mar 2014 01:09:01 +0100 Message-ID: <87zjkngici.fsf@gmail.com> References: <87lhw7mlrg.fsf@gmail.com> <87r45z1j1l.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1395187703 19299 80.91.229.3 (19 Mar 2014 00:08:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 19 Mar 2014 00:08:23 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Mar 19 01:08:32 2014 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1WQ43b-0000E3-PH for geh-help-gnu-emacs@m.gmane.org; Wed, 19 Mar 2014 01:08:31 +0100 Original-Received: from localhost ([::1]:37995 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WQ43b-0005n3-9V for geh-help-gnu-emacs@m.gmane.org; Tue, 18 Mar 2014 20:08:31 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57969) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WQ43J-0005by-6f for help-gnu-emacs@gnu.org; Tue, 18 Mar 2014 20:08:20 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WQ43B-00059F-Nb for help-gnu-emacs@gnu.org; Tue, 18 Mar 2014 20:08:12 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:48048) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WQ43B-00057X-Gk for help-gnu-emacs@gnu.org; Tue, 18 Mar 2014 20:08:05 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1WQ439-0007yu-M9 for help-gnu-emacs@gnu.org; Wed, 19 Mar 2014 01:08:03 +0100 Original-Received: from g231224000.adsl.alicedsl.de ([92.231.224.0]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 19 Mar 2014 01:08:03 +0100 Original-Received: from tjolitz by g231224000.adsl.alicedsl.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 19 Mar 2014 01:08:03 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 36 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: g231224000.adsl.alicedsl.de User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:1kApR0EHq3/tyA83Im8AV3rhk0M= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:96597 Archived-At: Jambunathan K writes: > Thorsten Jolitz 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