unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Tino Calancha <tino.calancha@gmail.com>
To: 27817@debbugs.gnu.org
Subject: bug#27817: 26.0.50; Dired: Support eshell/ls from the beginning if user want to
Date: Tue, 25 Jul 2017 15:52:29 +0900	[thread overview]
Message-ID: <87shhlypn6.fsf@calancha-pc> (raw)


An user must be able to use Dired with eshell/ls at the
beginning even if s?he doesn't have installed an external
"ls" program.

I) emacs -Q -l em-ls
M-: (progn
      (setq insert-directory-program "foobar-ls"
            eshell-ls-use-in-dired t)
      (dired source-directory)) RET

;; We got an error because `insert-directory-program' was called.
;; Now compare with ls-lisp; in this case `insert-directory-program'
;; is not called.
II) emacs -Q -l ls-lisp
M-: (progn
      (setq insert-directory-program "foobar-ls"
            ls-lisp-use-insert-directory-program nil)
      (dired source-directory)) RET

--8<-----------------------------cut here---------------start------------->8---
commit 6322f2932e9a083e01bb86aa219fc8256443c33f
Author: Tino Calancha <tino.calancha@gmail.com>
Date:   Tue Jul 25 15:46:54 2017 +0900

    Dired: Support eshell/ls from the beginning if user want to
    
    * lisp/dired.el (dired-insert-directory): Check for em-ls as well.
    * test/lisp/dired-tests.el (dired-test-bug27817): Add test.

diff --git a/lisp/dired.el b/lisp/dired.el
index 9d500a9f52..3b29c7129d 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -1207,6 +1207,7 @@ dired-insert-directory
 	 ;; 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'.
diff --git a/test/lisp/dired-tests.el b/test/lisp/dired-tests.el
index 69331457c0..601d65768b 100644
--- a/test/lisp/dired-tests.el
+++ b/test/lisp/dired-tests.el
@@ -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

--8<-----------------------------cut here---------------end--------------->8---
In GNU Emacs 26.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.11)
 of 2017-07-25
Repository revision: 565cfd9f6c19e4d2aa318efdf19bdc56175bd153





             reply	other threads:[~2017-07-25  6:52 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-25  6:52 Tino Calancha [this message]
2017-07-25  7:00 ` bug#27817: 26.0.50; Dired: Support eshell/ls from the beginning if user want to Tino Calancha
2017-07-25 14:33 ` Eli Zaretskii
2017-07-25 14:38   ` Tino Calancha
2017-07-25 14:48     ` Noam Postavsky
2017-07-25 15:02       ` Eli Zaretskii
2017-07-25 15:09       ` Tino Calancha
2017-07-25 15:27         ` Noam Postavsky
2017-07-25 15:34           ` Tino Calancha
2017-07-25 14:48     ` Eli Zaretskii
2017-07-26  7:57   ` Tino Calancha

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87shhlypn6.fsf@calancha-pc \
    --to=tino.calancha@gmail.com \
    --cc=27817@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).