emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 9c01da56a54: Fix use of "dired" in Tramp


From: Michael Albinus
Subject: master 9c01da56a54: Fix use of "dired" in Tramp
Date: Sun, 21 Apr 2024 06:54:41 -0400 (EDT)

branch: master
commit 9c01da56a547f493535e73877e16ccefcb2730a0
Author: Michael Albinus <michael.albinus@gmx.de>
Commit: Michael Albinus <michael.albinus@gmx.de>

    Fix use of "dired" in Tramp
    
    * lisp/net/tramp-sh.el (tramp-sh-handle-insert-directory): Do not
    use "--dired" when long format output isn't requested.
---
 lisp/net/tramp-sh.el | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index 66e648624b2..60478707c2d 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -2653,6 +2653,18 @@ The method used must be an out-of-band method."
       (let ((dired (tramp-get-ls-command-with v "--dired")))
        (when (stringp switches)
           (setq switches (split-string switches)))
+        ;; Newer coreutil versions of ls (9.5 and up) imply long format
+        ;; output when "--dired" is given.  Suppress this implicit rule.
+        (when dired
+          (let ((tem switches)
+                case-fold-search)
+            (catch 'long
+              (while tem
+                (when (and (not (string-match-p "--" (car tem)))
+                           (string-match-p "l" (car tem)))
+                  (throw 'long nil))
+                (setq tem (cdr tem)))
+              (setq dired nil))))
        (setq switches
              (append switches (split-string (tramp-sh--quoting-style-options 
v))
                      (when dired `(,dired))))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]