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: Leo Alekseyev
Subject: Re: Narrow/widen in folding.el
Date: Wed, 22 Dec 2010 04:26:28 -0800

On Wed, Dec 22, 2010 at 3:02 AM, Tassilo Horn <tassilo@member.fsf.org> wrote:
> 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.

Arbitrary folding is handy for headers/footers.  Also, I do a lot of
data analysis in addition to coding, and arbitrary folding can be very
useful there...

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


In fact, I found the resolution to my original question:
(setq folding-narrow-by-default nil)

I saw this variable before in folding.el's documentation, but I
misunderstood the terminology that was being used ("opening" folds vs
"entering" folds), and didn't realize that the variable controlled
narrowing just like I want it to.  When I went source-browsing
inspired by your message, I realized what it actually did :)

--Leo



reply via email to

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