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: save-buffer in tar-mode Date: Mon, 09 Feb 2004 04:39:31 -0500 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: References: <20040204.135033.207583862.Takaaki.Ota@am.sony.com> Reply-To: rms@gnu.org NNTP-Posting-Host: deer.gmane.org X-Trace: sea.gmane.org 1076320134 6075 80.91.224.253 (9 Feb 2004 09:48:54 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 9 Feb 2004 09:48:54 +0000 (UTC) Cc: Tak Ota , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Mon Feb 09 10:48:50 2004 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1Aq826-0000fW-00 for ; Mon, 09 Feb 2004 10:48:50 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1Aq826-0007cv-00 for ; Mon, 09 Feb 2004 10:48:50 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1Aq7zK-0002T1-Qw for emacs-devel@quimby.gnus.org; Mon, 09 Feb 2004 04:45:58 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1Aq7vr-0001Bk-Rj for emacs-devel@gnu.org; Mon, 09 Feb 2004 04:42:23 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1Aq7vG-0000yf-In for emacs-devel@gnu.org; Mon, 09 Feb 2004 04:42:18 -0500 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1Aq7vF-0000yN-Nt for emacs-devel@gnu.org; Mon, 09 Feb 2004 04:41:45 -0500 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.24) id 1Aq7t5-0005ip-4d; Mon, 09 Feb 2004 04:39:31 -0500 Original-to: handa@etl.go.jp In-reply-to: <20040204.135033.207583862.Takaaki.Ota@am.sony.com> (message from Tak Ota on Wed, 04 Feb 2004 13:50:33 -0800 (PST)) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:19825 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:19825 Yes. tar-mode toggles enable-multibyte-characters on saving a file by set-buffer-multibyte and that function discards undo info. To fix it, we must record this toggling in buffer-undo-list. That is one way to fix it. Another way would be to avoid changing enable-multibyte-characters. The reason for doing so is to control how insert-buffer copies the text. This suggests that the cleanest approach is to define a new primitive that does exactly the kind of copying that is desired. I think that should be easy. Would you like to fix it that way? I agree that it would be cleaner if set-buffer-multibyte did not destroy the undo list. In principle it certainly ought to preserve the undo list. But I think that could be a lot of work, too much to be worth the trouble. However, the judgment that it was too much trouble was in Emacs 20 or so. Since then we have made substantial changes in how multibyte encoding works. Maybe now it is not so hard. By all means think about it. I don't think that the planned new extension to undo-list format will help. That could be useful for recording the set-buffer-multibyte operation, so that it can be undone. However, the real problem is to update the existing undo-list entries so that they still make sense. The new kind of undo entry won't help with that. Meanwhile, even if set-buffer-multibyte is fixed to correct the undo list, the other solution (a new copy operation) would be a better way to do this operation.