[Top][All Lists]

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

Re: Lisp primitives and their calling of the change hooks

From: Stefan Monnier
Subject: Re: Lisp primitives and their calling of the change hooks
Date: Sun, 07 Jan 2018 14:04:46 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

> I think only the former makes sense, because this function is actually
> a replacement function.

When we perform a "replacement" from Elisp, we do it with insert +
delete-region so there are two calls to each of b-c-f and a-c-f.
So two calls also makes sense.

We could even have one call to at the beginning b-c-f followed by two
calls to a-c-f (one right after inserting the new text and one after
deleting the old text).  That would also be acceptable.

And in reality, this choice doesn't really matter (as evidenced by the
fact that noone noticed those calls were missing until now).

We should just pick the one that's easier to implement (and in case we
still a preference because the implementation is just as easy, the
"single calls to b-c-f/a-c-f" is of course the better option).

> Also note that zlib-decompress-region works only in unibyte buffers,
> so in practice almost every caller will immediately call
> decode-coding-region or its ilk, which calls the hooks again.  But
> unlike zlib-decompress-region, the decoding stuff will be able to0
> report character positions, not byte positions.

In practice, I'd also expect both b-c-f and a-c-f to be nil (or
equivalent) when we call zlib-decompress-region.


reply via email to

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