From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.devel Subject: Re: undo weirdness with insert-file-contents Date: Thu, 28 Feb 2008 14:12:57 +0100 Message-ID: <47C6B359.10302@gmx.at> References: <47C6856B.7080405@gmx.at> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------070307060008040001020303" X-Trace: ger.gmane.org 1204204742 25024 80.91.229.12 (28 Feb 2008 13:19:02 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 28 Feb 2008 13:19:02 +0000 (UTC) Cc: emacs-devel@gnu.org To: Miles Bader Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Feb 28 14:19:28 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 1JUifV-0006Zt-GS for ged-emacs-devel@m.gmane.org; Thu, 28 Feb 2008 14:19:25 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JUiez-0005uT-4y for ged-emacs-devel@m.gmane.org; Thu, 28 Feb 2008 08:18:53 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JUieV-0005kX-39 for emacs-devel@gnu.org; Thu, 28 Feb 2008 08:18:23 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JUieS-0005jx-RR for emacs-devel@gnu.org; Thu, 28 Feb 2008 08:18:21 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JUieS-0005ju-Ki for emacs-devel@gnu.org; Thu, 28 Feb 2008 08:18:20 -0500 Original-Received: from mail.gmx.net ([213.165.64.20]) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1JUieS-0003Jn-1Y for emacs-devel@gnu.org; Thu, 28 Feb 2008 08:18:20 -0500 Original-Received: (qmail invoked by alias); 28 Feb 2008 13:18:18 -0000 Original-Received: from N745P016.adsl.highway.telekom.at (EHLO [62.47.37.16]) [62.47.37.16] by mail.gmx.net (mp046) with SMTP; 28 Feb 2008 14:18:18 +0100 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX19U0uk7wfBUgkCB4+kgPbHwJQrZP82HqcRDmIMIZq aqWVxpEaLIoa3L User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: de-DE, de, en-us, en In-Reply-To: X-Y-GMX-Trusted: 0 X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) 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:90720 Archived-At: This is a multi-part message in MIME format. --------------070307060008040001020303 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit > The value of buffer-undo-list is: > > (nil > (10 . 21) > (1 . 21) > (t 0 . 0)) The (1 . 21) entry is silly and obviously breaks undoing the prior (insert "Foo: bar\n"). Although EQ (XCAR (tem), lbeg) was not very intelligent, setting this to (XCAR (tem) == lbeg) doesn't seem to help either. Please try again with the attached patch. GDB doesn't work here currently, so I can't debug this. But could you try finding out in `insert-file-contents' (1) why the test in if (CONSP (tem) && INTEGERP (XCAR (tem)) && INTEGERP (XCDR (tem)) && (XCAR (tem) == lbeg)) /* In the non-visiting case record only the final insertion. */ current_buffer->undo_list = Fcons (Fcons (lbeg, lend), Fcdr (old_undo)); fails and (2) which value old_undo has here? Thanks in advance. --------------070307060008040001020303 Content-Type: text/plain; name="fileio.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="fileio.patch" *** fileio.c.~1.602.~ Thu Feb 14 20:41:44 2008 --- fileio.c Thu Feb 28 13:59:42 2008 *************** *** 4674,4680 **** /* Save old undo list and don't record undo for decoding. */ old_undo = current_buffer->undo_list; - current_buffer->undo_list = Qt; if (NILP (replace)) { --- 4674,4679 ---- *************** *** 4768,4774 **** { Lisp_Object tem = XCAR (old_undo); if (CONSP (tem) && INTEGERP (XCAR (tem)) && ! INTEGERP (XCDR (tem)) && EQ (XCAR (tem), lbeg)) /* In the non-visiting case record only the final insertion. */ current_buffer->undo_list = Fcons (Fcons (lbeg, lend), Fcdr (old_undo)); --- 4767,4773 ---- { Lisp_Object tem = XCAR (old_undo); if (CONSP (tem) && INTEGERP (XCAR (tem)) && ! INTEGERP (XCDR (tem)) && (XCAR (tem) == lbeg)) /* In the non-visiting case record only the final insertion. */ current_buffer->undo_list = Fcons (Fcons (lbeg, lend), Fcdr (old_undo)); --------------070307060008040001020303--