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: undo bug? Date: Thu, 03 Apr 2008 09:55:21 -0400 Message-ID: References: <47F21FEB.401@gmx.at> <47F28479.3030605@gmx.at> <47F2A0C7.7030402@gmx.at> <47F3BBFA.1000109@gmx.at> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1207230939 7355 80.91.229.12 (3 Apr 2008 13:55:39 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 3 Apr 2008 13:55:39 +0000 (UTC) Cc: Katsumi Yamaoka , emacs-devel@gnu.org To: martin rudalics Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Apr 03 15:56:09 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JhPvE-0002NR-Jy for ged-emacs-devel@m.gmane.org; Thu, 03 Apr 2008 15:56:08 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JhPub-0003Xf-AD for ged-emacs-devel@m.gmane.org; Thu, 03 Apr 2008 09:55:29 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JhPuW-0003XO-Qn for emacs-devel@gnu.org; Thu, 03 Apr 2008 09:55:24 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JhPuV-0003X5-98 for emacs-devel@gnu.org; Thu, 03 Apr 2008 09:55:24 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JhPuV-0003X2-5n for emacs-devel@gnu.org; Thu, 03 Apr 2008 09:55:23 -0400 Original-Received: from pruche.dit.umontreal.ca ([132.204.246.22]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JhPuU-0007Mk-Rq for emacs-devel@gnu.org; Thu, 03 Apr 2008 09:55:22 -0400 Original-Received: from ceviche.home (vpn-132-204-232-135.acd.umontreal.ca [132.204.232.135]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id m33DtYds001153 for ; Thu, 3 Apr 2008 09:55:34 -0400 Original-Received: by ceviche.home (Postfix, from userid 20848) id 063B2B40F9; Thu, 3 Apr 2008 09:55:22 -0400 (EDT) In-Reply-To: <47F3BBFA.1000109@gmx.at> (martin rudalics's message of "Wed, 02 Apr 2008 19:01:46 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-NAI-Spam-Score: -2.5 X-NAI-Spam-Rules: 1 Rules triggered BAYES_00=-2.5 X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:94258 Archived-At: >> Yes, that's indeed what I had understood from your earlier message and >> what I was responding to. You're remove the undo boundaries (i.e. the >> nil entries) and replace them by point-record entries. That would work >> fine, except that there are packages out there that look for the >> nil entries. > Too bad, indeed. Are they looking out just for entries they created > themselves? >>> Sometimes. For example I use the patch below to handle the (pretty >>> annoying) problem that when I redo an earlier insertion `point' ends up >>> _before_ the inserted text (my `undo' binds `undo-is-redo' to `equiv' >>> when calling `undo-more'). >> >> Have you tried to analyze the source of the problem? Maybe there are >> cases where we incorrectly decide not to put a point-record even tho it >> is needed. > I think we should enclose every undoable character-modifiying buffer > change by a `record-point' before and a `record-point' after it. An > `undo' would reestablish the position recorded before, a `redo' the > position recorded after the change. This way we would handle all > flavors of inserting text before/after `point' as well as undoing and > redoing. The record-point after it wouldn't make anny difference, would it? Hmm... unless undoing a `record-point' would forcefully add another record-point entry i nthe undo-list... I guess that might work. Still, I'm wondering what will be the effect of such a thing on the length of the undo-list. It's a pretty minor issue, as far as I can tell, so it had better not have any noticeable downside. Stefan