From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Lisp primitives and their calling of the change hooks Date: Sun, 07 Jan 2018 19:58:23 +0200 Message-ID: <83bmi58sao.fsf@gnu.org> 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> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1515347850 23282 195.159.176.226 (7 Jan 2018 17:57:30 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 7 Jan 2018 17:57:30 +0000 (UTC) Cc: acm@muc.de, emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jan 07 18:57:26 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 1eYFCE-0005Wb-S6 for ged-emacs-devel@m.gmane.org; Sun, 07 Jan 2018 18:57:22 +0100 Original-Received: from localhost ([::1]:60944 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYFEE-0003If-Bv for ged-emacs-devel@m.gmane.org; Sun, 07 Jan 2018 12:59:26 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37765) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYFDU-0003I3-KM for emacs-devel@gnu.org; Sun, 07 Jan 2018 12:58:41 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eYFDR-0004cd-IL for emacs-devel@gnu.org; Sun, 07 Jan 2018 12:58:40 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:45053) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYFDR-0004cM-EE; Sun, 07 Jan 2018 12:58:37 -0500 Original-Received: from [176.228.60.248] (port=1722 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1eYFDQ-0003uk-U5; Sun, 07 Jan 2018 12:58:37 -0500 In-reply-to: (message from Stefan Monnier on Sun, 07 Jan 2018 12:50:26 -0500) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e 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:221682 Archived-At: > From: Stefan Monnier > Cc: Alan Mackenzie , emacs-devel@gnu.org > Date: Sun, 07 Jan 2018 12:50:26 -0500 > > >> Should I try to fix zlib-decompress-region? > > How do you want to fix it? That function inserts the decompressed > > stuff, then deletes the original compressed stuff. What do you want > > that to produce in terms of the change hooks? > > Either one b-c-f at the beginning and and one a-c-f at the end, > or one b-c-f/a-c-f pair for the insertion followed by another for > the deletion. > > It doesn't matter much which. I think only the former makes sense, because this function is actually a replacement function. 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.