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#27631: dired a/*/b Date: Thu, 3 Aug 2017 13:38:37 +0900 (JST) Message-ID: References: <87o9sth2oi.fsf@jidanni.org> <8737a0yjbg.fsf@calancha-pc> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset=US-ASCII X-Trace: blaine.gmane.org 1501735163 2931 195.159.176.226 (3 Aug 2017 04:39:23 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 3 Aug 2017 04:39:23 +0000 (UTC) User-Agent: Alpine 2.20 (DEB 67 2015-01-07) Cc: 27631@debbugs.gnu.org, Tino Calancha , Michael Albinus , =?UTF-8?Q?=E7=A9=8D=E4=B8=B9=E5=B0=BC?= Dan Jacobson To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Aug 03 06:39:16 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 1dd7ui-0008Vi-Ep for geb-bug-gnu-emacs@m.gmane.org; Thu, 03 Aug 2017 06:39:12 +0200 Original-Received: from localhost ([::1]:35814 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dd7ul-00038D-Ae for geb-bug-gnu-emacs@m.gmane.org; Thu, 03 Aug 2017 00:39:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58154) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dd7ub-00036T-K1 for bug-gnu-emacs@gnu.org; Thu, 03 Aug 2017 00:39:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dd7uY-0004eD-Gg for bug-gnu-emacs@gnu.org; Thu, 03 Aug 2017 00:39:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:36537) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dd7uY-0004e4-Ce for bug-gnu-emacs@gnu.org; Thu, 03 Aug 2017 00:39:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dd7uX-0000FM-VY for bug-gnu-emacs@gnu.org; Thu, 03 Aug 2017 00:39:01 -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, 03 Aug 2017 04:39:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 27631 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 27631-submit@debbugs.gnu.org id=B27631.1501735129929 (code B ref 27631); Thu, 03 Aug 2017 04:39:01 +0000 Original-Received: (at 27631) by debbugs.gnu.org; 3 Aug 2017 04:38:49 +0000 Original-Received: from localhost ([127.0.0.1]:39214 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dd7uL-0000Eu-KP for submit@debbugs.gnu.org; Thu, 03 Aug 2017 00:38:49 -0400 Original-Received: from mail-pf0-f194.google.com ([209.85.192.194]:38464) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dd7uJ-0000Eh-JF for 27631@debbugs.gnu.org; Thu, 03 Aug 2017 00:38:47 -0400 Original-Received: by mail-pf0-f194.google.com with SMTP id e3so401577pfc.5 for <27631@debbugs.gnu.org>; Wed, 02 Aug 2017 21:38:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:date:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=/ZfC49Y3pdMe7h6m5KCaARyQcW5cq/O4OELEnCE+JkA=; b=Hveb8Fk0AZu4xM9QridFtG6gEOSyKpEi8/EmgJkia+KOWsPXlhgigxsqv7vRASR6KR uUjkhapMgliqewaEF125ErSsOlC56gKKUc2nowG29mT+MFlKmJA1Mi1VthIaSZMrTIEG Ir8FMiwgeqYe4Jm1atrRQBAwNBsN8EHqQuUbg8VDb+WrdGQnxaVXBW668dRl2trCJcLF 7EzkUHvS0sxlEk8l0BUthE2+YnVCVXcKsgJhwF82VRhv+IhfKkFs/1EvwAPyqVMZiGXO l3hT3vur5SJQGJ82rXeiIYcpOSumEPyvwxTy5+niXRh4lyZUCgdna+eP7CcgbRKnr4Gn 8A9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=/ZfC49Y3pdMe7h6m5KCaARyQcW5cq/O4OELEnCE+JkA=; b=rZO1fQ8d5wu2bCoORyUtGDOY06mQDSIy4Zz9CpQtW1G1oaVSVJiPH5oaNyU+4Ettnw tBwYl2b8T8W6ppCXNVJY13bIp8HDYgheMTh12cCVCdY+eHIngVxXzr90n5sTSJ/8vD6x Qg4OXqbwWR+7JFFwCUK4/N1wejUHfyR1k7Xi/nvrzG0aO6UwrCvf0RudsoQzMQJ5y1od nBoSC2+E8wbbvsh+lItAojZKG4s0nOdRs/prbQty4hxE88mkUxmMRco3dPBEF7LmTO/A 31VVMnE6cmT6Q5FnCViRcUDvpNqvRA18UGxWbQwTgY/rFJ2xOc0DOqd4N8cSyg04HhAM 47cw== X-Gm-Message-State: AIVw112ES/690gvgePhanBvPjfBIY3+L1sIbXE/8UhUrcu/oXXaI5Ez+ 2mng6dHI3HV36w== X-Received: by 10.84.232.15 with SMTP id h15mr437708plk.189.1501735121506; Wed, 02 Aug 2017 21:38:41 -0700 (PDT) Original-Received: from calancha-pc (170.224.128.101.dy.bbexcite.jp. [101.128.224.170]) by smtp.gmail.com with ESMTPSA id a16sm44395577pfe.161.2017.08.02.21.38.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 02 Aug 2017 21:38:40 -0700 (PDT) X-Google-Original-From: Tino Calancha X-X-Sender: calancha@calancha-pc In-Reply-To: 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:135266 Archived-At: On Wed, 2 Aug 2017, Stefan Monnier wrote: >>> Maybe make dired and list-directory deal with wildcards in positions like >>> ~/.config/chromium/Default/*/menkifleemblimdogmoihpfopnplikde/ >> Thank you for the report. >> IMO, this is a nice thing to have. >> It must be possible to extend the current code so that >> dired might handle wildcards in the directory part. > > I'm not sure the recent patch for this fix is the right approach. > The old code already used the shell to do the wildcard expansion, so why > not just adjust the old code. > > Here's some starting patch. Thank you for the patch. Part of the complexity of the original patch is to provide this new feature in _tramp_ connections as well; your patch does the thing well (see patch below) in the local machine but it fails in remote ones. --8<-----------------------------cut here---------------start------------->8--- commit 21f02469bf5ef3733e3705e9836a7d91f625ce11 Author: Tino Calancha Date: Thu Aug 3 13:20:40 2017 +0900 Apply some minor tweaks diff --git a/lisp/dired.el b/lisp/dired.el index 211b622fd9..7862d0405c 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -1100,7 +1100,7 @@ dired-readin-insert (while (not (file-directory-p dir)) (setq dir (directory-file-name dir)) (let ((n (file-name-nondirectory dir))) - (setq file-list (mapcar (lambda (f) (concat n "/" f)) file-list))) + (setq file-list (mapcar (lambda (f) (concat n (and (not (string= "" f)) "/") f)) file-list))) (setq dir (file-name-directory dir))) (setq default-directory dir)) (if (and (equal "" (file-name-nondirectory dir)) @@ -1258,6 +1258,8 @@ 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'. @@ -1335,9 +1337,7 @@ dired-insert-directory (setq content-point (point))) (when wildcard ;; Insert "wildcard" line where "total" line would be for a full dir. - (insert " wildcard " (or (cdr-safe (insert-directory-wildcard-in-dir-p dir)) - (file-name-nondirectory dir)) - "\n"))) + (insert " wildcard " (car-safe file-list) "\n"))) (dired-insert-set-properties content-point (point))))) (defun dired-insert-set-properties (beg end) --8<-----------------------------cut here---------------end--------------->8---