aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2017-11-25 12:35:09 +0200
committerEli Zaretskii2017-11-25 12:35:09 +0200
commit23bfc2d2dbc4f12efbd19f6deed1e8f25f5151e6 (patch)
tree4ac7d9dc26c22078e725b0410d9b89c1a4c71871
parentf7fdaea4c0a2f4285d974a2870c4f6b465b40500 (diff)
downloademacs-23bfc2d2dbc4f12efbd19f6deed1e8f25f5151e6.tar.gz
emacs-23bfc2d2dbc4f12efbd19f6deed1e8f25f5151e6.zip
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)
-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."
713(defun ls-lisp-classify-file (filename fattr) 713(defun ls-lisp-classify-file (filename fattr)
714 "Append a character to FILENAME indicating the file type. 714 "Append a character to FILENAME indicating the file type.
715 715
716This function puts the `dired-filename' property on FILENAME, but
717not on the character indicator it appends.
716FATTR is the file attributes returned by `file-attributes' for the file. 718FATTR is the file attributes returned by `file-attributes' for the file.
717The file type indicators are `/' for directories, `@' for symbolic 719The file type indicators are `/' for directories, `@' for symbolic
718links, `|' for FIFOs, `=' for sockets, `*' for regular files that 720links, `|' for FIFOs, `=' for sockets, `*' for regular files that
719are executable, and nothing for other types of files." 721are executable, and nothing for other types of files."
720 (let* ((type (car fattr)) 722 (let* ((type (car fattr))
721 (modestr (nth 8 fattr)) 723 (modestr (nth 8 fattr))
722 (typestr (substring modestr 0 1))) 724 (typestr (substring modestr 0 1))
725 (file-name (propertize filename 'dired-filename t)))
723 (cond 726 (cond
724 (type 727 (type
725 (concat filename (if (eq type t) "/" "@"))) 728 (concat file-name (if (eq type t) "/" "@")))
726 ((string-match "x" modestr) 729 ((string-match "x" modestr)
727 (concat filename "*")) 730 (concat file-name "*"))
728 ((string= "p" typestr) 731 ((string= "p" typestr)
729 (concat filename "|")) 732 (concat file-name "|"))
730 ((string= "s" typestr) 733 ((string= "s" typestr)
731 (concat filename "=")) 734 (concat file-name "="))
732 (t filename)))) 735 (t file-name))))
733 736
734(defun ls-lisp-classify (filedata) 737(defun ls-lisp-classify (filedata)
735 "Append a character to file name in FILEDATA indicating the file type. 738 "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
742are executable, and nothing for other types of files." 745are executable, and nothing for other types of files."
743 (let ((file-name (car filedata)) 746 (let ((file-name (car filedata))
744 (fattr (cdr filedata))) 747 (fattr (cdr filedata)))
745 (setq file-name (propertize file-name 'dired-filename t))
746 (cons (ls-lisp-classify-file file-name fattr) fattr))) 748 (cons (ls-lisp-classify-file file-name fattr) fattr)))
747 749
748(defun ls-lisp-extension (filename) 750(defun ls-lisp-extension (filename)