emacs-diffs
[Top][All Lists]
Advanced

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

master 778a1ee35b4: Fix dired and tramp where `ls` does not have the `-N


From: Mattias Engdegård
Subject: master 778a1ee35b4: Fix dired and tramp where `ls` does not have the `-N` option
Date: Fri, 5 May 2023 13:25:57 -0400 (EDT)

branch: master
commit 778a1ee35b46017ab06c13c8a29f054533bc952b
Author: Mattias Engdegård <mattiase@acm.org>
Commit: Mattias Engdegård <mattiase@acm.org>

    Fix dired and tramp where `ls` does not have the `-N` option
    
    This includes BSD ls, also used by macOS (bug#63142).
    
    * lisp/dired.el (dired-insert-directory):
    * lisp/net/tramp-sh.el (tramp-sh-handle-insert-directory):
    Test whether -N is understood by ls since that option is used along
    with --dired.  Remove -N when we remove --dired.
---
 lisp/dired.el        | 6 +++---
 lisp/net/tramp-sh.el | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/lisp/dired.el b/lisp/dired.el
index 1c8d011d765..e70467ca53b 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -1647,9 +1647,9 @@ If HDR is non-nil, insert a header line with the 
directory name."
                 ;; save the answer in `dired-use-ls-dired'.
                 (or (setq dired-use-ls-dired
                           (eq 0 (call-process insert-directory-program
-                                               nil nil nil "--dired")))
+                                               nil nil nil "--dired" "-N")))
                     (progn
-                      (message "ls does not support --dired; \
+                      (message "ls does not support --dired -N; \
 see `dired-use-ls-dired' for more details.")
                       nil))
               dired-use-ls-dired)))
@@ -1665,7 +1665,7 @@ see `dired-use-ls-dired' for more details.")
              ;; "--dired", so we cannot add it to the `process-file'
              ;; call for wildcards.
              (when (file-remote-p dir)
-               (setq switches (string-replace "--dired" "" switches)))
+               (setq switches (string-replace "--dired -N" "" switches)))
              (let* ((default-directory (car dir-wildcard))
                     (script (format "ls %s %s" switches (cdr dir-wildcard)))
                     (remotep (file-remote-p dir))
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index 94fbc588b5d..d020615af07 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -2566,7 +2566,7 @@ The method used must be an out-of-band method."
       (setq switches
            (append switches (split-string (tramp-sh--quoting-style-options 
v))))
       (unless (tramp-get-ls-command-with v "--dired")
-       (setq switches (delete "--dired" switches)))
+       (setq switches (delete "-N" (delete "--dired" switches))))
       (when wildcard
         (setq wildcard (tramp-run-real-handler
                        #'file-name-nondirectory (list localname)))



reply via email to

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