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: disabling undo boundaries Date: Thu, 06 Aug 2015 18:20:52 -0400 Message-ID: References: <87fv746rd5.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> <871ti9ammc.fsf@newcastle.ac.uk> <878ucaqm3g.fsf@newcastle.ac.uk> <87y4hrm911.fsf@newcastle.ac.uk> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1438899714 21258 80.91.229.3 (6 Aug 2015 22:21:54 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 6 Aug 2015 22:21:54 +0000 (UTC) Cc: Emacs-Devel devel To: phillip.lord@newcastle.ac.uk (Phillip Lord) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Aug 07 00:21:42 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 1ZNTXh-0007q2-N7 for ged-emacs-devel@m.gmane.org; Fri, 07 Aug 2015 00:21:41 +0200 Original-Received: from localhost ([::1]:46977 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZNTXg-0006ik-NW for ged-emacs-devel@m.gmane.org; Thu, 06 Aug 2015 18:21:40 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60979) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZNTX2-0006Tp-KX for emacs-devel@gnu.org; Thu, 06 Aug 2015 18:21:01 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZNTWx-0000x0-06 for emacs-devel@gnu.org; Thu, 06 Aug 2015 18:21:00 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:51842) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZNTWw-0000wH-02 for emacs-devel@gnu.org; Thu, 06 Aug 2015 18:20:54 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0AsEwA731xV//gFNJ1cDoMChAKFVbs3CYdLBAICgTw5FAEBAQEBAQGBCkEFg10BAQMBViMFCws0EhQYDYhbCM8jAQEBAQYCAR+LOoUFB4QtBZ8XkhSDWSODOloigngBAQE X-IPAS-Result: A0AsEwA731xV//gFNJ1cDoMChAKFVbs3CYdLBAICgTw5FAEBAQEBAQGBCkEFg10BAQMBViMFCws0EhQYDYhbCM8jAQEBAQYCAR+LOoUFB4QtBZ8XkhSDWSODOloigngBAQE X-IronPort-AV: E=Sophos;i="5.13,465,1427774400"; d="scan'208";a="159026881" Original-Received: from 157-52-5-248.cpe.teksavvy.com (HELO pastel.home) ([157.52.5.248]) by ironport2-out.teksavvy.com with ESMTP; 06 Aug 2015 18:20:52 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 86BD7604CF; Thu, 6 Aug 2015 18:20:52 -0400 (EDT) In-Reply-To: <87y4hrm911.fsf@newcastle.ac.uk> (Phillip Lord's message of "Tue, 04 Aug 2015 15:18:50 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.248.154.181 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:188519 Archived-At: > I think that the current undo-boundary behaviour wrt a single buffer > makes sense. It's the fact that inserting content into *that* buffer > forces an undo-boundary into *this* buffer. I don't know why Emacs > does this. I think the reason is not very deep: for reasons of efficiency (back in the days when 8MB was a lot of memory), Emacs keeps track of a few undo-related pieces of information in global variables, so it can only handle a single buffer at a time. If a command touches some other buffer, the C code has to choose between "just switch" and "push a boundary and then switch", and the choice it makes is to err on the "safe" side of adding a potentially unnecessary undo-boundary rather than risking to let the undo-log grow without intervening boundaries. In your cases, this is complicated by the fact that you're concerned about self-insert-command which is very special in that it was the only command that doesn't push a boundary every time, but only once every N repetitions. Stefan