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 10:56:59 +0100 Message-ID: <47C6856B.7080405@gmx.at> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------080302070108020508040609" X-Trace: ger.gmane.org 1204192670 14393 80.91.229.12 (28 Feb 2008 09:57:50 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 28 Feb 2008 09:57:50 +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 10:58:15 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 1JUfWi-0005o8-D6 for ged-emacs-devel@m.gmane.org; Thu, 28 Feb 2008 10:58:08 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JUfWB-0006dz-BF for ged-emacs-devel@m.gmane.org; Thu, 28 Feb 2008 04:57:36 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JUfVo-0006cZ-Ge for emacs-devel@gnu.org; Thu, 28 Feb 2008 04:57:12 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JUfVl-0006b0-He for emacs-devel@gnu.org; Thu, 28 Feb 2008 04:57:10 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JUfVj-0006aM-Id for emacs-devel@gnu.org; Thu, 28 Feb 2008 04:57:07 -0500 Original-Received: from mail.gmx.net ([213.165.64.20]) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1JUfVi-0006cD-OH for emacs-devel@gnu.org; Thu, 28 Feb 2008 04:57:07 -0500 Original-Received: (qmail invoked by alias); 28 Feb 2008 09:57:04 -0000 Original-Received: from N872P023.adsl.highway.telekom.at (EHLO [62.47.52.247]) [62.47.52.247] by mail.gmx.net (mp025) with SMTP; 28 Feb 2008 10:57:04 +0100 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX18OuPUMD8AOWDeO9VLi+Qt3Jm6eyBDVLcfIoK+qWr m+OkfGpzhjrtFI 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: Genre and OS details not recognized. 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:90712 Archived-At: This is a multi-part message in MIME format. --------------080302070108020508040609 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit > I looked at the C code for insert-file-contents, and its handling of the > undo list looks pretty messy, it seems to be saving it and restoring > multiple times (sometimes nested?) using multiple methods of restoring > the old value.... ... which is messy because I tried to avoid that intermediate steps of the decoding process show up in the undo-list. Please try the attached patch. --------------080302070108020508040609 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 10:41:36 2008 *************** *** 4772,4778 **** --- 4772,4783 ---- /* In the non-visiting case record only the final insertion. */ current_buffer->undo_list = Fcons (Fcons (lbeg, lend), Fcdr (old_undo)); + eles + current_buffer->undo_list = + Fcons (Fcons (lbeg, lend), old_undo); } + else + current_buffer->undo_list = old_undo; } else /* If undo_list was Qt before, keep it that way. --------------080302070108020508040609--