[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#27801: 26.0.50; Dired: Use relative file names when DIR-OR-LIST is a
bug#27801: 26.0.50; Dired: Use relative file names when DIR-OR-LIST is a cons
Mon, 24 Jul 2017 13:16:40 +0900 (JST)
Alpine 2.20 (DEB 67 2015-01-07)
On Sun, 23 Jul 2017, Drew Adams wrote:
;; Following form shows the full file name in the Dired buffer.
(let* ((dir source-directory)
(file1 (expand-file-name "lisp/subr.el" dir))
(file2 (expand-file-name "src/data.c" dir)))
(dired (list dir file1 file2)))
;; Usually, Dired just shows the relative file name to
;; 'default-directory'. That is more clear, specially for
;; long file names.
Sorry, but I've only read this bug report quickly - no time now.
If you are suggesting that when DIR-OR-LIST is a cons the
file names shown should be relative then I think I disagree
The typical use case for a cons DIR-OR-LIST is a list
of files from anywhere, in which case absolute file
names are appropriate.
I am OK with adding a new variable `foo' so that i can get
this behavior if i locally bind `foo' to a non-nil value.
This idea comes while i am trying to implement Bug#27631; to
have this feature working with 'ls-lisp' my implementation
do something like:
1) Collect all matches with `find-lisp' in a variable FILES.
(This is just a first approach to the problem; for large
number of matches would be better to not store the matches
in a list).
2) [Suppose DIR is the default-directory i the Dired buffer]
(dired (list DIR FILES))
;; My implementation works as with GNU ls; the only difference is
;; that 2) shows full file names in the Dired buffer. I rather
;; prefer is the output has same format regarless on if the user
;; use `ls-lisp' or not.
With the var `foo' mentioned above, we could change 2) with:
(let ((foo t))
(dired (list DIR FILES)))