From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tassilo Horn Newsgroups: gmane.emacs.help Subject: Re: elisp - introspection - find all functions matching a certain string Date: Thu, 06 Sep 2007 09:28:06 +0200 Organization: University Koblenz-Landau Campus Koblenz Message-ID: <87tzq8l0c9.fsf@baldur.tsdh.de> References: <1189022643.103116.223980@57g2000hsv.googlegroups.com> <1189024939.191385.47270@r29g2000hsg.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1189068147 28566 80.91.229.12 (6 Sep 2007 08:42:27 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 6 Sep 2007 08:42:27 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Sep 06 10:42:27 2007 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1ITCwU-000151-5G for geh-help-gnu-emacs@m.gmane.org; Thu, 06 Sep 2007 10:42:26 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ITCwS-0005WQ-Gh for geh-help-gnu-emacs@m.gmane.org; Thu, 06 Sep 2007 04:42:24 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!news.belwue.de!news.uni-kl.de!cache.uni-koblenz.de!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 42 Original-NNTP-Posting-Host: dslb-084-063-057-036.pools.arcor-ip.net Original-X-Trace: cache.uni-koblenz.de 1189063687 3199 84.63.57.36 (6 Sep 2007 07:28:07 GMT) Original-X-Complaints-To: news@cache.uni-koblenz.de Original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kuURYQsplW9Ca9ZQk0= Original-Xref: shelby.stanford.edu gnu.emacs.help:151745 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:47269 Archived-At: "metaperl.com" writes: Hi, >> How can I get a list of all the Emacs Lisp functions currently in >> memory which start with the string "asciidoc" > > It occurred to me to hijack the source of apropos.el, but the function > which does all the work, apropos-internal, does not appear in the > source anywhere. ,----[ C-h f apropos-internal RET ] | apropos-internal is a built-in function in `C source code'. | (apropos-internal REGEXP &optional PREDICATE) | | Show all symbols whose names contain match for REGEXP. | If optional 2nd arg PREDICATE is non-nil, (funcall PREDICATE SYMBOL) is done | for each symbol and a symbol is mentioned only if that returns non-nil. | Return list of symbols found. `---- As you can see, it's defined in the C source code. Regarding your original problem, you can also use this function: --8<---------------cut here---------------start------------->8--- (defun matching-functions (regexp) (let (commands) (mapatoms (lambda (a) (if (and (functionp a) (string-match regexp (symbol-name a))) (push (symbol-name a) commands)))) (sort commands 'string-lessp))) --8<---------------cut here---------------end--------------->8--- Bye, Tassilo -- If programmers deserve to be rewarded for creating innovative programs, by the same token they deserve to be punished if they restrict the use of these programs. (Richard M. Stallman)