bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#27631: dired a/*/b


From: Eli Zaretskii
Subject: bug#27631: dired a/*/b
Date: Fri, 14 Jul 2017 11:40:49 +0300

> From: Tino Calancha <address@hidden>
> Date: Fri, 14 Jul 2017 00:13:28 +0900
> Cc: address@hidden
> 
> commit e5d5bd9822c1c562a7feb16f035062fda603d4d9
> Author: Tino Calancha <address@hidden>
> 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.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]