From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Tino Calancha Newsgroups: gmane.emacs.bugs Subject: 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 Message-ID: <87eft2ut5u.fsf@calancha-pc> References: <87bmo6sh1v.fsf@calancha-pc> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1501147701 938 195.159.176.226 (27 Jul 2017 09:28:21 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 27 Jul 2017 09:28:21 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) To: 27843@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Jul 27 11:28:12 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1daf5U-00084Z-5I for geb-bug-gnu-emacs@m.gmane.org; Thu, 27 Jul 2017 11:28:08 +0200 Original-Received: from localhost ([::1]:41972 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1daf5Z-0005FB-O9 for geb-bug-gnu-emacs@m.gmane.org; Thu, 27 Jul 2017 05:28:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47451) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1daf5T-0005Eu-UM for bug-gnu-emacs@gnu.org; Thu, 27 Jul 2017 05:28:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1daf5P-00087I-0X for bug-gnu-emacs@gnu.org; Thu, 27 Jul 2017 05:28:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:55231) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1daf5O-00087D-TS for bug-gnu-emacs@gnu.org; Thu, 27 Jul 2017 05:28:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1daf5O-000312-GM for bug-gnu-emacs@gnu.org; Thu, 27 Jul 2017 05:28:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Tino Calancha Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 27 Jul 2017 09:28:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 27843 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 27843-submit@debbugs.gnu.org id=B27843.150114762411527 (code B ref 27843); Thu, 27 Jul 2017 09:28:02 +0000 Original-Received: (at 27843) by debbugs.gnu.org; 27 Jul 2017 09:27:04 +0000 Original-Received: from localhost ([127.0.0.1]:57908 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1daf4S-0002zr-KE for submit@debbugs.gnu.org; Thu, 27 Jul 2017 05:27:04 -0400 Original-Received: from mail-pg0-f53.google.com ([74.125.83.53]:36203) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1daf4Q-0002zL-Ke for 27843@debbugs.gnu.org; Thu, 27 Jul 2017 05:27:02 -0400 Original-Received: by mail-pg0-f53.google.com with SMTP id 125so95752963pgi.3 for <27843@debbugs.gnu.org>; Thu, 27 Jul 2017 02:27:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:references:date:in-reply-to:message-id:user-agent :mime-version; bh=c4N1Od0nC6ZJM1Aeqzt2ghS66DNESzTHKCvOjdSA80k=; b=daWJ1w1V0vT7ML1wK8VV02s/3CKdGFMGzjES6ePHxE95s3QX8jyvcvT7mQyU0RrbGl EjM6BpWGE2wAlklqD5fZYn7rozAwrF7ZIPXn/3bfy1vLezzqJd6lAvlBVMCM6ljSgyIq 85+yPBGl29R4kz00hnzyJEGrP5mV17F1Q2A7ocbdzIr6UImA8Wc6znbgT7KauMG1S60s WS7dMjfLJ93DfFL7cG0dGolZFe9JDcH/ULW2xyFnjScnxjLAKZUcP/fmfSj8akJkdpme ANDDrxvwkFqCqR/hufT02lzpH8JjtbSq5X9plc1GuTnGZpjqylGNvpo+xXNm934OmD7f S8DA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=c4N1Od0nC6ZJM1Aeqzt2ghS66DNESzTHKCvOjdSA80k=; b=rB6iQ7SdU8HCqnrCkGShc/4xphAlh9Lhi7DcFQodaqfnx+oQUi1pVoTRl7eHDRdLYT PQUBeqn4Jny25DZEY2hw7CwVASFK7fY2toxCWtF1d8+nKS51oNC2VawAMepUgZYs444z /+djryIk0VWosD983xsNl0117xLHcoqw7+UifJwnedOzErCXa/MYB7fVLifZEuqYohxD 9Bo9lX3dIaUdzax8OQYoxaU4A3KWNPsxk7CTzKTA6Jm8OA3ARFHdv48biEbS8wKZwp8K FH2cRrmYvDzVWkx80F/SDSetANeKL6tAT0mxn1n+FDVImA07YFjL+SDNealbxBjlhySm RUlQ== X-Gm-Message-State: AIVw110CtEhCaKbgVGgexhb+QwxJpAEKX13+ZQ9Dvi9H+k+iyy6YFDOS ny0BeFjtTOV6Ak1C X-Received: by 10.98.80.89 with SMTP id e86mr3458565pfb.195.1501147616704; Thu, 27 Jul 2017 02:26:56 -0700 (PDT) Original-Received: from calancha-pc ([240f:6e:fb29:1:9ee6:2511:da80:1c7e]) by smtp.gmail.com with ESMTPSA id f74sm20398140pfk.131.2017.07.27.02.26.55 for <27843@debbugs.gnu.org> (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 27 Jul 2017 02:26:56 -0700 (PDT) In-Reply-To: <87bmo6sh1v.fsf@calancha-pc> (Tino Calancha's message of "Thu, 27 Jul 2017 12:19:08 +0900") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:135044 Archived-At: Tino Calancha 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 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