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: Stefan Monnier
Subject: Re: Unbalanced change hooks (part 2) [Documentation fix still remaining]
Date: Tue, 30 Aug 2016 16:34:46 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

> There is software that cannot be written in any reasonable fashion
> without the technique under discussion.  I suspect, even if I don't know
> for sure, that CC Mode comes into that category.

It's trivial to demonstrate that it doesn't:
- consider any change between START and END to the buffer.
- you can always decompose it into:
  (a) delete everything from START to point-max.
  (b) insert at START (now point-max) the rest of the text.
- clearly the above deletions and insertions *could* happen, so CC-mode
  has to handle them and since all changes could be decomposed this way,
  CC-mode does not *need* to handle any other case.
- to handle (a) you don't need to know anything from b-c-f.
- to handle (b) you don't need to know anything from b-c-f.

CQFD

> No, I quite clearly and accurately described the Emacs that does exist:
> The technique works almost always, but you have to detect and handle
> exceptions carefully, something that can be easily done.

Daniel's description gives you the added info necessary to know how to
detect that situation and what you might want to do about it.

FWIW, I like Daniel's wording.  It is about as precise as we can make it
without imposing undue burden (IOW I think Emacs's implementation can
reasonably (and should) obey that description) and I think it gives the
right intuition.


        Stefan



reply via email to

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