emacs-devel
[Top][All Lists]
Advanced

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

Re: Unbalanced change hooks (part 2) [Documentation fix still remaining]


From: Daniel Colascione
Subject: Re: Unbalanced change hooks (part 2) [Documentation fix still remaining]
Date: Mon, 29 Aug 2016 19:26:23 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0



On 08/29/2016 05:25 PM, Stefan Monnier wrote:
So, while I agreed that #1 should probably be fixed, and even
suggested how to do that in the least risky way, actually doing that
is not a priority, IMO, not until we have a very grave problem caused
by it.

FWIW, I think it's important to fix the insert-file-contents case.
It breaks syntax-ppss, for example, although for various reasons of how
syntax-ppss is implemented and used, this happens to rarely show up.
[ So, yes, it's not top priority, but it should still be fixed.  ]

Agreed.


#1 breaks the entire b-c-f model --- "hey, I'm about to modify the
buffer, so throw away caches" ---- and can lead to anything with a
cache flush in b-c-f (like syntax-ppss) not properly discarding
out-of-date buffer information.
That single case of #1 is revert-buffer, which conceptually throws
away the entire buffer and replaces it with what's on disk.  That it
actually keeps portions of the buffer is an optimization, but the
concept still stands.  So I don't see how it breaks the entire model,
at least not in practice.

The optimization is beside the point: not calling b-c-f in some corner
case breaks the entire model because a user such as syntax-ppss relies
on b-c-f to know when to flush its cache, so if you don't call it when
the buffer is modified, the cache ends up stale.


Yes. That's what I meant. If you don't do this, b-c-f becomes practically useless.



reply via email to

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