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: Mon, 08 Jan 2018 23:15:11 +0200 Message-ID: <83h8rw6oio.fsf@gnu.org> References: <20180107120859.GB22254@ACM> <20180107135629.GC22254@ACM> <83mv1p8vki.fsf@gnu.org> <83bmi58sao.fsf@gnu.org> <20180107194845.GE22254@ACM> <838td98mqe.fsf@gnu.org> <20180107211055.GF22254@ACM> <837est81bl.fsf@gnu.org> <20180108192415.GA5531@ACM> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1515446027 20966 195.159.176.226 (8 Jan 2018 21:13:47 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 8 Jan 2018 21:13:47 +0000 (UTC) Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jan 08 22:13:42 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 1eYejd-0004Xm-Gc for ged-emacs-devel@m.gmane.org; Mon, 08 Jan 2018 22:13:33 +0100 Original-Received: from localhost ([::1]:59426 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYelc-0006Bo-Q2 for ged-emacs-devel@m.gmane.org; Mon, 08 Jan 2018 16:15:36 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33548) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYelR-0006AO-Vt for emacs-devel@gnu.org; Mon, 08 Jan 2018 16:15:26 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eYelP-0005qC-5q for emacs-devel@gnu.org; Mon, 08 Jan 2018 16:15:25 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:43095) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYelO-0005pq-TE; Mon, 08 Jan 2018 16:15:23 -0500 Original-Received: from [176.228.60.248] (port=4110 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1eYelO-0003TA-7B; Mon, 08 Jan 2018 16:15:22 -0500 In-reply-to: <20180108192415.GA5531@ACM> (message from Alan Mackenzie on Mon, 8 Jan 2018 19:24:15 +0000) 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:221729 Archived-At: > Date: Mon, 8 Jan 2018 19:24:15 +0000 > Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org > From: Alan Mackenzie > > > > There is also no a-c-f call if the decompression exits with an error. > > > You mean, if the user quits? That throws to top level, so it would be > > wrong to invoke any after-change hooks, and unwind_decompress will > > call the hooks for the partially uncompressed data. Do we need more? > > I was thinking more of when the compressed text is corrupt and the > decompression routines report an error. What do other primitives do when there's an error? That was never reported in this discussion nor discussed, AFAICT. Up front, I see no reason to keep any promises when that happens. > The (1 22016) b-c-f is thus unbalanced when this happens. If this is really important (and I don't see why it would be), you can add a call to after-change-hooks before unbind_to of the error return. > I'm asking you to consider again having two pairs of hook calls in this > primitive (as, for example, base64-decode-region does). That way we need > only signal the b-c-f for the deletion after the decompression has > worked, and we know we are going to follow through with the deleteion. I > think an aborted decompression operation would also be easier to close > off with an a-c-f with this strategy. Is implementation convenience the only argument for Stefan's variant? If so, it doesn't convince me, as the difference is barely tangible.