From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tiphaine Turpin Newsgroups: gmane.emacs.bugs Subject: bug#10117: duplicate evaluation of after-change-functions hooks in revert-buffer Date: Wed, 23 Nov 2011 12:18:15 +0100 Message-ID: <4ECCD677.1090900@inria.fr> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1322047191 19336 80.91.229.12 (23 Nov 2011 11:19:51 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 23 Nov 2011 11:19:51 +0000 (UTC) To: 10117@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Nov 23 12:19:46 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RTArh-0003aA-Mv for geb-bug-gnu-emacs@m.gmane.org; Wed, 23 Nov 2011 12:19:45 +0100 Original-Received: from localhost ([::1]:51994 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RTArh-0006Gw-5k for geb-bug-gnu-emacs@m.gmane.org; Wed, 23 Nov 2011 06:19:45 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:35946) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RTAra-0006Gr-UP for bug-gnu-emacs@gnu.org; Wed, 23 Nov 2011 06:19:43 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RTArZ-0004UF-QQ for bug-gnu-emacs@gnu.org; Wed, 23 Nov 2011 06:19:38 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:33772) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RTArZ-0004UA-P1 for bug-gnu-emacs@gnu.org; Wed, 23 Nov 2011 06:19:37 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1RTAsw-0000W7-DJ for bug-gnu-emacs@gnu.org; Wed, 23 Nov 2011 06:21:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Tiphaine Turpin Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 23 Nov 2011 11:21:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 10117 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.13220472051903 (code B ref -1); Wed, 23 Nov 2011 11:21:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 23 Nov 2011 11:20:05 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RTAs1-0000Ue-Jd for submit@debbugs.gnu.org; Wed, 23 Nov 2011 06:20:05 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RTArz-0000UX-GU for submit@debbugs.gnu.org; Wed, 23 Nov 2011 06:20:04 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RTAqU-00049f-Do for submit@debbugs.gnu.org; Wed, 23 Nov 2011 06:18:38 -0500 Original-Received: from lists.gnu.org ([140.186.70.17]:33467) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RTAqU-00049Z-6C for submit@debbugs.gnu.org; Wed, 23 Nov 2011 06:18:30 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:47660) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RTAqP-0006Fu-0H for bug-gnu-emacs@gnu.org; Wed, 23 Nov 2011 06:18:30 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RTAqJ-00043o-Af for bug-gnu-emacs@gnu.org; Wed, 23 Nov 2011 06:18:24 -0500 Original-Received: from mail1-relais-roc.national.inria.fr ([192.134.164.82]:56884) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RTAqJ-00043V-1c for bug-gnu-emacs@gnu.org; Wed, 23 Nov 2011 06:18:19 -0500 X-IronPort-AV: E=Sophos;i="4.69,558,1315173600"; d="scan'208";a="132249737" Original-Received: from chercheurs2-241.saclay.inria.fr (HELO [193.55.250.241]) ([193.55.250.241]) by mail1-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-CAMELLIA256-SHA; 23 Nov 2011 12:18:16 +0100 User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.23) Gecko/20110922 Thunderbird/3.1.15 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Wed, 23 Nov 2011 06:21:02 -0500 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:54209 Archived-At: Hi, I'm having a strange behavior while trying to track the modifications to a buffer: calling revert-buffer triggers the following calls to my after-change-functions hook - a region deletion (which is exactly the changed region between the buffer and the file) - a region insertion (the new contents for the changed region) - the same insertion again. I don't care about how many modifications the reverting is splited into, or whether these are minimal or all the buffer contents is considered new, but the duplicate insertion leads me into invalid assumptions about the new contents (I use this to maintain a exact mapping of the buffer into an external tool). Am I wrong when I assume that the sequence of modifications passed to the after-change-functions is an exact trace of the buffer contents evolution ? What could possibly cause such a duplicate event ? Note: I'm not doing anything strange in the hook like changing the buffers' contents. This is just a numeric computation which update some buffer-local variables which track the set of "unprocessed" modifications. The hook is added as buffer-local (and global value of after-change-functions is nil). Regards, Tiphaine Turpin