From: Emanuel Berg <embe8573@student.uu.se>
To: help-gnu-emacs@gnu.org
Subject: Re: Return list of variables name symbols (or strings) in Emacs Lisp (programmatically)
Date: Tue, 22 Sep 2015 04:42:29 +0200 [thread overview]
Message-ID: <8761339nu2.fsf@debian.uxu> (raw)
In-Reply-To: CAKu-7WyosTkXYDDf2ko5Aj11V5KwsEsEDpS9E3TJ=QM8BvUk5Q@mail.gmail.com
Alexander Shukaev <haroogan@gmail.com> writes:
> When doing C-h v magit*section-map TAB, the
> corresponding completion list is shown. Is there an
> equivalent function which would accept such a wild
> card and return the same list? E.g.
>
> (var-symbols "magit*section-map")
(defun get-regexp-vars (regexp)
(let ((vars '()))
(mapatoms (lambda (a) (when (and (boundp a)
(string-match regexp (symbol-name a)) )
(push a vars) )))
vars))
;; some testing
(length (get-regexp-vars "gnus-.*")) ; 1109
(length (get-regexp-vars "w3m-.*")) ; 445
--
underground experts united
http://user.it.uu.se/~embe8573
next prev parent reply other threads:[~2015-09-22 2:42 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-22 1:12 Return list of variables name symbols (or strings) in Emacs Lisp (programmatically) Alexander Shukaev
2015-09-22 2:42 ` Emanuel Berg [this message]
2015-09-22 19:02 ` Stefan Monnier
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=8761339nu2.fsf@debian.uxu \
--to=embe8573@student.uu.se \
--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).