GNU bug report logs -
#29423
27.0.50; ls-lisp does not handle -F switch properly
Previous Next
Reported by: Michael Albinus <michael.albinus <at> gmx.de>
Date: Fri, 24 Nov 2017 12:47:01 UTC
Severity: minor
Tags: patch
Found in version 27.0.50
Done: Eli Zaretskii <eliz <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
> From: Michael Albinus <michael.albinus <at> gmx.de>
> Cc: 29423 <at> debbugs.gnu.org
> Date: Fri, 24 Nov 2017 14:41:33 +0100
>
> Eli Zaretskii <eliz <at> gnu.org> writes:
>
> > How come ls-lisp-classify doesn't propertize the file name in this
> > case?
>
> Because it wasn't called. ls-lisp-classify-file was called only, if I'm
> not mistaken.
Right, and so the correct fix is below, I think. Do you agree?
We can install this on the release branch, unless the original problem
with Tramp exists only on master. Let me know.
Thanks.
diff --git a/lisp/ls-lisp.el b/lisp/ls-lisp.el
index caddc7f..cf3bff5 100644
--- a/lisp/ls-lisp.el
+++ b/lisp/ls-lisp.el
@@ -713,23 +713,26 @@ ls-lisp-handle-switches
(defun ls-lisp-classify-file (filename fattr)
"Append a character to FILENAME indicating the file type.
+This function puts the `dired-filename' property on FILENAME, but
+not on the character indicator it appends.
FATTR is the file attributes returned by `file-attributes' for the file.
The file type indicators are `/' for directories, `@' for symbolic
links, `|' for FIFOs, `=' for sockets, `*' for regular files that
are executable, and nothing for other types of files."
(let* ((type (car fattr))
(modestr (nth 8 fattr))
- (typestr (substring modestr 0 1)))
+ (typestr (substring modestr 0 1))
+ (file-name (propertize filename 'dired-filename t)))
(cond
(type
- (concat filename (if (eq type t) "/" "@")))
+ (concat file-name (if (eq type t) "/" "@")))
((string-match "x" modestr)
- (concat filename "*"))
+ (concat file-name "*"))
((string= "p" typestr)
- (concat filename "|"))
+ (concat file-name "|"))
((string= "s" typestr)
- (concat filename "="))
- (t filename))))
+ (concat file-name "="))
+ (t file-name))))
(defun ls-lisp-classify (filedata)
"Append a character to file name in FILEDATA indicating the file type.
@@ -742,7 +745,6 @@ ls-lisp-classify
are executable, and nothing for other types of files."
(let ((file-name (car filedata))
(fattr (cdr filedata)))
- (setq file-name (propertize file-name 'dired-filename t))
(cons (ls-lisp-classify-file file-name fattr) fattr)))
(defun ls-lisp-extension (filename)
This bug report was last modified 7 years and 185 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.