[Top][All Lists]

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

Re: hiding lines

From: Stefan Monnier
Subject: Re: hiding lines
Date: Fri, 03 Apr 2009 09:22:26 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.92 (gnu/linux)

> I don't know exactly what `invisible' and `intangible' text/overlay
> properties mean.

- `invisible' means "not displayed".
- `intangible' means "can't put point in it (if you try, point will be
  put at the beginning or the end of the intangible text).
Not being able to put point in a piece of text has far reaching consequences,
e.g. (/= (1+ (point)) (save-excursion (forward-char 1) (point)))
so it tends to introduce bugs in all kinds of places.

The read-eval loop has a built-in post-command-hook (controlled by
disable-point-adjustment and global-disable-point-adjustment) that moves
point outside of `invisible' text (as well as outside of
char-compositions, and outside of images), so `invisible' text is
treated as somewhat intangible, except this kind of intangibility is
only applied after a command is done running, which introduces much
fewer problems than the `intangible' property which is applied at a much
lower level.

> I don't know when to use each of them, when to use both of
> them together.

If you don't know, then you probably don't want to use `intangible'.

> For example, the documentation implies that if I isearch for something
> inside the invisible bit, the cursor should end up on the other side of
> the invisibility.  Instead, it does the Right Thing.

Can you point me to the place that implies this behavior?

> It seems though, at least in C Mode, that when a user makes part of his
> buffer invisible, the invisible bits are still seen by the parsing
> routines in CC Mode.  I don't know why this is so.

Because `invisible' isn't like narrowing: it only prevents the display,
but doesn't remove the text.

> The documentation, (Elisp manual pages "Invisible Text" and "special
> properties") is of no help here.  It says, in effect, "The invisible
> property sort of does this".

> Are there any complete descriptions of these properties anywhere?  Are
> there any guidelines for there use anywhere?

Looks like the doc needs some improvement.  Thanks for pointing it out.


reply via email to

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