From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Antoine Levitt Newsgroups: gmane.emacs.devel Subject: Re: read-directory-name, the unloved Date: Sat, 12 Feb 2011 16:12:51 +0100 Message-ID: <87d3mxp9qk.fsf@gmail.com> References: <874o8bio30.fsf@gmail.com> <87hbcbt0hm.fsf@gmail.com> <87lj1ly2rq.fsf@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1297526197 4885 80.91.229.12 (12 Feb 2011 15:56:37 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 12 Feb 2011 15:56:37 +0000 (UTC) Cc: Stefan Monnier , emacs-devel@gnu.org To: Andreas Schwab Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Feb 12 16:56:31 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PoHpm-0002Ox-Pl for ged-emacs-devel@m.gmane.org; Sat, 12 Feb 2011 16:56:30 +0100 Original-Received: from localhost ([127.0.0.1]:59049 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PoHpm-0006vs-6a for ged-emacs-devel@m.gmane.org; Sat, 12 Feb 2011 10:56:30 -0500 Original-Received: from [140.186.70.92] (port=36840 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PoHAU-0001yO-8z for emacs-devel@gnu.org; Sat, 12 Feb 2011 10:13:51 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PoH9c-0002yz-5Z for emacs-devel@gnu.org; Sat, 12 Feb 2011 10:12:58 -0500 Original-Received: from mail-fx0-f41.google.com ([209.85.161.41]:39214) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PoH9b-0002yj-PP for emacs-devel@gnu.org; Sat, 12 Feb 2011 10:12:56 -0500 Original-Received: by fxm12 with SMTP id 12so3917881fxm.0 for ; Sat, 12 Feb 2011 07:12:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=YHf+bxqjFKPKWa6T4eKU2FsRgTAI3t5boRZPedp25MU=; b=Qqk1qPhgckfxTtt0MyYyUKPz1XHfIXc8ST99QVkhY+7nchdqiYSbm+Dl+mtsjVB/6g EO6p/uR8J9f18DYQ18QSPMqbE310hnxi9+N6mcIjCYrYIeElblSn7WEgATMvF5phyPd2 JSbjRkeDj2E723UjXwz47QW9ZCw1aHODnRblE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; b=rWaZdr02IYYkC3QkctAIO615iA1SMUj0XGDFtjjk1Eb+msmiEg6ZqeWPY/fjoWFYw9 +NnKBat4RiIeYmVwbvP2/1daNwxkyqdlyduzpWsO/gSeM66sbC3VykNVI2mom/0/P8Tq da8zpoH1OamQ346tnLbZ0X0XUzVH3Xc2tIRT4= Original-Received: by 10.103.165.4 with SMTP id s4mr657733muo.25.1297523574825; Sat, 12 Feb 2011 07:12:54 -0800 (PST) Original-Received: from lambda (ney92-7-78-233-218-202.fbx.proxad.net [78.233.218.202]) by mx.google.com with ESMTPS id l3sm215754fan.0.2011.02.12.07.12.52 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 12 Feb 2011 07:12:53 -0800 (PST) In-Reply-To: (Andreas Schwab's message of "Sat, 12 Feb 2011 15:44:58 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.161.41 X-Mailman-Approved-At: Sat, 12 Feb 2011 10:55:19 -0500 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:135948 Archived-At: 12/02/11 15:44, Andreas Schwab > Antoine Levitt 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)