emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: dired doesn't work properly with a multibyte locale


From: Kenichi Handa
Subject: Re: dired doesn't work properly with a multibyte locale
Date: Mon, 3 Feb 2003 20:17:36 +0900 (JST)
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)

Andreas Schwab <address@hidden> writes:
> |> Really?  I thought ls's output counts columns, thus, for
> |> instnace, the filename "À" is counted as 1, not 2.
> |> Otherwise, the current dired should work well.

> The dired offsets are explicitly documented as counting bytes, *note
> (coreutils)What information is listed::.

Ah, yes, I know that.  What I meant was "that buggy ls's
output counts columns".

Miles Bader <address@hidden> writes:
> You seem to be correct, if I create that file, then `ls --dired' says
> it has a lengh of 1, but of course, it actually has a length of 2 bytes.

Ok.  Then what should we do?   I think checking version of
ls is too kludgy.

Please try this workaround.  It avoids setting
`dired-filename' property if the next character of filename
is not a newline.  I think it detects the problem of "ls" in
most cases by a low cost.

---
Ken'ichi HANDA
address@hidden


*** files.el.~1.632.~   2003-02-01 00:16:47.000000000 +0900
--- files.el    2003-02-03 20:03:30.000000000 +0900
***************
*** 4106,4112 ****
              (while (< (point) end)
                (let ((start (+ beg (read (current-buffer))))
                      (end (+ beg (read (current-buffer)))))
!                 (put-text-property start end 'dired-filename t)))
              (goto-char end)
              (beginning-of-line)
              (delete-region (point) (progn (forward-line 2) (point)))))
--- 4106,4117 ----
              (while (< (point) end)
                (let ((start (+ beg (read (current-buffer))))
                      (end (+ beg (read (current-buffer)))))
!                 (if (= (char-after end) ?\n)
!                     (put-text-property start end 'dired-filename t)
!                   ;; It seems that we can't trust ls's output as to
!                   ;; byte positions of filenames.
!                   (put-text-property beg (point) 'dired-filename nil)
!                   (end-of-line))))
              (goto-char end)
              (beginning-of-line)
              (delete-region (point) (progn (forward-line 2) (point)))))




reply via email to

[Prev in Thread] Current Thread [Next in Thread]