help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Best way to get hang of an elisp file?


From: Thorsten Jolitz
Subject: Re: Best way to get hang of an elisp file?
Date: Fri, 18 Oct 2013 19:22:14 +0200
User-agent: Gnus/5.130002 (Ma Gnus v0.2) Emacs/24.3 (gnu/linux)

Marcin Borkowski <address@hidden> writes:

 Hi,

> I'm curious whether there exists something like "outline mode", hiding
> everything but the signature of a function and its docstring etc. (Or
> better yet, generating a file with everything but signatures and
> docstrings etc. deleted.)

Sounds like a perfect use case for
[[https://github.com/tj64/navi][navi-mode.el]]. Instead of describing it
(again) I'll just give some examples of possible views on tex.el:

* Outline structure (level 1-8)

type 1 in *Navi* buffer (-> level 1)

,-----------------------------------------------------------------------
| 45 matches for "^;;; " in buffer: tex.el
|       1:;;; tex.el --- Support for TeX documents.
|      27:;;; Commentary:
|      33:;;; Code:
|      61:;;; Site Customization
|     541:;;; Portability.
|     572:;;; Documentation for Info-goto-emacs-command-node and similar
|     597:;;; Special support for XEmacs
|     688:;;; Special support for GNU Emacs
|     762:;;; Buffer
|    [...]
|    5053:;;; Dollars
|    5144:;;; Simple Commands
|    5379:;;; Documentation
|    5508:;;; Ispell Support
|    5573:;;; Special provisions for other modes and libraries
|    5598:;;; tex.el ends here
`-----------------------------------------------------------------------

type 3 (level 1-3)

[... same thing as above, tex.el seems to have only level 1 headlines]

* Keyword Searches

type h for help:

,-------------------------------------------
| [KEY] : [SEARCH]
| ================
|                         a : ALL
|                         f : FUN
|                         v : VAR
|                         x : OBJ
|                         b : DB
|                         F : defun
|                         V : defvar
|                         C : defconst
|                         G : defgroup
|                         U : defcustom
|                         A : defadvice
|                         M : defmarcro
|                         D : defface
|                         S : defstruct
|                         B : defsubst
|                         L : defclass
|                         I : define
|                         J : declare
|                         K : global-set-key
|                         T : add-to-list
|                         Q : setq
|                         H : add-hook
|                         O : hook
|                         X : lambda
|                         R : require
`-------------------------------------------

(type q to quit help buffer)

type f

,---------------------------------------------------------------------------
| 186 matches for "^[[:space:]]*(def[maus][^et][a-z]*\*? " in buffer: tex.el
| 547:      (defun TeX-maybe-remove-help (menu)
| 562:    (defun TeX-maybe-remove-help (menu)
| 566:  (defmacro TeX-menu-with-help (menu)
| 601:  (defun TeX-read-string
| 608:  (defun TeX-mark-active ()
| 614:  (defun TeX-active-mark ()
| 622:    (defalias 'line-beginning-position 'point-at-bol))
| 624:    (defalias 'line-end-position 'point-at-eol))
| 626:  (defun TeX-overlay-prioritize (start end)
| 665:    (defalias 'TeX-completing-read-multiple 'completing-read-multiple)
| 666:  (defun TeX-completing-read-multiple
| 675:    (defalias 'TeX-line-number-at-pos 'line-number-at-pos)
| [...]
`--------------------------------------------------------------------------

type v

,-------------------------------------------------------------------
| 186 matches for "^[[:space:]]*(def[vcgf][^l][a-z]+ " in buffer: tex.el
|      43:(defgroup TeX-file nil
|      47:(defgroup TeX-command nil
|      51:(defgroup LaTeX nil
|      57:(defgroup TeX-misc nil
|      81:(defcustom TeX-print-command "%(o?)dvips -P%p %r %s"
|      91:(defcustom TeX-command "tex"
|      96:(defcustom TeX-Omega-command "omega"
|     101:(defcustom LaTeX-command "latex"
|     106:(defcustom LaTeX-Omega-command "lambda"
|     111:(defcustom ConTeXt-engine nil
|     118:(defcustom ConTeXt-Omega-engine TeX-Omega-command
|     127:(defcustom TeX-queue-command "lpq -P%p"
`-------------------------------------------------------------------

type R

,------------------------------------------------------------
| 5 matches for "^[[:space:]]*([a-z-]*require " in buffer: tex.el
|      38:(require 'custom)
|      39:(require 'tex-site)
|      41:  (require 'cl))
|     543:(require 'easymenu)
|    5348:  (require 'reporter)
`------------------------------------------------------------

* Combine Headline and Keyword searches

type C-1 C

   ,-------------------------------------------------------------------
   | [...]
   | 3021:;;; Hilighting
   | 3032:;;; Parsing
   | 3049:(defconst TeX-auto-parser-temporary 1)
   | 3050:(defconst TeX-auto-parser-add 2)
   | 3051:(defconst TeX-auto-parser-local 3)
   | 3052:(defconst TeX-auto-parser-change 4)
   | 3508:;;; Utilities
   | 3862:;;; Syntax Table
   | 3891:;;; Menu Support
   | 3961:(defconst TeX-command-menu-name "Command"
   | 3964:;;; Keymap
   | 4218:;;; Menus for plain TeX mode
   | 4303:;;; AmSTeX
   | 4348:;;; Verbatim constructs
   | 4363:;;; Comments
   | 4599:;;; Indentation
   | 4637:;;; Navigation
   | 4916:;;; Fonts
   | 5053:;;; Dollars
   | 5066:(defconst TeX-dollar-string (char-to-string TeX-dollar-sign))
   | 5067:(defconst TeX-dollar-regexp
   | 5144:;;; Simple Commands
   | [...]
   `-------------------------------------------------------------------

* Narrow to Headline

type 1

with point (in *Navi* buffer) on

,-----------------
| 3032:;;; Parsing
`-----------------

type r

type a

,-------------------------------------------------------------------------------
| 40 matches for "^[[:space:]]*(def[a-z]+ " in buffer: tex.el
|       3:(defgroup TeX-parse nil
|       7:(defvar TeX-auto-parser '((styles TeX-auto-file TeX-run-style-hooks)))
|      18:(defconst TeX-auto-parser-temporary 1)
|      19:(defconst TeX-auto-parser-add 2)
|      20:(defconst TeX-auto-parser-local 3)
|      21:(defconst TeX-auto-parser-change 4)
|      23:(defun TeX-auto-add-type (name prefix &optional plural)
|      55:(defun TeX-auto-add-information (name entries)
|      67:(defun TeX-auto-list-information (name)
|     100:(defvar TeX-auto-apply-hook nil
|     103:(defun TeX-auto-apply ()
|     109:(defun TeX-auto-apply-entry (entry)
|     [...]
|     320:(defvar TeX-auto-prepare-hook nil
|     323:(defvar TeX-auto-cleanup-hook nil
|     326:(defcustom TeX-auto-parse-length 999999
|     332:(defcustom TeX-auto-x-parse-length 0
|     340:(defcustom TeX-auto-x-regexp-list 'LaTeX-auto-label-regexp-list
|     357:(defun TeX-regexp-group-count (regexp)
|     367:(defun TeX-auto-parse-region (regexp-list beg end)
|     422:(defun TeX-auto-parse ()
|     456:(defun TeX-auto-clear-entry (entry)
|     460:(defvar LaTeX-auto-end-symbol nil)
|     462:(defun TeX-auto-symbol-check (match)
`-------------------------------------------------------------------------------

type w to widen again.

* Other Stuff

use n, p, space and <= for navigation, d to show point in associated source-code
buffer, s and o to switch to the source-code buffer, M-s M-s to switch back to
*Navi* buffer, type E to make the *Navi* buffer editable (excellent for
keyboard macros) and C-c C-c to make it read-only again. You can even search,
mark, copy, kill, paste the original buffer from the *Navi* buffer and of
course cycle visibility (locally and globally).

--
cheers,
Thorsten




reply via email to

[Prev in Thread] Current Thread [Next in Thread]