From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Nicolas Richard Newsgroups: gmane.emacs.help Subject: Re: Generating a listing of all symbols (16K+) and labeling subsets Date: Fri, 18 Apr 2014 22:47:04 +0200 Message-ID: <87lhv25prr.fsf@geodiff-mac3.ulb.ac.be> References: <38d1beb3-fffd-4718-ae10-be9646ac4a63@googlegroups.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1397854025 23160 80.91.229.3 (18 Apr 2014 20:47:05 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 18 Apr 2014 20:47:05 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Hans BKK Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Apr 18 22:46:58 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 1WbFgW-0001JC-Ak for geh-help-gnu-emacs@m.gmane.org; Fri, 18 Apr 2014 22:46:56 +0200 Original-Received: from localhost ([::1]:39836 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WbFgW-0005qu-0k for geh-help-gnu-emacs@m.gmane.org; Fri, 18 Apr 2014 16:46:56 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58605) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WbFgE-0005qd-S5 for help-gnu-emacs@gnu.org; Fri, 18 Apr 2014 16:46:46 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WbFg4-0006OP-O3 for help-gnu-emacs@gnu.org; Fri, 18 Apr 2014 16:46:38 -0400 Original-Received: from mxin.ulb.ac.be ([164.15.128.112]:59711) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WbFg4-0006OA-HV for help-gnu-emacs@gnu.org; Fri, 18 Apr 2014 16:46:28 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AiwGAKOOUVOkD4Xx/2dsb2JhbABarkaZYIEzdIIlAQEEAXkFCwshJQ8BBA08E4gsAQMJCKpemwABSg2GaxeHX4RqgUFYB4Q4BJcAiC+GPYVRgzM7gSw Original-Received: from mathsrv4.ulb.ac.be (HELO geodiff-mac3.ulb.ac.be) ([164.15.133.241]) by smtp.ulb.ac.be with ESMTP; 18 Apr 2014 22:46:27 +0200 In-Reply-To: (Hans BKK's message of "Fri, 18 Apr 2014 12:01:33 -0700 (PDT)") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.90 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 164.15.128.112 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:97207 Archived-At: Hans BKK 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.