From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: master c59e878: Inhibit modification hooks when saving eieio-persistent's Date: Sat, 02 May 2020 18:09:25 -0400 Message-ID: References: <20200501192115.23847.67499@vcs0.savannah.gnu.org> <20200501192116.A55EE20B5B@vcs0.savannah.gnu.org> <87368jba7f.fsf@web.de> <87y2qb9tv3.fsf@web.de> <87tv0z9qt2.fsf@web.de> <87bln611vs.fsf@web.de> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="119515"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Michael Heerdegen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun May 03 00:10:06 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jV0Kj-000UxD-B6 for ged-emacs-devel@m.gmane-mx.org; Sun, 03 May 2020 00:10:05 +0200 Original-Received: from localhost ([::1]:60154 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jV0Ki-0000Wg-CK for ged-emacs-devel@m.gmane-mx.org; Sat, 02 May 2020 18:10:04 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41002) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jV0KE-0008LI-BW for emacs-devel@gnu.org; Sat, 02 May 2020 18:09:34 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jV0KC-0004SP-VY for emacs-devel@gnu.org; Sat, 02 May 2020 18:09:33 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:57582) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jV0KC-0004PU-GS for emacs-devel@gnu.org; Sat, 02 May 2020 18:09:32 -0400 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 710B4450868; Sat, 2 May 2020 18:09:31 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id EDB5C450864; Sat, 2 May 2020 18:09:25 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1588457365; bh=7DP0f3sveAU1lGLskTuZmG0OcqBYLBJt6T5PrOSXYls=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=X91fNN7eATSIP1P0a5uUjKJlf7FBIE1iPCEHT5ZHR8SWQmYztH3QF80ubmaymeClN WZsbU0dJv9GMP31W/DAuFdmAoHjEikHaTKp1q4yUB7sCTCWzZ5HxpWNwyjutqQGWCf O4cZJedMxt5HWBRURBdhjy7ByoFpPRoGGgJBw0L3/lJ9LmlEH0s5TdoPBcKbW3uNlg Nac2OEm07qCwelztz9G1bJMzM7Iesep7PNoXox7FY7DHjuP9UTEG2MMUc/+F0hJGs+ 6khFBJJQL8FshBqyNl9jQywb5kerL8mGZL16qM00PdQX6I25+c/lidrsNRj6WhSLL/ ttLASV8/jaT1g== Original-Received: from alfajor (unknown [216.154.3.202]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id A32AE120642; Sat, 2 May 2020 18:09:25 -0400 (EDT) In-Reply-To: <87bln611vs.fsf@web.de> (Michael Heerdegen's message of "Sat, 02 May 2020 23:08:07 +0200") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/02 16:40:06 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] X-Received-From: 132.204.25.50 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:248594 Archived-At: >> >> Not necessarily: it could be too slow (because of the cost to >> >> enter/leave `combine-change-calls`). >> > You mean when it's called in iteration? That makes sense. >> Another reason is that we don't know that `object-write` is only called >> in temp buffers. > I understand that answer for `inhibit-modification-hooks', but not for > `combine-change-calls' - what is bad about combining change calls when > writing to an arbitrary buffer? `combine-change-calls` is a bit less blunt, but it should still be used with care. For example, if you don't run the buffer modification hooks in the body, it means that the `syntax-ppss` and `syntax-propertize` won't be properly flushed, so if you use them interspersed with buffer modifications you may get incorrect results. As this is a common problem, `combine-change-calls` is careful to preserve the `syntax-ppss-flush-cache` on `before-change-functions`, but it shows the risk of what can happen with other change-functions. > BTW, while we are on the subject, I don't understand this sentence in > the doc of the related `combine-after-change-calls' (which I don't > suggest to use): > > | If BODY makes changes in the buffer, they are recorded and the > | functions on `after-change-functions' are called several times when > | BODY is finished. > > Why several times - I thought this is what the thing would avoid? And > how often is "several times"? I think it's as many times as there were modifications, tho I haven't looked at this code in too many years to remember for sure. I'm not sure why it was designed that way. Stefan