unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Antoine Levitt <antoine.levitt@gmail.com>
To: Andreas Schwab <schwab@linux-m68k.org>
Cc: Stefan Monnier <monnier@iro.umontreal.ca>, emacs-devel@gnu.org
Subject: Re: read-directory-name, the unloved
Date: Sat, 12 Feb 2011 16:12:51 +0100	[thread overview]
Message-ID: <87d3mxp9qk.fsf@gmail.com> (raw)
In-Reply-To: <m2r5bdz505.fsf@igel.home> (Andreas Schwab's message of "Sat, 12 Feb 2011 15:44:58 +0100")

12/02/11 15:44, Andreas Schwab
> Antoine Levitt <antoine.levitt@gmail.com> writes:
>
>> Read-directory-name is basically a wrapper on read-file-name, using
>> file-directory-p as PREDICATE. So if anything else, read-directory-name
>> is more restrictive than read-file-name. In any case, since MUSTMATCH
>> is nil, there's no obligation to choose a real file/directory, so
>> PREDICATE is only used for completion purposes.
>
> dired accepts more than just a directory as argument, and I would be
> annoyed if I would not be able complete a non-directory.
>
> Andreas.

Ah, sorry, I missed that. I guess the point is to get a dired view of
for instance some_long_name.1, some_long_name.2, etc., so you'd do C-x d
some TAB * RET? Then the unpatched code was perfectly fine, and ido
users don't care anyway since it's wrapped by ido. Apologies, and thanks
for pointing that out. Here's a patch with comments to clarify that
situation.

--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -604,6 +604,8 @@ Don't use that together with FILTER."
 	    ;; If a dialog is about to be used, call read-directory-name so
 	    ;; the dialog code knows we want directories.  Some dialogs can
 	    ;; only select directories or files when popped up, not both.
+	    ;; If no dialog is used, call read-file-name because the user may
+	    ;; want completion of file names for use in a wildcard pattern.
 	    (if (next-read-file-uses-dialog-p)
 		(read-directory-name (format "Dired %s(directory): " str)
 				     nil default-directory nil)



      reply	other threads:[~2011-02-12 15:12 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-10 21:20 read-directory-name, the unloved Antoine Levitt
2011-02-10 21:29 ` Antoine Levitt
2011-02-11  8:54   ` Antoine Levitt
2011-02-12  2:03     ` Stefan Monnier
2011-02-12 10:18       ` Antoine Levitt
2011-02-12 14:44         ` Andreas Schwab
2011-02-12 15:12           ` Antoine Levitt [this message]

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=87d3mxp9qk.fsf@gmail.com \
    --to=antoine.levitt@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=schwab@linux-m68k.org \
    /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).