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

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

Re: How can use outline mode in lisp code?


From: Giannandrea Castaldi
Subject: Re: How can use outline mode in lisp code?
Date: Thu, 24 Jun 2004 13:33:09 +0200
User-agent: Mozilla Thunderbird 0.6 (X11/20040605)

Thien-Thi Nguyen wrote:
Giannandrea Castaldi <g.castal@tiscali.it> writes:


I'm using emacs+slime to write common lisp programs (cmucl).
I'd like to use the outline mode while I'm editing lisp
programs.  It should make invisble/visble the symbolic
expressions of my files.  How can I do it?


i recommend hideshow minor mode because it can handle hiding the
binding block in a let form, whereas outline cannot.  it is also
"block" oriented rather than simply indentation detecting, and
thus handles nested forms better (which is nice for sexp-based
languages (like lisp :-)).  for example, given the form (J and K
signify cursor positions on the line below them):

  J    KL
  (let ((a (list 10
                 20
                 30))
        (b 2)
        (c 3))
    (list a b c))

hs-hide-block at J shows:

  (let ((a (list 10...

hs-hide-block at K shows:

  (let ((a (list 10...
    (list a b c))

hs-hide-block at L shows:

  (let ((a (list 10...
        (b 2)
        (c 3))
    (list a b c))

there are also other facilities i won't spew on about here (see
Commentary in hideshow.el for more info).

the bad news is that currently top-level comments and "internal"
comments are handled differently.  someone needs to generalize
hideshow algorithms so that the former can be implemented as a
special case of the properly-recursive latter.  a bug report to
this effect has been sitting for six months, and will probably sit
for another few, until autumn, at least.  some programmers are at
times extremely slow. :-/

thi

Very useful, thanks a lot.


Giannandrea


reply via email to

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