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

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

Re: outline for coding


From: Thorsten Jolitz
Subject: Re: outline for coding
Date: Fri, 21 Mar 2014 10:58:32 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

Martin <kleinerdrache@gmx.at> writes:

> Hi there,
>
> Is there any outline for elisp, ruby and so on for emacs, where I can
> have a small window left to my coding window with the defined functions
> and vars?  Specially for elisp I would like to have that.

you could try outshine.el with navi-mode.el:

,-------------------------------------------
| http://www.youtube.com/watch?v=nqE6YxlY0rw
`-------------------------------------------

,-----------------------------------------------------------
| http://orgmode.org/worg/org-tutorials/org-outside-org.html
`-----------------------------------------------------------

its major mode agnostic and extensible.

Navi-mode already has a quite comprehensive number of keyword searches
for Emacs Lisp defined:

,-------------------------------------------
| [KEY] : [SEARCH]
| ================
|                         a : ALL
|                         f : FUN
|                         v : VAR
|                         x : OBJ
|                         b : DB
|                         F : defun
|                         V : defvar
|                         C : defconst
|                         G : defgroup
|                         U : defcustom
|                         A : defadvice
|                         W : defalias
|                         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
`-------------------------------------------


you can add you own searches via customizable vars. I defined sets of
keyword searches for Elist, PicoLisp, Org-mode and R. For Ruby or other
languages you could easily define your own sets using 

,---------------------------------------------
| M-x customize-variable RET navi-key-mappings
| M-x customize-variable RET navi-keywords
`---------------------------------------------

(or writing emacs lisp of course).

My usual set-up is the (outshine-structured) source-buffer and its
*Navi* buffer side-by-side, one showing the details, the other the
overview. Then I can combine headlines views (1 to 8) with
keywordsearches, e.g. in a *Navi* buffer associated with navi-mode.el:

,--
| 3
`--

gives

,----------------------------------------------------------------
|    1:;;; navi-mode.el --- major-mode for easy buffer-navigation
|    7:;;;; MetaData
|   21:;;;; Commentary
|  240:;;;; ChangeLog
|  247:;;; Requires
|  253:;;; Mode Definitions
|  284:;;; Variables
|  285:;;;; Consts
|  286:;;;; Vars
|  302:;;;; Hooks
|  307:;;;; Fonts
|  308:;;;; Customs
|  881:;;; Defuns
|  882:;;;; Functions
| 1353:;;;; Commands
| 1822:;;; Menus and Keys
| 1823:;;;; Menus
| 2034:;;;; Keys
| 2136:;;; Run Hooks and Provide
| 2143:;;; navi-mode.el ends here
`----------------------------------------------------------------

combining headline and keyword-searches looks like this:

,------
| C-3 a
`------

gives:

 ,---------------------------------------------------------------
 |   1:;;; navi-mode.el --- major-mode for easy buffer-navigation
 |   7:;;;; MetaData
 |  21:;;;; Commentary
 |  23:;;;;; About navi-mode
 |  47:;;;;; Usage
 | 214:;;;;; Installation
 | 234:;;;;; Emacs Version
 | 240:;;;; ChangeLog
 | 247:;;; Requires
 | 253:;;; Mode Definitions
 | 284:;;; Variables
 | 285:;;;; Consts
 | 286:;;;; Vars
 | 288:(defvar navi-mode-version 1.0
 | 291:(defvar navi "navi"
 | 296:(defvar navi-regexp-quoted-line-at-point ""
 | 299:(defvar navi-regexp-quoted-line-before-narrowing ""
 | 302:;;;; Hooks
 | 307:;;;; Fonts
 | 308:;;;; Customs
 | 309:;;;;; Custom Groups
 | 311:(defgroup navi-mode nil
 | 316:;;;;; Custom Vars
 | 318:(defcustom navi-key-mappings
 | 532:(defcustom navi-keywords
 | 881:;;; Defuns
 | 882:;;;; Functions
 | 888:(defun navi-underline-line-with (char)
 | 897:(defun navi-map-keyboard-to-key (language kbd-key)
 | 903:(defun navi-msg (key language)
 | 908:(defun navi-1 (regexp nlines bufs &optional buf-name)
 |  [...]
 `---------------------------------------------------------------

When moving to 

,-------------
| ;;;; Customs
`-------------

with 'n', typing 'r' to narrow to headline, then 'v' to show variable
definitions gives

,---------------------------------------------------------------------------
| 3 matches for "^[[:space:]]*(def[vcgf][^l][a-z]+ " in buffer: navi-mode.el
|       4:(defgroup navi-mode nil
|      11:(defcustom navi-key-mappings
|     225:(defcustom navi-keywords
`---------------------------------------------------------------------------

type '3' and 'w' to get back to the former view.

-- 
cheers,
Thorsten




reply via email to

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