From: Nicolas Richard <theonewiththeevillook@yahoo.fr>
To: Hans BKK <hansbkk@gmail.com>
Cc: help-gnu-emacs@gnu.org
Subject: Re: Generating a listing of all symbols (16K+) and labeling subsets
Date: Fri, 18 Apr 2014 22:47:04 +0200 [thread overview]
Message-ID: <87lhv25prr.fsf@geodiff-mac3.ulb.ac.be> (raw)
In-Reply-To: <dd2933fa-5fb5-4587-94e5-c4909b865760@googlegroups.com> (Hans BKK's message of "Fri, 18 Apr 2014 12:01:33 -0700 (PDT)")
Hans BKK <hansbkk@gmail.com> writes:
> On Fri, Apr 18, 2014 at 11:27 AM, Nicolas Richard
>> Some symbols are just symbols. every time the lisp reader reads
>> something, symbols are interned.
>>
>> Currently I have 76920 symbols in obarray.
>
> Aha. OK, so those "just symbols" can go to dev null.
I don't know what that should mean. Some symbols will never be reused,
some I don't know if they will be reused, some are still used (e.g.
because they serve as identifier), and many probably serve a purpose I
am not aware of.
If you like numbers, here are some :
(yf/count-symbols)
=> 77064
(yf/count-symbols #'fboundp)
=> 27896
(yf/count-symbols #'boundp)
=> 13713
;; the intersecton of the two previous sets:
(yf/count-symbols (lambda (x) (and (fboundp x) (boundp x))))
=> 792
(yf/count-symbols
(lambda (x)
(and
(symbol-plist x)
(not (fboundp x))
(not (boundp x)))))
=> 3136
(yf/count-symbols #'facep)
=> 673
(there's obviously some overlapping with bound and fbound symbols)
(yf/count-symbols #'keywordp)
=> 1510
So, are all the other symbols unneeded ? Dunno.
FWIW, here's the yf/count-symbols that I used:
(defun yf/count-symbols (&optional predicate)
(let ((count 0))
(mapatoms
(lambda (x)
(when (or (not predicate)
(funcall predicate x))
(incf count))))
count))
> Question remains - how to separate out and ID - in the absence of a
> predicate - any that actually may be of interest remaining in my
> current "other" - which I presume macros should be, and having got
> code for keymaps already above.
macros are fboundp.
(defmacro asymbollikenoother () t)
(fboundp 'asymbollikenoother)
=> t
>
>> If you want to have a report of useful symbols used in a package you can
>> do e.g. for smerge-mode:
>> M-x apropos RET ^smerge- RET
>
> Thanks for that, looks useful. But looks to only pick up those
> starting with the package string?
That was the idea, yes. Most packages are namespaced that way, those
that aren't probably should not exist in an ideal world ;)
> And I think apropos only displays a
> limited subset, e.g. only Customized variables? and/or only those with
> docstrings?
C-h f a p r o p o s RET
=>
Show all meaningful Lisp symbols whose names match PATTERN.
Symbols are shown if they are defined as functions, variables, or
faces, or if they have nonempty property lists.
> In this context I'm aiming more for an all-in-one standard "state
> report" I can diff between any arbitrary emacs-config-A and
> emacs-config-B, showing all changes, including to existing system
> variables.
I'm not sure if you can get meaningful data, doing that.
--
Nico.
next prev parent reply other threads:[~2014-04-18 20:47 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-18 5:15 Generating a listing of all symbols (16K+) and labeling subsets Hans BKK
2014-04-18 19:01 ` Hans BKK
2014-04-18 20:47 ` Nicolas Richard [this message]
2014-04-19 1:23 ` Hans BKK
2014-04-19 2:16 ` John Mastro
2014-04-19 2:25 ` Hans BKK
2014-04-19 2:50 ` Hans BKK
2014-04-19 4:24 ` Drew Adams
2014-04-19 20:15 ` Hans BKK
2014-04-23 4:11 ` Hans BKK
2014-04-23 7:40 ` Florian v. Savigny
[not found] ` <<874n1klchv.fsf@bertrandrussell.Speedport_W_723V_1_32_000>
2014-04-23 15:07 ` Drew Adams
2014-04-23 13:22 ` Hans BKK
2014-04-24 2:30 ` Hans BKK
-- strict thread matches above, loose matches on Subject: below --
2014-04-18 2:34 hansbkk
2014-04-18 2:09 hansbkk
2014-04-18 7:19 ` Thien-Thi Nguyen
2014-04-18 10:09 ` Thorsten Jolitz
[not found] ` <mailman.19825.1397815734.10748.help-gnu-emacs@gnu.org>
2014-04-18 15:00 ` Hans BKK
[not found] ` <mailman.19813.1397805348.10748.help-gnu-emacs@gnu.org>
2014-04-18 14:55 ` Hans BKK
2014-04-18 15:27 ` Nicolas Richard
2014-04-19 16:34 ` Robert Thorpe
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=87lhv25prr.fsf@geodiff-mac3.ulb.ac.be \
--to=theonewiththeevillook@yahoo.fr \
--cc=hansbkk@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.
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.