]> git.eshelyaron.com Git - emacs.git/commitdiff
Dired: Support eshell-ls from the beginning if the user wants to
authorTino Calancha <tino.calancha@gmail.com>
Wed, 26 Jul 2017 07:42:30 +0000 (16:42 +0900)
committerTino Calancha <tino.calancha@gmail.com>
Wed, 26 Jul 2017 07:52:00 +0000 (16:52 +0900)
* lisp/dired.el (dired-insert-directory): Check for eshell-ls
as well (Bug#27817).
* test/lisp/dired-tests.el (dired-test-bug27817): Add test.

lisp/dired.el
test/lisp/dired-tests.el

index 9d500a9f52d36535250aa2a6092ef38af57f4c43..3b29c7129d424d6e7da3bc5fc92b2f3cea503a8c 100644 (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'.
index 69331457c0ee9c9c9648ad024241879b26773d79..601d65768bd0bf05a3a40ae55aacc0b6e61d0521 100644 (file)
           (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