From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Miles Bader Newsgroups: gmane.emacs.devel,gmane.comp.gnu.core-utils.bugs Subject: Re: dired doesn't work properly with a multibyte locale Date: 27 Jan 2003 13:17:01 +0900 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: References: <200301151043.TAA09856@etlken.m17n.org> <200301230602.PAA07755@etlken.m17n.org> <200301250049.JAA11674@etlken.m17n.org> Reply-To: Miles Bader NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1043641518 6141 80.91.224.249 (27 Jan 2003 04:25:18 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 27 Jan 2003 04:25:18 +0000 (UTC) Cc: emacs-devel@gnu.org Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18d0pd-0001ae-00 for ; Mon, 27 Jan 2003 05:25:13 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 18d0tf-0007T8-00 for ; Mon, 27 Jan 2003 05:29:23 +0100 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 18d0lK-00035O-07 for emacs-devel@quimby.gnus.org; Sun, 26 Jan 2003 23:20:46 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 18d0kU-0002Uc-00 for emacs-devel@gnu.org; Sun, 26 Jan 2003 23:19:54 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 18d0ju-0001Pr-00 for emacs-devel@gnu.org; Sun, 26 Jan 2003 23:19:18 -0500 Original-Received: from tyo201.gate.nec.co.jp ([210.143.35.51]) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18d0j1-0006zb-00; Sun, 26 Jan 2003 23:18:23 -0500 Original-Received: from mailgate3.nec.co.jp ([10.7.69.192])h0R4HLw27262; Mon, 27 Jan 2003 13:17:21 +0900 (JST) Original-Received: from mailsv.nec.co.jp (mailgate52.nec.co.jp [10.7.69.198]) by mailgate3.nec.co.jp (8.11.6/3.7W-MAILGATE-NEC) with ESMTP id h0R4HLi22184; Mon, 27 Jan 2003 13:17:21 +0900 (JST) Original-Received: from mcsss2.ucom.lsi.nec.co.jp ([10.30.114.133]) by mailsv.nec.co.jp (8.11.6/3.7W-MAILSV-NEC) with ESMTP id h0R4H2q04812; Mon, 27 Jan 2003 13:17:18 +0900 (JST) Original-Received: from mcspd15.ucom.lsi.nec.co.jp (mcspd15 [10.30.114.174]) id h0R4H2B10392; Mon, 27 Jan 2003 13:17:02 +0900 (JST) Original-Received: by mcspd15.ucom.lsi.nec.co.jp (Postfix, from userid 31295) id 1759836F6; Mon, 27 Jan 2003 13:17:01 +0900 (JST) Original-To: Kenichi Handa System-Type: i686-pc-linux-gnu Blat: Foop In-Reply-To: <200301250049.JAA11674@etlken.m17n.org> Original-Lines: 47 Original-cc: bug-coreutils@gnu.org Original-cc: emacs-pretest-bug@gnu.org 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:11115 gmane.comp.gnu.core-utils.bugs:86 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:11115 Kenichi Handa writes: > > If there's a file containing a newline, then if LANG=C, dired can > > correctly deal with it (e.g., I can put the cursor on it and hit RET, > > and it visits that file), but if LANG=ja_JP.eucjp, then it correctly > > displays all _other_ files, but you can't use RET to visit the > > newline-in-the-file-name file (it says `File no longer exists; type `g' > > to update Dired buffer'). > > So, I have no idea what's wrong with the current code. > Could you debug it? Hmm, it actually seems to be a bug with `ls'! I created two files, one called `abc\ndef' (where \n is a newline), and one called `1234567'. Here's what ls prints if stdout is a tty (I've indented the output by 3 spaces): (tmp) LANG=ja_JP.eucJP ls -l --dired abc* 123* -rw-rw---- 1 miles 6 2003-01-27 13:03 1234567 -rw-rw---- 1 miles 6 2003-01-27 12:58 abc?def //DIRED// 53 60 114 121 //DIRED-OPTIONS// --quoting-style=literal [note that the start/end offsets of each filename differ by 7] But here's what the _same_ command prints if stdout is a pipe (which I presume is the case for dired): (tmp) LANG=ja_JP.eucJP ls -l --dired abc* 123* | cat -rw-rw---- 1 miles 6 2003-01-27 13:03 1234567 -rw-rw---- 1 miles 6 2003-01-27 12:58 abc def //DIRED// 53 60 114 120 //DIRED-OPTIONS// --quoting-style=literal Now the start/end offsets of `abc\ndef' now only differ by 6 (which is obviously wrong, since the filename is 7 characters long)! Morever this problem only seems to occur if LANG=ja_JP.eucJP, _not_ if LANG=C. My ls --version says: ls (coreutils) 4.5.4 What version do you have? I guess I'll report a bug against ls... -Miles -- Is it true that nothing can be known? If so how do we know this? -Woody Allen