unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Tino Calancha <tino.calancha@gmail.com>
Cc: 27631@debbugs.gnu.org, michael.albinus@gmx.de
Subject: bug#27631: dired a/*/b
Date: Fri, 14 Jul 2017 11:40:49 +0300	[thread overview]
Message-ID: <83y3rrfm26.fsf@gnu.org> (raw)
In-Reply-To: <877ezcxtd3.fsf@calancha-pc> (message from Tino Calancha on Fri,  14 Jul 2017 00:13:28 +0900)

> From: Tino Calancha <tino.calancha@gmail.com>
> Date: Fri, 14 Jul 2017 00:13:28 +0900
> Cc: 27631@debbugs.gnu.org
> 
> commit e5d5bd9822c1c562a7feb16f035062fda603d4d9
> Author: Tino Calancha <tino.calancha@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.





  reply	other threads:[~2017-07-14  8:40 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-09 18:42 bug#27631: dired a/*/b 積丹尼 Dan Jacobson
2017-07-13  5:52 ` Tino Calancha
2017-08-02 17:30   ` Stefan Monnier
2017-08-02 17:49     ` Eli Zaretskii
2017-08-03  1:25       ` Stefan Monnier
2017-08-03  4:38     ` Tino Calancha
2017-08-03 15:48       ` Stefan Monnier
2017-08-04  5:12         ` Tino Calancha
2017-07-13 13:15 ` 積丹尼 Dan Jacobson
2017-07-13 15:13 ` Tino Calancha
2017-07-14  8:40   ` Eli Zaretskii [this message]
2017-07-25 15:19     ` Tino Calancha
2017-07-26  7:36       ` Michael Albinus
2017-07-28  7:50         ` Tino Calancha
2017-07-28  9:23           ` Michael Albinus
2017-07-28  9:34             ` Tino Calancha
2017-07-28 11:23               ` Michael Albinus
2017-07-28 12:00           ` Michael Albinus
2017-07-29 12:20             ` Tino Calancha
2017-07-29 20:39               ` Michael Albinus
2017-07-30  2:20                 ` Tino Calancha
2017-07-30 11:13                 ` Michael Albinus
2017-07-29  8:30       ` Eli Zaretskii
2017-07-29 12:03         ` Tino Calancha
2017-07-14  9:30   ` Michael Albinus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83y3rrfm26.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=27631@debbugs.gnu.org \
    --cc=michael.albinus@gmx.de \
    --cc=tino.calancha@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).