From bd6405673e721a6c1c771198a97e766db093d396 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sun, 3 May 2020 13:18:31 -0400 Subject: [PATCH] Fix #1703: dired listing no files over tramp ...on systems that don't have GNU ls installed and don't support --group-directories-first --- modules/emacs/dired/config.el | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) mode change 100755 => 100644 modules/emacs/dired/config.el diff --git a/modules/emacs/dired/config.el b/modules/emacs/dired/config.el old mode 100755 new mode 100644 index 56fac7351..3da7048bd --- a/modules/emacs/dired/config.el +++ b/modules/emacs/dired/config.el @@ -31,20 +31,16 @@ (setq insert-directory-program gls) ;; BSD ls doesn't support --group-directories-first (setq args (delete "--group-directories-first" args)))) - (setq dired-listing-switches (string-join args " "))) + (setq dired-listing-switches (string-join args " ")) - (add-hook! 'dired-mode-hook - (defun +dired-disable-gnu-ls-flags-in-tramp-buffers-h () - "Fix #1703: dired over TRAMP displays a blank screen. + (add-hook! 'dired-mode-hook + (defun +dired-disable-gnu-ls-flags-in-tramp-buffers-h () + "Fix #1703: dired over TRAMP displays a blank screen. This is because there's no guarantee the remote system has GNU ls, which is the only variant that supports --group-directories-first." - (when (file-remote-p default-directory) - (setq-local dired-listing-switches - (string-join - (split-string dired-listing-switches - "--group-directories-first") - " "))))) + (when (file-remote-p default-directory) + (setq-local dired-listing-switches (car args)))))) ;; Don't complain about this command being disabled when we use it (put 'dired-find-alternate-file 'disabled nil)