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: Strange behaviour with dired and UTF8 Date: Thu, 1 May 2003 15:52:30 +0900 (JST) Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <200305010652.PAA14919@etlken.m17n.org> References: <200304241235.h3OCZdbL023178@stubby.bodenonline.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 (generated by SEMI 1.14.3 - "Ushinoya") Content-Type: text/plain; charset=US-ASCII X-Trace: main.gmane.org 1051771950 28014 80.91.224.249 (1 May 2003 06:52:30 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Thu, 1 May 2003 06:52:30 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Thu May 01 08:52:27 2003 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19B7vf-0007He-00 for ; Thu, 01 May 2003 08:52:27 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 19B85B-0000nY-00 for ; Thu, 01 May 2003 09:02:17 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 19B7wX-0003Dh-00 for emacs-devel@quimby.gnus.org; Thu, 01 May 2003 02:53:21 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 19B7w0-0002yX-00 for emacs-devel@gnu.org; Thu, 01 May 2003 02:52:48 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 19B7vw-0002ou-00 for emacs-devel@gnu.org; Thu, 01 May 2003 02:52:45 -0400 Original-Received: from tsukuba.m17n.org ([192.47.44.130]) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 19B7vo-0002St-00 for emacs-devel@gnu.org; Thu, 01 May 2003 02:52:37 -0400 Original-Received: from fs.m17n.org (fs.m17n.org [192.47.44.2])h416qVo29422; Thu, 1 May 2003 15:52:31 +0900 (JST) (envelope-from handa@m17n.org) Original-Received: from etlken.m17n.org (etlken.m17n.org [192.47.44.125]) h416qUA05371; Thu, 1 May 2003 15:52:30 +0900 (JST) Original-Received: (from handa@localhost) by etlken.m17n.org (8.8.8+Sun/3.7W-2001040620) id PAA14919; Thu, 1 May 2003 15:52:30 +0900 (JST) Original-To: jan.h.d@swipnet.se In-reply-to: <200304241235.h3OCZdbL023178@stubby.bodenonline.com> (jan.h.d@swipnet.se) User-Agent: SEMI/1.14.3 (Ushinoya) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.2 Emacs/21.2.92 (sparc-sun-solaris2.6) MULE/5.0 (SAKAKI) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Emacs development discussions. List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:13583 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:13583 In article <200304241235.h3OCZdbL023178@stubby.bodenonline.com>, "Jan D." writes: > Maybe I am doing this wrong, but here is what I try to do. > My language environment is ISO-8859-1. > I have a directory that contains files with file names in UTF-8. > I start dired on that directory. I want to see the UTF-8 characters > so I do C-x RET r utf-8. File names display OK now. > But when trying to operate on a file, say opening it, I get > "File no longer exists; type `g' to update Dired buffer" > It seems that dired does not keep the original file name around, but > tries to open with the display name representation of the file name. > When I type g, I loose the UTF-8 coding and files are now displayed > as ISO-8859-1 again. Setting buffer coding to UTF-8 does not help. > Do I have to set file-name-coding-system to UTF-8? This solves the > problem, but my file-name-coding-system is really ISO-8859-1, it is > just this one directory that is UTF-8. The current Emacs doesn't have a facility to cope with such a situation well. How about this? (1) Make a customizable variable file-name-coding-system-alist; the format is the same as file-coding-system-alist. (2) Make the macro ENCODE_FILE and DECODE_FILE to check that variable before using file-name-coding-system and default-file-name-coding-system. (3) Enhance the function dired-revert to update file-name-coding-system-alist automatically if it is called with coding-system-for-read being bound to non-nil. In that case, it may also have to ask a user to save that modification for the future session (via customize). What do people think? Aren't there any better idea? --- Ken'ichi HANDA handa@m17n.org