From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: hansbkk@gmail.com Newsgroups: gmane.emacs.help Subject: Generating a listing of all symbols (16K+) and labeling subsets Date: Thu, 17 Apr 2014 22:09:35 -0400 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1397800753 6657 80.91.229.3 (18 Apr 2014 05:59:13 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 18 Apr 2014 05:59:13 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Apr 18 07:59:06 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 1Wb1pI-0003Tx-Kl for geh-help-gnu-emacs@m.gmane.org; Fri, 18 Apr 2014 07:59:04 +0200 Original-Received: from localhost ([::1]:36423 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wb1pI-00009l-AR for geh-help-gnu-emacs@m.gmane.org; Fri, 18 Apr 2014 01:59:04 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35494) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WayFF-0004XO-K4 for help-gnu-emacs@gnu.org; Thu, 17 Apr 2014 22:09:38 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WayFE-0000I5-HZ for help-gnu-emacs@gnu.org; Thu, 17 Apr 2014 22:09:37 -0400 Original-Received: from mail-ob0-x22d.google.com ([2607:f8b0:4003:c01::22d]:36352) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WayFE-0000I1-BT for help-gnu-emacs@gnu.org; Thu, 17 Apr 2014 22:09:36 -0400 Original-Received: by mail-ob0-f173.google.com with SMTP id wn1so1290533obc.18 for ; Thu, 17 Apr 2014 19:09:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=LwA24XycNKf+tUC7AJqHeXbSLIndNcDjeCkD8IdI2F8=; b=F89b4E6/DUPXRPh2ub6E7y2NvAwLbdzXC9u8fTw9JyiuJjj0m/xVY2zMBHQyoUY7XY RmewkiOvDQUc/izTIZUDVNS05S/vcngM6FF/N+zNgcA/tHpGiO6guT5Ai/2flLJrUN0C n2lEF2hwOWszr3BK/tL06kc1ttBd3SY/wm2TNpXiMTIP4+LFHcDQPH5/rEe9qoG6RsHI SNtpehcSb2+49NmyKMpwQJhoPzxUVXGGNmU82Nj6dY0R9m2Abm8OxJ4aiVIiOXQXqZwm z8btf1fpHNI1EOKpD8Irt2jsdAOXn7rn+fgGL521oG+VdW1ORNFcqCcGxl2LnGM6wiVf c4Uw== X-Received: by 10.182.205.135 with SMTP id lg7mr10202940obc.32.1397786975319; Thu, 17 Apr 2014 19:09:35 -0700 (PDT) Original-Received: by 10.182.214.67 with HTTP; Thu, 17 Apr 2014 19:09:35 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:4003:c01::22d X-Mailman-Approved-At: Fri, 18 Apr 2014 01:58:51 -0400 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:97180 Archived-At: Total noob here - and non-programmer to boot, as will become immediately apparent from the code below - so please be gentle. Before I start getting to know emacs as an end-users - which I'm highly motivated to do, despite the amazingly steep learning curve to do the most basic things - I plan to of course highly customize my emacs environment to suit my needs, before starting the muscle-memory training required to become efficient. I want to experiment with "out of the box" newbie-friendly mods like cua-mode, Starter Kit, Prelude, Evil maybe even Ergoemacs, but to start with not so much in a hands-on manner, but systematically investigating the packages they install, keybinding mods etc. To that end I'd like to generate standardized-format text "symbols reports" on the relevant values of all functions, variables, key bindings etc, so that I can do A-B comparison via diff between stock vanilla emacs vs after installing these bundles, or in fact any packages in the future. I wrote the following function "list-hh-symbols" toward this end, based on the list-options function from the now-obsolete options.el. Please anyone noobier than me - don't use this for anything other than learning by reading, I suspect it's of laughable quality. Obviously any feedback at all would be most welcome, but the ideal would be for someone to point me to something that already does this out of the box. Or write it for me of course 8-) Failing that, I'd specifically like to ask about the logic of the categorizing breakdown and for better taxonomy terms. And most of all, for code in line with the below scheme that allows for the "other" categories to be more precisely broken down, specifically identifying those symbols which are constant-value variables, keymaps and macros. And any others I might have missed among the 16,000+ that are out there. ------------------------------------------ (defun list-hh-symbols () "Display a list of Emacs symbols - names only" (interactive) (message "Looking up all symbols...") (with-output-to-temp-buffer "*List Symbols*" (let (vars) (mapatoms (function (lambda (sym) (setq vars (cons sym vars))))) (setq vars (sort vars 'string-lessp)) (while vars (let ((sym (car vars))) (cond ((fboundp sym) ; ALL functions (cond ((commandp sym) (cond ((subrp (symbol-function sym)) (princ "=============================\n") (princ "command - built-in primitive:\t\t") (prin1 sym) (princ "\n\n")) ((byte-code-function-p (symbol-function sym)) (princ "====================\n") (princ "command - byte-code:\t\t\t") (prin1 sym) (princ "\n\n")) ((functionp sym) (princ "================\n") (princ "command - elisp:\t\t\t") (prin1 sym) (princ "\n\n")) (t (princ "===============\n") (princ "keymap command:\t\t\t\t") (prin1 sym) (princ "\n\n")) ) ) (t ; (non-command) functions (cond ((subrp (symbol-function sym)) (princ "==============================\n") (princ "function - built-in primitive:\t\t") (prin1 sym) (princ "\n\n")) ((byte-code-function-p (symbol-function sym)) (princ "=====================\n") (princ "function - byte-code:\t\t\t") (prin1 sym) (princ "\n\n")) ((functionp sym) (princ "=================\n") (princ "function - elisp:\t\t\t") (prin1 sym) (princ "\n\n")) (t (princ "================================\n") (princ "other ~function (keymap, macro):\t") (prin1 sym) (princ "\n\n")) ) ) ) ) ((boundp sym) ; ALL variables (cond ((custom-variable-p sym) (princ "=====================\n") (princ "user (custom) option:\t\t\t") (prin1 sym) (princ "\n\n")) (t (princ "=========================\n") (princ "non-user (setq) variable:\t\t") (prin1 sym) (princ "\n\n")) ) ) ((facep sym) (princ "=====\n") (princ "\n") (princ "face:\t\t\t\t\t") (prin1 sym) (princ "\n\n")) (t (princ "====================\n") (princ "other (misc) symbol:\t\t\t") (prin1 sym) (princ "\n\n")) ) (setq vars (cdr vars)))) (message "Looking up all symbols...done") (with-current-buffer "*List Symbols*" (setq buffer-read-only t))))) ;;;;;;;;;;;;;;;;;;;;;;; (provide 'hh-list-symbols) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; hh-list-symbols.el ends here ------------------------------------------------------- and as a complete side note, which is better for navigating this stuff, Helm or Icicles? or has anyone got both of them working together? I assume from my reading that they'd have so much overlap as to most likely interfere with each other. . . Thanks in advance.