all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Michael Albinus <michael.albinus@gmx.de>
Cc: 29423@debbugs.gnu.org
Subject: bug#29423: 27.0.50; ls-lisp does not handle -F switch properly
Date: Sat, 25 Nov 2017 10:12:53 +0200	[thread overview]
Message-ID: <83fu9293p6.fsf@gnu.org> (raw)
In-Reply-To: <87d147ssj6.fsf@gmx.de> (message from Michael Albinus on Fri, 24 Nov 2017 14:41:33 +0100)

> From: Michael Albinus <michael.albinus@gmx.de>
> Cc: 29423@debbugs.gnu.org
> Date: Fri, 24 Nov 2017 14:41:33 +0100
> 
> Eli Zaretskii <eliz@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)





  parent reply	other threads:[~2017-11-25  8:12 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-24 12:45 bug#29423: 27.0.50; ls-lisp does not handle -F switch properly Michael Albinus
2017-11-24 13:37 ` Eli Zaretskii
2017-11-24 13:41   ` Michael Albinus
2017-11-24 14:56     ` Eli Zaretskii
2017-11-24 15:13       ` Michael Albinus
2017-11-24 15:47         ` Eli Zaretskii
2017-11-25  8:12     ` Eli Zaretskii [this message]
2017-11-25  8:59       ` Michael Albinus
2017-11-25 10:37         ` Eli Zaretskii
2017-11-24 16:30 ` Drew Adams
2017-11-24 16:56   ` Michael Albinus
2017-11-24 17:12     ` Drew Adams
2017-11-24 18:48       ` Michael Albinus
2017-11-24 19:28         ` Drew Adams
2017-11-24 19:51           ` Noam Postavsky
2017-11-24 20:27             ` Drew Adams
2017-11-24 20:37               ` Noam Postavsky
2017-11-24 20:51                 ` Drew Adams
2017-11-24 17:02   ` Eli Zaretskii
2017-11-24 18:49     ` Michael Albinus
2017-11-24 19:52       ` Eli Zaretskii
2017-11-24 21:03         ` Michael Albinus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83fu9293p6.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=29423@debbugs.gnu.org \
    --cc=michael.albinus@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.