[Top][All Lists]

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

RE: forward-comment and syntax-ppss

From: Drew Adams
Subject: RE: forward-comment and syntax-ppss
Date: Fri, 16 Dec 2016 08:22:49 -0800 (PST)

> > > From where I'm standing, the things you use it for (hide
> > > buffer contents)
> >
> > No.  Narrowing is not used to "hide buffer contents".  That's not
> > the point of narrowing, even if it is one effect.  It's used to
> > make some buffer contents inaccessible to certain (many, typical,
> > ordinary) operations.  It is not just you who does not see parts
> > of the buffer; it is also Emacs features that do not perceive them.
> Narrowing is used for both of these effects.

Both what effects?  The only effect of narrowing is to, in
effect, change what `point-min' and `point-max' amount to.
It just restricts the effective buffer limits; nothing more.

When I said it is not used to "hide buffer contents" I meant
that it is not used ONLY to hide buffer contents from a user's
eyes.  The rest of that paragraph makes that clear.  It was a
response to the claim that narrowing is ONLY for hiding buffer

Certainly, hiding text from a user's eyes is one effect, and so
one use, of narrowing.  But it is not the point of narrowing;
its full effect.  There are other ways to hide text from a
user's eyes, but they do not substitute for what narrowing does.

> One clear example of the former is Info mode, where the buffer
> is always narrowed to the current node.

Nope.  That's an example of just what I said: Narrowing does
more than just hide text from a user's eyes - and the use of
narrowing by Info relies on that "more".

A displayed node is a narrowed portion of the buffer, and
much about "nodeness" and operations on a node are related
to that narrowing.  Try widening and then just making the
text outside the node invisible, and see how far you get
with Info.

Could Info have been implemented differently, so as not to
use narrowing?  Sure.  Could it have used text invisibility
to get the job done?  Maybe, but only if it were taught to
not only hide invisible text but to also ignore it for
other purposes.

Text property `invisible' does not do what narrowing does.
You can add it to text, to hide it, but then you need to
teach code to ignore it for certain operations.  Which
operations?  To replace narrowing, all operations that
work off of the buffer limits.

reply via email to

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