From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#27631: dired a/*/b Date: Fri, 14 Jul 2017 11:40:49 +0300 Message-ID: <83y3rrfm26.fsf@gnu.org> References: <87o9sth2oi.fsf@jidanni.org> <877ezcxtd3.fsf@calancha-pc> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1500022157 17825 195.159.176.226 (14 Jul 2017 08:49:17 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 14 Jul 2017 08:49:17 +0000 (UTC) Cc: 27631@debbugs.gnu.org, michael.albinus@gmx.de To: Tino Calancha Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jul 14 10:49:13 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 1dVwHa-00041g-3H for geb-bug-gnu-emacs@m.gmane.org; Fri, 14 Jul 2017 10:49:06 +0200 Original-Received: from localhost ([::1]:36283 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVwHf-0000mA-FD for geb-bug-gnu-emacs@m.gmane.org; Fri, 14 Jul 2017 04:49:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47760) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVw9m-0001IN-Vb for bug-gnu-emacs@gnu.org; Fri, 14 Jul 2017 04:41:03 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dVw9m-00032Z-3n for bug-gnu-emacs@gnu.org; Fri, 14 Jul 2017 04:41:02 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:35036) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dVw9m-00032P-0k for bug-gnu-emacs@gnu.org; Fri, 14 Jul 2017 04:41:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dVw9l-0008P6-NG for bug-gnu-emacs@gnu.org; Fri, 14 Jul 2017 04:41:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 14 Jul 2017 08:41: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.150002166032290 (code B ref 27631); Fri, 14 Jul 2017 08:41:01 +0000 Original-Received: (at 27631) by debbugs.gnu.org; 14 Jul 2017 08:41:00 +0000 Original-Received: from localhost ([127.0.0.1]:37713 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dVw9k-0008Ok-5u for submit@debbugs.gnu.org; Fri, 14 Jul 2017 04:41:00 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:56683) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dVw9g-0008OW-Q2 for 27631@debbugs.gnu.org; Fri, 14 Jul 2017 04:40:57 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dVw9Y-0002vs-JX for 27631@debbugs.gnu.org; Fri, 14 Jul 2017 04:40:51 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:54822) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVw9Y-0002vj-E9; Fri, 14 Jul 2017 04:40:48 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:4165 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1dVw9X-0008Cb-O0; Fri, 14 Jul 2017 04:40:48 -0400 In-reply-to: <877ezcxtd3.fsf@calancha-pc> (message from Tino Calancha on Fri, 14 Jul 2017 00:13:28 +0900) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] 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:134534 Archived-At: > From: Tino Calancha > Date: Fri, 14 Jul 2017 00:13:28 +0900 > Cc: 27631@debbugs.gnu.org > > commit e5d5bd9822c1c562a7feb16f035062fda603d4d9 > Author: Tino Calancha > Date: Thu Jul 13 23:56:43 2017 +0900 > > Dired: Handle wildards in directory part > > Allow to Dired to handle calls like > \(dired \"~/foo/*/*.el\"), that is, with wildcards withing > the directory part of the file argument. > * lisp/files.el (insert-directory-wildcard-in-dir-p): New predicate. > (insert-directory) > * lisp/dired.el(dired-internal-noselect) > (dired-insert-directory): Use it. > * /etc/NEWS: Announce it. > * doc/emacs/dired.texi (Dired Enter): Update manual. Thanks, but this doesn't seem to work with ls-lisp.el, so I guess it relies on some features of the 'ls' command. (ls-lisp.el does support wildcards in the likes of "C-x d foo* RET".) So if we are going to accept this, either it should be made to work with ls-lisp.el (preferred), or some kind of error message should be emitted in that case, because presenting an empty Dired buffer is not very user-friendly. A few random comments on the code: > --- a/etc/NEWS > +++ b/etc/NEWS > @@ -559,9 +559,13 @@ properties as intact as possible. > * Changes in Specialized Modes and Packages in Emacs 26.1 > > ** Dired > -You can now use '`?`' in 'dired-do-shell-command'; as ' ? ', it gets replaced > ++++ > +*** You can now use '`?`' in 'dired-do-shell-command'; as ' ? ', it gets replaced > by the current file name. This is unrelated, right? > +(defun insert-directory-wildcard-in-dir-p (dir) > + (when (string-match "[*]" (file-name-directory dir)) > + (let ((regexp "\\`\\([^*]+/\\)\\([^*]*[*].*\\)")) > + (string-match regexp dir) > + (cons (match-string 1 dir) (match-string 2 dir))))) Any reason you only want to support '*'? What about '?' or '[a-b]', for example? Also, what happens if the directory includes a literal '*' character? That's possible on Posix systems. > + ;; subdirectory of the directory part free of wildcars; use ^^^^^^^^^ A typo.