From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Kenichi Handa Newsgroups: gmane.emacs.devel Subject: Re: revert-buffer and changes in encoding Date: Thu, 30 Dec 2004 21:44:50 +0900 (JST) Message-ID: <200412301244.VAA28792@etlken.m17n.org> References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 (generated by SEMI 1.14.3 - "Ushinoya") Content-Type: text/plain; charset=US-ASCII X-Trace: sea.gmane.org 1104422069 12694 80.91.229.6 (30 Dec 2004 15:54:29 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 30 Dec 2004 15:54:29 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Dec 30 16:54:12 2004 Return-path: Original-Received: from mail-relay.eunet.no ([193.71.71.242]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1Ck2S2-0006Mu-00 for ; Thu, 30 Dec 2004 16:42:58 +0100 Original-Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by mail-relay.eunet.no (8.13.1/8.13.1/GN) with ESMTP id iBUFgOxZ002128 for ; Thu, 30 Dec 2004 16:42:57 +0100 (CET) (envelope-from emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org) Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1Ck2EF-0005qZ-RS for ged-emacs-devel@m.gmane.org; Thu, 30 Dec 2004 10:28:43 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1Ck10h-0002Lj-WF for emacs-devel@gnu.org; Thu, 30 Dec 2004 09:10:40 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1Ck0XT-0001XK-0p for emacs-devel@gnu.org; Thu, 30 Dec 2004 08:40:33 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CjzsP-00039W-8f for emacs-devel@gnu.org; Thu, 30 Dec 2004 07:58:01 -0500 Original-Received: from [192.47.44.130] (helo=tsukuba.m17n.org) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.34) id 1Cjzfh-0005MU-CD; Thu, 30 Dec 2004 07:44:54 -0500 Original-Received: from fs.m17n.org (fs.m17n.org [192.47.44.2]) by tsukuba.m17n.org (8.12.3/8.12.3/Debian-7.1) with ESMTP id iBUCipY7022220; Thu, 30 Dec 2004 21:44:51 +0900 Original-Received: from etlken.m17n.org (etlken.m17n.org [192.47.44.125]) by fs.m17n.org (8.11.6p2/8.11.6) with ESMTP id iBUCioq11650; Thu, 30 Dec 2004 21:44:50 +0900 (JST) Original-Received: (from handa@localhost) by etlken.m17n.org (8.8.8+Sun/3.7W-2001040620) id VAA28792; Thu, 30 Dec 2004 21:44:50 +0900 (JST) Original-To: rms@gnu.org In-reply-to: (message from Richard Stallman on Tue, 21 Dec 2004 06:22:11 -0500) User-Agent: SEMI/1.14.3 (Ushinoya) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.2 Emacs/21.3.50 (sparc-sun-solaris2.6) MULE/5.0 (SAKAKI) 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:31600 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:31600 In article , Richard Stallman writes: > Can you implement this change? Nobody else offered to, > and I think it's in your area. Please ack when it's done. > We have had discussions in the past about how revert-buffer > should deal with encoding. I think this statement, by Stefan, > is the right thing to do: > Looks like we should remember whether the current coding-system was > automatically inferred or whether it was explicitly specified. > Of course, we need to remember it separatly for the line-ending part > of the coding-system. > If the file was originally visited with a specified coding system, > revert-buffer should keep on using that specified coding system. If > the file coding system was autodetected before, revert-buffer should > autodetect it again, and it should set buffer-file-coding-system again > so that saving the buffer uses the most recent coding system. > Setting this flag to record whether the coding system was explicitly > specified is easy to do in Finsert_buffer. It should only set this > flag when the VISIT argument specifies visiting a file. > Can someone please implement this, and ack to me? I've just installed these changes: (1) Make a new buffer local variable explicit-buffer-file-coding-system. (2) Set it to coding-system-for-read in after-insert-file-set-coding. (3) Set it to last-coding-system-used in basic-save-buffer-1 after writing. (4) In revert-buffer, bind coding-system-for-read of explicit-buffer-file-coding-system. --- Ken'ichi HANDA handa@m17n.org