unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Generating a listing of all symbols (16K+) and labeling subsets
@ 2014-04-18  5:15 Hans BKK
  2014-04-18 19:01 ` Hans BKK
                   ` (6 more replies)
  0 siblings, 7 replies; 22+ messages in thread
From: Hans BKK @ 2014-04-18  5:15 UTC (permalink / raw)
  To: help-gnu-emacs


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.


^ permalink raw reply	[flat|nested] 22+ messages in thread
* Generating a listing of all symbols (16K+) and labeling subsets
@ 2014-04-18  2:34 hansbkk
  0 siblings, 0 replies; 22+ messages in thread
From: hansbkk @ 2014-04-18  2:34 UTC (permalink / raw)
  To: help-gnu-emacs

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-user - 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.



^ permalink raw reply	[flat|nested] 22+ messages in thread
* Generating a listing of all symbols (16K+) and labeling subsets
@ 2014-04-18  2:09 hansbkk
  2014-04-18  7:19 ` Thien-Thi Nguyen
                   ` (2 more replies)
  0 siblings, 3 replies; 22+ messages in thread
From: hansbkk @ 2014-04-18  2:09 UTC (permalink / raw)
  To: help-gnu-emacs

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.



^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2014-04-24  2:30 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

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).