From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: [n_schumacher@web.de: modification hooks called only once in c-mode] Date: Sun, 12 Aug 2007 01:50:31 -0400 Message-ID: References: <874pj6j3te.fsf@stupidchicken.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1186897905 27953 80.91.229.12 (12 Aug 2007 05:51:45 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 12 Aug 2007 05:51:45 +0000 (UTC) Cc: rms@gnu.org, emacs-devel@gnu.org To: Chong Yidong Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Aug 12 07:51:43 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1IK6MP-0005MX-Gb for ged-emacs-devel@m.gmane.org; Sun, 12 Aug 2007 07:51:43 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IK6MK-00080P-JE for ged-emacs-devel@m.gmane.org; Sun, 12 Aug 2007 01:51:28 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IK6MH-0007yv-BL for emacs-devel@gnu.org; Sun, 12 Aug 2007 01:51:25 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IK6MA-0007tO-Vn for emacs-devel@gnu.org; Sun, 12 Aug 2007 01:51:24 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IK6MA-0007tL-QO for emacs-devel@gnu.org; Sun, 12 Aug 2007 01:51:18 -0400 Original-Received: from tomts40.bellnexxia.net ([209.226.175.97] helo=tomts40-srv.bellnexxia.net) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IK6Lj-0000kV-6m; Sun, 12 Aug 2007 01:50:52 -0400 Original-Received: from pastel.home ([70.55.81.238]) by tomts40-srv.bellnexxia.net (InterMail vM.5.01.06.13 201-253-122-130-113-20050324) with ESMTP id <20070812055031.LUFM29719.tomts40-srv.bellnexxia.net@pastel.home>; Sun, 12 Aug 2007 01:50:31 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 5B01F856D; Sun, 12 Aug 2007 01:50:31 -0400 (EDT) In-Reply-To: <874pj6j3te.fsf@stupidchicken.com> (Chong Yidong's message of "Fri\, 10 Aug 2007 20\:46\:37 -0400") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1.50 (gnu/linux) X-Detected-Kernel: Solaris 8 (1) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:76375 Archived-At: > The bug arises when you have an after-change hook that does buffer > changes (in this case, this is c-after-change, which calls > c-invalidate-sws-region-after). The sequence of events is: [...] > One simple fix is to bind inhibit-modification-hooks in > c-after-change. Actually, why not bind inhibit-modification-hooks to t while running after-change-functions (and friends)? Those very rare hooks where modification hooks should not be inhibited (don't know of any, but let's assume they may exist), they can rebind inhibit-modification-hooks to nil. This is an idea comparable to binding inhibit-quit while running timers, filters, and sentinels. Stefan