GNU bug report logs - #27843
26.0.50; Dired w/ eshell insert subdirs content when dir-or-list is a cons

Previous Next

Package: emacs;

Reported by: Tino Calancha <tino.calancha <at> gmail.com>

Date: Thu, 27 Jul 2017 03:20:01 UTC

Severity: minor

Found in version 26.0.50

Done: Tino Calancha <tino.calancha <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 27843 in the body.
You can then email your comments to 27843 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#27843; Package emacs. (Thu, 27 Jul 2017 03:20:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Tino Calancha <tino.calancha <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 27 Jul 2017 03:20:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Tino Calancha <tino.calancha <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 26.0.50;
 Dired w/ eshell insert subdirs content when dir-or-list is a cons
Date: Thu, 27 Jul 2017 12:19:08 +0900
emacs -r -Q -l ls-lisp -eval "(setq ls-lisp-use-insert-directory-program t)"
;; Following form must lists just 2 entries in Dired:
M-: (dired (list source-directory "README" "lisp")) RET

;; In fact, it inserts the full content of subdir "lisp".

--8<-----------------------------cut here---------------start------------->8---
commit 6216ea9470feabf22333988f02203334fcfd2e26
Author: Tino Calancha <tino.calancha <at> gmail.com>
Date:   Thu Jul 27 12:09:00 2017 +0900

    Dired w/ eshell: Don't insert subdirs content if dir-or-list is a cons
    
    * lisp/eshell/em-ls.el (eshell-ls--insert-directory):
    Append '("-d") into 'eshell-ls-dired-initial-args'
    when 'dired-directory' is a cons (Bug#27843).
    * test/lisp/dired-tests.el (dired-test-bug27843): Add test.

diff --git a/lisp/eshell/em-ls.el b/lisp/eshell/em-ls.el
index 79799db30b..367ec69489 100644
--- a/lisp/eshell/em-ls.el
+++ b/lisp/eshell/em-ls.el
@@ -276,8 +276,10 @@ eshell-ls--insert-directory
           (let ((insert-func 'insert)
                 (error-func 'insert)
                 (flush-func 'ignore)
-                eshell-ls-dired-initial-args)
-            (eshell-do-ls (append switches (list file)))))))))
+                (switches (append eshell-ls-dired-initial-args
+                                  (and (consp dired-directory) (list "-d"))
+                                  switches)))
+            (eshell-do-ls (nconc switches (list file)))))))))
 
 (defsubst eshell/ls (&rest args)
   "An alias version of `eshell-do-ls'."
diff --git a/test/lisp/dired-tests.el b/test/lisp/dired-tests.el
index 601d65768b..63b1e45e1f 100644
--- a/test/lisp/dired-tests.el
+++ b/test/lisp/dired-tests.el
@@ -188,5 +188,20 @@
       (customize-set-variable 'eshell-ls-use-in-dired orig)
       (and (buffer-live-p buf) (kill-buffer)))))
 
+(ert-deftest dired-test-bug27843 ()
+  "Test for http://debbugs.gnu.org/27843 ."
+  (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)
+          (setq buf (dired (list source-directory "lisp")))
+          (dired-toggle-marks)
+          (should-not (cdr (dired-get-marked-files))))
+      (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-26
Repository revision: e1e8d2e229f48b3cee765f7cf27ae04ee4401d85





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#27843; Package emacs. (Thu, 27 Jul 2017 09:28:02 GMT) Full text and rfc822 format available.

Message #8 received at 27843 <at> debbugs.gnu.org (full text, mbox):

From: Tino Calancha <tino.calancha <at> gmail.com>
To: 27843 <at> debbugs.gnu.org
Subject: Re: bug#27843: 26.0.50;
 Dired w/ eshell insert subdirs content when dir-or-list is a cons
Date: Thu, 27 Jul 2017 18:26:53 +0900
Tino Calancha <tino.calancha <at> gmail.com> writes:

> @@ -276,8 +276,10 @@ eshell-ls--insert-directory
>            (let ((insert-func 'insert)
>                  (error-func 'insert)
>                  (flush-func 'ignore)
> -                eshell-ls-dired-initial-args)
> -            (eshell-do-ls (append switches (list file)))))))))
> +                (switches (append eshell-ls-dired-initial-args
> +                                  (and (consp dired-directory) (list "-d"))
> +                                  switches)))
> +            (eshell-do-ls (nconc switches (list file)))))))))
Not just when dired-directory is a cons, _also_ if WILDCARD is non-nil
we must just list the directory entry.

