From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Lisp primitives and their calling of the change hooks Date: Sun, 07 Jan 2018 14:04:46 -0500 Message-ID: References: <20180104155111.GB6846@ACM> <20180104211154.GC6846@ACM> <20180106151839.GB23284@ACM> <20180106202403.GD23284@ACM> <20180107113628.GA22254@ACM> <83o9m599du.fsf@gnu.org> <20180107120859.GB22254@ACM> <20180107135629.GC22254@ACM> <83mv1p8vki.fsf@gnu.org> <83bmi58sao.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1515351799 5712 195.159.176.226 (7 Jan 2018 19:03:19 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 7 Jan 2018 19:03:19 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jan 07 20:03:15 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eYGDq-0000To-5n for ged-emacs-devel@m.gmane.org; Sun, 07 Jan 2018 20:03:06 +0100 Original-Received: from localhost ([::1]:35133 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYGFn-0002oV-VQ for ged-emacs-devel@m.gmane.org; Sun, 07 Jan 2018 14:05:08 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36427) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYGFg-0002nw-VG for emacs-devel@gnu.org; Sun, 07 Jan 2018 14:05:01 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eYGFc-0003qp-14 for emacs-devel@gnu.org; Sun, 07 Jan 2018 14:05:00 -0500 Original-Received: from [195.159.176.226] (port=47213 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eYGFb-0003qb-QA for emacs-devel@gnu.org; Sun, 07 Jan 2018 14:04:55 -0500 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1eYGDZ-0007uN-G5 for emacs-devel@gnu.org; Sun, 07 Jan 2018 20:02:49 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 29 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:JISmQKmphPuOx6P7b3VzhIqXle4= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 195.159.176.226 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:221688 Archived-At: > 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. Stefan