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: Unbalanced change hooks (part 2) Date: Mon, 01 Aug 2016 11:28:12 -0400 Message-ID: References: <20160731121642.GB2205@acm.fritz.box> <83a8gxq288.fsf@gnu.org> <20160731172804.GD2205@acm.fritz.box> <83vazlobh1.fsf@gnu.org> <83r3a8oct5.fsf@gnu.org> <83eg68o88b.fsf@gnu.org> NNTP-Posting-Host: blaine Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1470067549 8329 195.159.176.226 (1 Aug 2016 16:05:49 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 1 Aug 2016 16:05:49 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Aug 01 18:05:45 2016 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 1bUFcS-0000VB-V8 for ged-emacs-devel@m.gmane.org; Mon, 01 Aug 2016 17:59:09 +0200 Original-Received: from localhost ([::1]:50955 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bUF7P-0006Od-Ac for ged-emacs-devel@m.gmane.org; Mon, 01 Aug 2016 11:27:03 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43967) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bUF6q-0006OI-LG for emacs-devel@gnu.org; Mon, 01 Aug 2016 11:26:29 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bUF6m-0006KF-V8 for emacs-devel@gnu.org; Mon, 01 Aug 2016 11:26:27 -0400 Original-Received: from pruche.dit.umontreal.ca ([132.204.246.22]:34095) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bUF6m-0006K7-QM; Mon, 01 Aug 2016 11:26:24 -0400 Original-Received: from pastel.home (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.7/8.14.1) with ESMTP id u71FQMcV020118; Mon, 1 Aug 2016 11:26:22 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id D9DC160B03; Mon, 1 Aug 2016 11:28:12 -0400 (EDT) In-Reply-To: <83eg68o88b.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 01 Aug 2016 17:48:52 +0300") X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV5753=0 X-NAI-Spam-Version: 2.3.0.9418 : core <5753> : inlines <5058> : streams <1677140> : uri <2258747> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 132.204.246.22 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:206313 Archived-At: > But then why do we use a similar logic for after-change-functions? > Like this: > if (inserted > 0 && total > 0 > && (NILP (visit) || !NILP (replace))) > { > signal_after_change (PT, 0, inserted); > update_compositions (PT, PT, CHECK_BORDER); > } > IOW, we don't call after-change-functions if nothing was inserted. Sounds like a bug as well (unless it's called elsewhere in that case). It's OK to skip calling a-c-f if we did not insert anything *and* did not remove anything either. Stefan