emacs-devel
[Top][All Lists]
Advanced

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

Re: Bug #22983 (syntax-ppss returns wrong result) is still open. Could w


From: Stefan Monnier
Subject: Re: Bug #22983 (syntax-ppss returns wrong result) is still open. Could we fix it before the release, please.
Date: Mon, 13 Jun 2016 08:56:37 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

> perverse, here.  widen and narrow-to-region are enormously useful, and
> it is their simplicity, in large part, which makes them so useful.  You

The problem with them is simple: when a package encounters the buffer
narrowed it has no idea why it's been narrowed, and hence can't know
whether it can/should widen or not, nor how.

Info buffers are the typical example:

- Normally they're narrowed to a "node" and most packages should leave
  the narrowing untouched (including font-lock, and friends) because
  really for all intents and purposes the buffer is meant to only hold
  a node (it's just an implementation detail that in reality the buffer
  holds many nodes and we switch through them via narrowing).

- But of course, if the user comes around and wants to narrow to
  a subpart of a node, she's free to do so (as she should).

- Now, when font-lock comes around and the user has narrowed the buffer,
  font-lock should temporarily widen the buffer back to the whole node
  (but not the whole buffer).

- Similarly, after narrowing to a sub-part, the if the user wants to
  unnnarrow, she'll find that `widen` doesn't do what she expects.
  For this use-case, I could imagine fixing it by providing some kind of
  undo facility for narrowing.


-- Stefan




reply via email to

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