--8<-----------------------------cut here---------------start------------->8---
commit 2fd058081bac06744ee38acdd209a3fce4405131
Author: Tino Calancha <tino.calancha <at> gmail.com>
Date:   Thu Jul 27 18:12:46 2017 +0900

    Dired w/ eshell: Don't insert subdirs content if dir-or-list is a cons
    
    * lisp/eshell/em-ls.el (eshell-ls--insert-directory):
    Append '("-d") into 'eshell-ls-dired-initial-args'
    when 'dired-directory' is a cons (Bug#27843).
    * test/lisp/dired-tests.el (dired-test-bug27843): Add test.

diff --git a/lisp/eshell/em-ls.el b/lisp/eshell/em-ls.el
index 79799db30b..5926969b09 100644
--- a/lisp/eshell/em-ls.el
+++ b/lisp/eshell/em-ls.el
@@ -276,8 +276,10 @@ eshell-ls--insert-directory
           (let ((insert-func 'insert)
                 (error-func 'insert)
                 (flush-func 'ignore)
-                eshell-ls-dired-initial-args)
-            (eshell-do-ls (append switches (list file)))))))))
+                (switches (append eshell-ls-dired-initial-args
+                                  (and (or (consp dired-directory) wildcard) (list "-d"))
+                                  switches)))
+            (eshell-do-ls (nconc switches (list file)))))))))
 
 (defsubst eshell/ls (&rest args)
   "An alias version of `eshell-do-ls'."

--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-26
Repository revision: 28faa94f1c423091bb34c2776eabe9ae83e5b4fc




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#27843; Package emacs. (Sat, 29 Jul 2017 09:05:02 GMT) Full text and rfc822 format available.

Message #11 received at 27843 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Tino Calancha <tino.calancha <at> gmail.com>
Cc: 27843 <at> debbugs.gnu.org
Subject: Re: bug#27843: 26.0.50;
 Dired w/ eshell insert subdirs content when dir-or-list is a cons
Date: Sat, 29 Jul 2017 12:04:17 +0300
> From: Tino Calancha <tino.calancha <at> gmail.com>
> Date: Thu, 27 Jul 2017 12:19:08 +0900
> 
> emacs -r -Q -l ls-lisp -eval "(setq ls-lisp-use-insert-directory-program t)"
> ;; Following form must lists just 2 entries in Dired:
> M-: (dired (list source-directory "README" "lisp")) RET
> 
> ;; In fact, it inserts the full content of subdir "lisp".
> 
> --8<-----------------------------cut here---------------start------------->8---
> commit 6216ea9470feabf22333988f02203334fcfd2e26
> Author: Tino Calancha <tino.calancha <at> gmail.com>
> Date:   Thu Jul 27 12:09:00 2017 +0900
> 
>     Dired w/ eshell: Don't insert subdirs content if dir-or-list is a cons
>     
>     * lisp/eshell/em-ls.el (eshell-ls--insert-directory):
>     Append '("-d") into 'eshell-ls-dired-initial-args'
>     when 'dired-directory' is a cons (Bug#27843).
>     * test/lisp/dired-tests.el (dired-test-bug27843): Add test.

This LGTM, but please rephrase the log summary line to be positive,
not negative.

Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#27843; Package emacs. (Sat, 29 Jul 2017 09:08:02 GMT) Full text and rfc822 format available.

Message #14 received at 27843 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Tino Calancha <tino.calancha <at> gmail.com>
Cc: 27843 <at> debbugs.gnu.org
Subject: Re: bug#27843: 26.0.50;
 Dired w/ eshell insert subdirs content when dir-or-list is a cons
Date: Sat, 29 Jul 2017 12:07:35 +0300
> From: Tino Calancha <tino.calancha <at> gmail.com>
> Date: Thu, 27 Jul 2017 18:26:53 +0900
> 
> Tino Calancha <tino.calancha <at> gmail.com> writes:
> 
> > @@ -276,8 +276,10 @@ eshell-ls--insert-directory
> >            (let ((insert-func 'insert)
> >                  (error-func 'insert)
> >                  (flush-func 'ignore)
> > -                eshell-ls-dired-initial-args)
> > -            (eshell-do-ls (append switches (list file)))))))))
> > +                (switches (append eshell-ls-dired-initial-args
> > +                                  (and (consp dired-directory) (list "-d"))
> > +                                  switches)))
> > +            (eshell-do-ls (nconc switches (list file)))))))))
> Not just when dired-directory is a cons, _also_ if WILDCARD is non-nil
> we must just list the directory entry.

OK, thanks.




Reply sent to Tino Calancha <tino.calancha <at> gmail.com>:
You have taken responsibility. (Tue, 01 Aug 2017 14:35:01 GMT) Full text and rfc822 format available.

Notification sent to Tino Calancha <tino.calancha <at> gmail.com>:
bug acknowledged by developer. (Tue, 01 Aug 2017 14:35:02 GMT) Full text and rfc822 format available.

Message #19 received at 27843-done <at> debbugs.gnu.org (full text, mbox):

From: Tino Calancha <tino.calancha <at> gmail.com>
To: 27843-done <at> debbugs.gnu.org
Subject: Re: bug#27843: 26.0.50;
 Dired w/ eshell insert subdirs content when dir-or-list is a cons
Date: Tue, 01 Aug 2017 23:34:29 +0900
Eli Zaretskii <eliz <at> gnu.org> writes:

>>     Dired w/ eshell: Don't insert subdirs content if dir-or-list is a cons
>>     
>>     * lisp/eshell/em-ls.el (eshell-ls--insert-directory):
>>     Append '("-d") into 'eshell-ls-dired-initial-args'
>>     when 'dired-directory' is a cons (Bug#27843).
>>     * test/lisp/dired-tests.el (dired-test-bug27843): Add test.
>
> This LGTM, but please rephrase the log summary line to be positive,
> not negative.
Rephrased log summary as
"Insert subdir content if dir-or-list is a string w/o wildcards"
and pushed to master as commit f3ad15933a0d104b099d640d5c43fce99ece0003




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 30 Aug 2017 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 7 years and 91 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.