From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.devel Subject: Re: New undo element (fun . args) Date: Thu, 03 Feb 2005 14:13:28 -0500 Message-ID: References: <87fz0jyn19.fsf-monnier+emacs@gnu.org> <87mzunvyki.fsf-monnier+emacs@gnu.org> Reply-To: rms@gnu.org NNTP-Posting-Host: deer.gmane.org X-Trace: sea.gmane.org 1107458300 11141 80.91.229.6 (3 Feb 2005 19:18:20 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 3 Feb 2005 19:18:20 +0000 (UTC) Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Feb 03 20:18:14 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1CwmUY-0003Cy-00 for ; Thu, 03 Feb 2005 20:18:14 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Cwmhv-0006MI-VH for ged-emacs-devel@m.gmane.org; Thu, 03 Feb 2005 14:32:03 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1CwmgI-0005hQ-Av for emacs-devel@gnu.org; Thu, 03 Feb 2005 14:30:23 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1CwmgG-0005fw-9P for emacs-devel@gnu.org; Thu, 03 Feb 2005 14:30:20 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1CwmgE-0005f1-Ix for emacs-devel@gnu.org; Thu, 03 Feb 2005 14:30:19 -0500 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1CwmSm-0004LN-PN for emacs-devel@gnu.org; Thu, 03 Feb 2005 14:16:24 -0500 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.34) id 1CwmPw-00035j-MS; Thu, 03 Feb 2005 14:13:28 -0500 Original-To: no-spam@cua.dk (Kim F. Storm) In-reply-to: (no-spam@cua.dk) 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: main.gmane.org gmane.emacs.devel:32827 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:32827 /* Make sure this produces at least one undo entry, so the test in `undo' for continuing an undo series will work right. */ if (EQ (oldlist, current_buffer->undo_list)) current_buffer->undo_list = Fcons (list3 (Qapply, Qcdr, nil), current_buffer->undo_list); I don't understand why this is necessary. The primitive-undo continues to the next undo boundary, so why is it important what is recorded "between undo boundaries" ? I think it is necessary for this code to work: ;; If something (a timer or filter?) changed the buffer ;; since the previous command, don't continue the undo seq. (let ((list buffer-undo-list)) (while (eq (car list) nil) (setq list (cdr list))) ;; If the last undo record made was made by undo ;; it shows nothing else happened in between. (gethash list undo-equiv-table)))) If undoing does not generate any undo entries, there will be nothing for this hash mark to ride on. However, I may have misunderstood something. It works to some extent, but as soon as undo hits one of the entries I added to the undo list, it gets stuck -- and the pending undo list seems to be stuck at that specific (apply cdr ...) entry. Could you debug precisely what is happening when it is "stuck" as you say? In what way does the undo process fail to work? Where is the bug?