1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-04-28 01:00:52 -07:00

Dired: Support eshell-ls from the beginning if the user wants to

* lisp/dired.el (dired-insert-directory): Check for eshell-ls
as well (Bug#27817).
* test/lisp/dired-tests.el (dired-test-bug27817): Add test.
This commit is contained in:
Tino Calancha 2017-07-26 16:42:30 +09:00
parent 4d30cf6be2
commit d5c41e99a2
2 changed files with 14 additions and 0 deletions

View file

@ -1207,6 +1207,7 @@ If HDR is non-nil, insert a header line with the directory name."
;; as indicated by `ls-lisp-use-insert-directory-program'.
(not (and (featurep 'ls-lisp)
(null ls-lisp-use-insert-directory-program)))
(not (and (featurep 'eshell) (bound-and-true-p eshell-ls-use-in-dired)))
(or (if (eq dired-use-ls-dired 'unspecified)
;; Check whether "ls --dired" gives exit code 0, and
;; save the answer in `dired-use-ls-dired'.

View file

@ -175,5 +175,18 @@
(should (looking-at "src")))
(when (buffer-live-p buf) (kill-buffer buf)))))
(ert-deftest dired-test-bug27817 ()
"Test for http://debbugs.gnu.org/27817 ."
(require 'em-ls)
(let ((orig eshell-ls-use-in-dired)
(dired-use-ls-dired 'unspecified)
buf insert-directory-program)
(unwind-protect
(progn
(customize-set-variable 'eshell-ls-use-in-dired t)
(should (setq buf (dired source-directory))))
(customize-set-variable 'eshell-ls-use-in-dired orig)
(and (buffer-live-p buf) (kill-buffer)))))
(provide 'dired-tests)
;; dired-tests.el ends here