Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Text/overlay property to hide buffer contents from lisp?

9 views
Skip to first unread message

Tom

unread,
Apr 10, 2011, 4:49:05 AM4/10/11
to help-gn...@gnu.org
I know there are the `invisible' and `intangible' properties to
hide parts of the buffer from the user, but these hidden regions
are apparently not hidden from lisp commands like
query-replace-regexp.

Is there a property which can hide buffer contents like narrow
does, so that lisp commands can't access it either?

Stefan Monnier

unread,
Apr 10, 2011, 10:16:48 AM4/10/11
to

Other than delete-region, no.


Stefan

Tom

unread,
Apr 10, 2011, 11:05:22 AM4/10/11
to help-gn...@gnu.org
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:
>
> > Is there a property which can hide buffer contents like narrow
> > does, so that lisp commands can't access it either?
>
> Other than delete-region, no.
>

It's pity, because it could be useful.

I don't know if emacs maintainers plan to implement this feature someday,
but if they don't they should.

Andreas Röhler

unread,
Apr 10, 2011, 12:02:16 PM4/10/11
to help-gn...@gnu.org
Am 10.04.2011 10:49, schrieb Tom:
> I know there are the `invisible' and `intangible' properties to
> hide parts of the buffer from the user, but these hidden regions
> are apparently not hidden from lisp commands like
> query-replace-regexp.
>

If query-replacs goes into `intangible' sounds like a bug for me.

Whilst with `invisible' it seems reasonable. Emacs don't need eyes... :)

Cheers

Andreas

Perry Smith

unread,
Apr 10, 2011, 1:51:53 PM4/10/11
to help-gn...@gnu.org

On Apr 10, 2011, at 11:02 AM, Andreas Röhler wrote:

Am 10.04.2011 10:49, schrieb Tom:
I know there are the `invisible' and `intangible' properties to
hide parts of the buffer from the user, but these hidden regions
are apparently not hidden from lisp commands like
query-replace-regexp.


If query-replacs goes into `intangible' sounds like a bug for me.

Whilst with `invisible' it seems reasonable. Emacs don't need eyes... :)

`intangible' is a new concept to me.  For anyone else trying to follow along, intangible is documented in the Elisp manual (but not in Emacs' Concept Index which is the first place I looked).

One thing it mentions:

     When the variable `inhibit-point-motion-hooks' is non-`nil', the
     `intangible' property is ignored.

I assume that is not set but it might be.

From grep'ing the source and looking at what is in the Elisp manual and the comments in the code, I too would expect searches to not enter intangible areas.  The code also mentioned "sticky forward" and "sticky backward" -- not sure what that is (yet) but that might be affecting things too.

0 new messages