From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: =?UTF-8?Q?Cl=c3=a9ment_Pit-Claudel?= Newsgroups: gmane.emacs.devel Subject: Re: How can I undo a change from a modification-hook? Date: Wed, 26 Apr 2017 15:02:29 -0400 Message-ID: <2ee71c70-50a2-b054-ee87-5a28fc7776cb@gmail.com> References: <2448005f-9fc4-78b2-3203-9fc8204f6f5b@mit.edu> <87fd6638-f46a-95f2-8b70-f271f5daeb63@gmail.com> <7f8bb205-c311-3360-ad0e-df205240199b@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1493233422 5244 195.159.176.226 (26 Apr 2017 19:03:42 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 26 Apr 2017 19:03:42 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Apr 26 21:03:38 2017 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 1d3SDx-0001FK-37 for ged-emacs-devel@m.gmane.org; Wed, 26 Apr 2017 21:03:37 +0200 Original-Received: from localhost ([::1]:56738 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d3SE2-0003gK-TR for ged-emacs-devel@m.gmane.org; Wed, 26 Apr 2017 15:03:42 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48362) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d3SCx-0003fR-V0 for emacs-devel@gnu.org; Wed, 26 Apr 2017 15:02:36 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d3SCt-0002iy-Lg for emacs-devel@gnu.org; Wed, 26 Apr 2017 15:02:35 -0400 Original-Received: from mail-qk0-x233.google.com ([2607:f8b0:400d:c09::233]:33996) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d3SCt-0002iX-Gw for emacs-devel@gnu.org; Wed, 26 Apr 2017 15:02:31 -0400 Original-Received: by mail-qk0-x233.google.com with SMTP id y63so9385729qkd.1 for ; Wed, 26 Apr 2017 12:02:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=IWcabTzi0+3yO82wZfweyBL9Y9Ru/k62nsAeNOq86Qo=; b=W92uNmEtmQfGqI70EyO6yiQIEKfOvYCZwvDhciffB6CZi1HOPpJ6Vw6dvOdMX/N820 1yNXcktGsfFID/oev6gbTZb5Rj4qIsklMOuGj8FzYTgceAtBkyUD3q6/1wBzW7yo9iyO sZDqs4nJ4vYyH2ODpTslehVTGNBLWTkjEy9IfsYLniTka+XCjVTf6+MKpKbV0MQhal2Z iPaIzj77cO9SYnqNA5NoTT9QYl8fcfEsL7fxoV+fFy0cpZNMH5540Q8UTCheR0XwxP4g eKO+1e60skaqt9dyn67utQv5V1K4qHbVdetSyO3kHU+J7NALCYQ6ZbuF6QvOYK9FrZku hBPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=IWcabTzi0+3yO82wZfweyBL9Y9Ru/k62nsAeNOq86Qo=; b=obwp2z/Fns5nJRyC4acQ3Dmx59RYAy6khkHKx0Co1RH08rarwtnSI9ZT0DmfSpEpU8 Ro8lWlWl5Wi0ld9VDkIYc5x5ylo++PpsuxwBDGB2G48JmsTRqVAFEXxOov+wDFoGv7LO VtF++ocSZiMcVAlSxlfH4fQpzKz+mcoXl0z92XHB+sLyAtf15Xb/F7Qki5up3vfFaULb OvqWfLDkzl4WRaXR7E3/Ggwp2GK452Rp8nn+5UxpJG7/myJ0cDpDiN9imbo1mDA4uJ41 6r6yj81IOFrjweC/QlMp40m7Xgp9LTqr81Xs6Aei/zdntV0tfcoWAjCDmX/96C92FLvf hXrw== X-Gm-Message-State: AN3rC/7hQKXz/yKgTCmbR2et1eHiUpI9G76UwWVHLB1GH6p/GvpnQsVI 5b52qmPhF49ALvPyPW0= X-Received: by 10.55.52.13 with SMTP id b13mr1535127qka.28.1493233350808; Wed, 26 Apr 2017 12:02:30 -0700 (PDT) Original-Received: from [18.189.26.125] (dhcp-18-189-26-125.dyn.MIT.EDU. [18.189.26.125]) by smtp.gmail.com with ESMTPSA id u63sm75349qkh.45.2017.04.26.12.02.29 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 26 Apr 2017 12:02:29 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::233 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:214321 Archived-At: On 2017-04-26 14:43, Stefan Monnier wrote: >>>>> In the case of PG, I'd suggest you treat such a case as >>>>> a non-whitespace change. >>>> But I can't, can I? The damage (the change) is already done at that point, >>>> and I can't revert it. >>> But you can "retract" until the beginning of the changed area. >> No, not if the current subprocess is busy. > > Not sure why it matters: you queue the retraction commands for execution > when the subprocess is done with its current command(s). No, that's not something that I can currently do: I can't queue a retraction before the processing of that section is complete (because that processing may fail, and then there wouldn't be anything left to retract). Of course, I could rewrite the queuing logic to be more resilient to this kind of changes. But the question is about ways to prevent edits, and I think it's more general than this particular example.