GNU bug report logs -
#27762
26.0.50; ls-lisp: misalignment when dired-directory is a cons
Previous Next
Reported by: Tino Calancha <tino.calancha <at> gmail.com>
Date: Wed, 19 Jul 2017 03:23:02 UTC
Severity: minor
Found in version 26.0.50
Done: Tino Calancha <tino.calancha <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
Eli Zaretskii <eliz <at> gnu.org> writes:
>> II) Now suppose we want to list the same files _but_ we want that
>> "cyge32.c" appears the first.
>> emacs -Q -l ls-lisp -eval '(setq ls-lisp-use-insert-directory-program nil)'
>> Eval this form:
>>
>> (let* ((dir source-directory)
>> (default-directory dir)
>> (files (mapcar (lambda (f) (concat "src/" f))
>> (cons "cygw32.c"
>> (delete "cygw32.c"
>> (directory-files (expand-file-name "src") nil "\\.*\\.c\\'"))))))
>> (dired (nconc (list dir) files)))
>> ;; Note how the first file looks misaligned.
>
> Thanks, but I'd prefer to keep the ls-lisp related stuff confined to
> ls-lisp.el. Is it possible to rewrite the patch such that dired.el
> code doesn't need to call ls-lisp functions directly (and thus the
> need for (featurep 'ls-lisp) etc. would be avoided)?
Thanks. Yes, that sounds better.
> Also, what exactly is the source of the differences between ls-lisp
> and the 'ls' command, and are you sure the differences aren't specific
> to GNU 'ls'?
I think II) above is not specific of ls-lisp: the same happen with
GNU ls.
With emacs -Q:
(let* ((dir (expand-file-name "src" source-directory))
(default-directory dir))
(dired (list dir "cygw32.c" "alloc.c" "w32xfns.c" "xdisp.c")) ; Wrong aligment.
;; Following just fix the first file, but xdisp.c keeps misaligned.
(dired-goto-file (expand-file-name "cygw32.c"))
(forward-line 0)
(let ((inhibit-read-only t))
(dired-align-file (point) (point-max))))
Note that when i eval the previous form GNU 'ls' is used, and i see misalignment.
I would expect `dired-align-file' fix this problem, but i doesn't.
*) Since this is not specific of `ls-lisp', one alternative fix could
be to run `dired-align-file' at the end of `dired-internal-noselect'
when `dired-directory' is a cons.
**) First, we must fix `dired-lign-file', which is not doing its job
in the snippet above.
This bug report was last modified 7 years and 329 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.