GNU bug report logs - #27631
dired a/*/b

Previous Next

Package: emacs;

Reported by: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>

Date: Sun, 9 Jul 2017 18:44:01 UTC

Severity: minor

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

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Tino Calancha <tino.calancha <at> gmail.com>
Cc: 27631 <at> debbugs.gnu.org, michael.albinus <at> gmx.de
Subject: bug#27631: dired a/*/b
Date: Fri, 14 Jul 2017 11:40:49 +0300
> From: Tino Calancha <tino.calancha <at> gmail.com>
> Date: Fri, 14 Jul 2017 00:13:28 +0900
> Cc: 27631 <at> debbugs.gnu.org
> 
> commit e5d5bd9822c1c562a7feb16f035062fda603d4d9
> Author: Tino Calancha <tino.calancha <at> gmail.com>
> 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.




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

Previous Next


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