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

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

Re: Narrow/widen in folding.el


From: Tassilo Horn
Subject: Re: Narrow/widen in folding.el
Date: Wed, 22 Dec 2010 12:02:44 +0100
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/24.0.50 (gnu/linux)

Leo Alekseyev <dnquark@gmail.com> writes:

Hi Leo,

> The problem with this approach, though, is the overly rigid structure:
> the end of one fold is necessarily the beginning of another fold.  For
> some use cases, it works rather well.  Sometimes, however, I simply
> want a piece of text folded without it being logically tied to any
> hierarchy.

Hm, ok.  I never had the need for arbitrary folding, but only to
coarse-grained hierarchical folding (outline-minor-mode) and syntactical
folding wrt. some programming language (hs-minor-mode and friends).

But concerning folding.el and isearch: folding.el should put a special
text properties on the overlay.

,----[ (info "(elisp)Invisible Text") ]
|    Incremental search can make invisible overlays visible temporarily
| and/or permanently when a match includes invisible text.  To enable
| this, the overlay should have a non-`nil' `isearch-open-invisible'
| property.  The property value should be a function to be called with
| the overlay as an argument.  This function should make the overlay
| visible permanently; it is used when the match overlaps the overlay on
| exit from the search.
| 
|    During the search, such overlays are made temporarily visible by
| temporarily modifying their invisible and intangible properties.  If you
| want this to be done differently for a certain overlay, give it an
| `isearch-open-invisible-temporary' property which is a function.  The
| function is called with two arguments: the first is the overlay, and
| the second is `nil' to make the overlay visible, or `t' to make it
| invisible again.
`----

That should be pretty trivial to hack into it.

Bye,
Tassilo



reply via email to

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