From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: phillip.lord@newcastle.ac.uk (Phillip Lord) Newsgroups: gmane.emacs.devel Subject: Re: disabling undo boundaries Date: Sat, 08 Aug 2015 11:01:36 +0100 Message-ID: <87614q5can.fsf@newcastle.ac.uk> References: <87fv746rd5.fsf@newcastle.ac.uk> <87ioby3tdy.fsf@newcastle.ac.uk> <87y4kth5ps.fsf@newcastle.ac.uk> <87sib0a3jr.fsf@newcastle.ac.uk> <871tiiowjw.fsf@newcastle.ac.uk> <87siaxk4dl.fsf@newcastle.ac.uk> <87iobsr6m2.fsf@newcastle.ac.uk> <87oalgaicm.fsf@newcastle.ac.uk> <87y4kkkzlo.fsf@newcastle.ac.uk> <87mw0zk7yp.fsf@newcastle.ac.uk> <87617mgp1b.fsf@newcastle.ac.uk> <55C543ED.5030801@lanl.gov> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1439028125 13472 80.91.229.3 (8 Aug 2015 10:02:05 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 8 Aug 2015 10:02:05 +0000 (UTC) Cc: Stefan Monnier , Emacs development discussions To: Davis Herring Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Aug 08 12:01:56 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZO0ws-0005py-Sr for ged-emacs-devel@m.gmane.org; Sat, 08 Aug 2015 12:01:55 +0200 Original-Received: from localhost ([::1]:52423 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZO0ws-0005lZ-Ew for ged-emacs-devel@m.gmane.org; Sat, 08 Aug 2015 06:01:54 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53643) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZO0wg-0005lJ-Jl for emacs-devel@gnu.org; Sat, 08 Aug 2015 06:01:43 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZO0wd-0005tz-9m for emacs-devel@gnu.org; Sat, 08 Aug 2015 06:01:42 -0400 Original-Received: from cheviot12.ncl.ac.uk ([128.240.234.12]:44529) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZO0wd-0005tk-3U for emacs-devel@gnu.org; Sat, 08 Aug 2015 06:01:39 -0400 Original-Received: from smtpauth-vm.ncl.ac.uk ([10.8.233.129] helo=smtpauth.ncl.ac.uk) by cheviot12.ncl.ac.uk with esmtp (Exim 4.63) (envelope-from ) id 1ZO0wc-0000Ly-BB; Sat, 08 Aug 2015 11:01:38 +0100 Original-Received: from cpc6-benw10-2-0-cust45.gate.cable.virginm.net ([92.238.179.46] helo=localhost) by smtpauth.ncl.ac.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.63) (envelope-from ) id 1ZO0wb-0001P0-TT; Sat, 08 Aug 2015 11:01:37 +0100 In-Reply-To: <55C543ED.5030801@lanl.gov> (Davis Herring's message of "Fri, 7 Aug 2015 17:49:01 -0600") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 128.240.234.12 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:188605 Archived-At: Davis Herring writes: > [I'm late to this thread, but after reading the more recent portion, > this still seems a useful reply.] > >> For self-insert-command, it's more tricky, and you'd probably need to do >> the extra manual work. E.g. add a post-self-insert-hook which checks if >> this self-insert-command removed the previous undo-boundary and then >> remove it as well in the sibling buffer. I can't see how undo.c could >> do that for you magically, since it doesn't know that the insertions in >> the sibling buffer are "clones" of the insertions in the main buffer, >> nor that it's done by self-insert-command. Another approach would be >> for you to arrange such that your a-f-c uses self-insert-command rather >> than `insert' when cloning the insertion from a self-insert-command, but >> that's probably just as hard if not harder. > > Shouldn't it be easy to write a function (callable from Lisp) that > emulates self-insert-command (and its special behavior w.r.t. undo), > except that it takes a character as an argument? That would help a little in my use case, although the self-insert-command behaviour is a tweak for me, not a main concern. I think that the main issue is the use of "nil" for an undo-boundary. This makes all undo-boundaries equivalent and impossible to tag. Something like '(:boundary) or (:boundary :reason) would be far easier, at the cost of two cons cells rather than one, at least for a naive implementation. Phil