summaryrefslogtreecommitdiff
path: root/lisp/ls-lisp.el
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2017-11-25 12:35:09 +0200
committerEli Zaretskii <eliz@gnu.org>2017-11-25 12:35:09 +0200
commit23bfc2d2dbc4f12efbd19f6deed1e8f25f5151e6 (patch)
tree4ac7d9dc26c22078e725b0410d9b89c1a4c71871 /lisp/ls-lisp.el
parentf7fdaea4c0a2f4285d974a2870c4f6b465b40500 (diff)
downloademacs-23bfc2d2dbc4f12efbd19f6deed1e8f25f5151e6.tar.gz
Make sure 'dired-filename' property is always put by ls-lisp
* lisp/ls-lisp.el (ls-lisp-classify): Do not put the 'dired-filename' text property on the file name here... (ls-lisp-classify-file): ...put it here instead. (Bug#29423)
Diffstat (limited to 'lisp/ls-lisp.el')
-rw-r--r--lisp/ls-lisp.el16
1 files changed, 9 insertions, 7 deletions
diff --git a/lisp/ls-lisp.el b/lisp/ls-lisp.el
index caddc7f760b..cf3bff5c482 100644
--- a/lisp/ls-lisp.el
+++ b/lisp/ls-lisp.el
@@ -713,23 +713,26 @@ SWITCHES is a list of characters. Default sorting is alphabetic."
(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 @@ links, `|' for FIFOs, `=' for sockets, `*' for regular files that
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)