Fix for dired in TRAMP: in Cygwin I rely on external ls by setting
authorOleksandr Gavenko <gavenkoa@gmail.com>
Wed, 04 Aug 2021 16:37:20 +0300
changeset 1742 50d48406e1ba
parent 1741 363696dc8d3c
child 1743 6d1553307bc6
Fix for dired in TRAMP: in Cygwin I rely on external ls by setting ls-lisp-use-insert-directory-program to "t" (so Emacs won't crash when access P9 mounted WSL paths). Seems some switches broke TRAMP.
.emacs-my
--- a/.emacs-my	Wed Jul 21 16:45:21 2021 +0300
+++ b/.emacs-my	Wed Aug 04 16:37:20 2021 +0300
@@ -1480,6 +1480,13 @@
       '("%Y-%m-%d %H:%M:%S"
         "%Y-%m-%d %H:%M   "))
 
+(defun my-dired-remote-fix ()
+  (when (file-remote-p dired-directory)
+    (setq-local ls-lisp-use-insert-directory-program nil)
+    (setq-local dired-actual-switches "-alhB")
+    ))
+(add-hook 'dired-mode-hook #'my-dired-remote-fix)
+
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 (message "compression, archive")