From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Noam Postavsky Newsgroups: gmane.emacs.devel Subject: Re: Unbalanced change hooks (part 2) Date: Sun, 31 Jul 2016 09:58:50 -0400 Message-ID: References: <20160731121642.GB2205@acm.fritz.box> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: blaine.gmane.org 1469973590 7236 80.91.229.8 (31 Jul 2016 13:59:50 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 31 Jul 2016 13:59:50 +0000 (UTC) Cc: =?UTF-8?Q?=C3=93scar_Fuentes?= , Richard Copley , Emacs developers To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jul 31 15:59:32 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 1bTrH9-0001or-Co for ged-emacs-devel@m.gmane.org; Sun, 31 Jul 2016 15:59:31 +0200 Original-Received: from localhost ([::1]:39703 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bTrH5-0001rE-GW for ged-emacs-devel@m.gmane.org; Sun, 31 Jul 2016 09:59:27 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54456) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bTrGY-0001qx-Pm for emacs-devel@gnu.org; Sun, 31 Jul 2016 09:58:55 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bTrGW-000648-82 for emacs-devel@gnu.org; Sun, 31 Jul 2016 09:58:53 -0400 Original-Received: from mail-oi0-x232.google.com ([2607:f8b0:4003:c06::232]:34535) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bTrGW-000644-36 for emacs-devel@gnu.org; Sun, 31 Jul 2016 09:58:52 -0400 Original-Received: by mail-oi0-x232.google.com with SMTP id l65so162566153oib.1 for ; Sun, 31 Jul 2016 06:58:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=vAoyQVDs6yZaOkbdZzH1UjVkNjS7TRhO1ldWCbbMQos=; b=DfyyQk7u1XK6cSYMzocz1JdD7sYniLYU22+bUXmIoASCFKJy/hLWVAck6//gtn/aIo DoHhcnsiN23M8p4ofBG6JoYnnZQFnmPPFIJuBD29aWgRfHGJOPkxxKRtpXEDKCxcy1JJ 3Yv5qolRrqy2qDYrUZXyMziNt0j4I7zCIKqMmeree26N865sMCd+zk0Rh89tAnMhUp7B 20k97DM68bUUAxDsg2sCw3IJeJEYHfiECGHcZVAOIw9JtB52tCZjdznF7vMFsP1WXA4t P2+cUKmdWOdlygiWgHYVNi/m0eXpBK1AAhj2LX3AcwQezbmBE5gvm+wlus/J0+Un6oMO u33g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=vAoyQVDs6yZaOkbdZzH1UjVkNjS7TRhO1ldWCbbMQos=; b=VrTuVw1anX2XWbLpH38QjdC2QPM/BFHmTdIz8erE86BQZ4tg3w2IbW/X1B99dQC/wq sQTBaxmRWpCGQviBJLPahMNJimXq1O6lZ1tdFRuH9Y3G8pxJ70AYlGkvItjX5S/5o4Af x5gXKO3SrLgtdta4aR1vln1umTG3vOoqT44uQGtdJgDqiP+4RziwHGs2pv3vl2rpkjbw Muxu5DeMHofjMk0sjWuJqy8B9sUC84lC8vN5mAzkviyUSCWgYq/gijlY2lnRFRjY03T1 c+5qNwaakjvds4/kQwFUpmLmYsFrqXmsgAiZr0wP45AOGbttUDRUDrj7egEORD9ky8Kr LyUg== X-Gm-Message-State: AEkooutF4URzh68STHYJZD+oP6SiNIkguHCopXjLBQDNeemkwTAADd8OiTRDzVtgHHlWZPs8+W9IZ3ZwYMa29A== X-Received: by 10.157.51.112 with SMTP id u45mr32781750otd.124.1469973531023; Sun, 31 Jul 2016 06:58:51 -0700 (PDT) Original-Received: by 10.157.7.161 with HTTP; Sun, 31 Jul 2016 06:58:50 -0700 (PDT) In-Reply-To: <20160731121642.GB2205@acm.fritz.box> X-Google-Sender-Auth: OZ71q0d4c1BcUkHzV3xYV5OecG8 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:4003:c06::232 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:206265 Archived-At: On Sun, Jul 31, 2016 at 8:16 AM, Alan Mackenzie wrote: > > The pertinent functions are insert_1_both, replace_range, del_range_1, > del_range_byte, and del_range_both. These functions fall into two > groups, the first two in group 1 and the rest in group 2. Those in group > 2 always call signal_after_change, those in group 1 never do. replace_range should be in group 2 as well, no? > > There are invocations of group 2 functions with `prepare' false. This > wrongly invokes after-change-functions without having invoked > before-change-functions. replace_range has one call with prepare = false, it's in Fsubst_char_in_region. I think the idea is that the caller takes care of calling both before (by calling modify_text) and after (by explicit call and/or(??) by replace_range) change functions, though the code is sufficiently convuluted that I can't really say whether it works correctly or not.