Andreas Schwab <[EMAIL PROTECTED]> 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 <[EMAIL PROTECTED]> 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
[EMAIL PROTECTED]


*** 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)))))


_______________________________________________
Bug-coreutils mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-coreutils

Reply via email to