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 11:18:33 +0100 Message-ID: <87lj1ly2rq.fsf@gmail.com> References: <874o8bio30.fsf@gmail.com> <87hbcbt0hm.fsf@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1297517337 28971 80.91.229.12 (12 Feb 2011 13:28:57 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 12 Feb 2011 13:28:57 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Feb 12 14:28:53 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 1PoFWp-00036g-D7 for ged-emacs-devel@m.gmane.org; Sat, 12 Feb 2011 14:28:51 +0100 Original-Received: from localhost ([127.0.0.1]:51427 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PoFWo-0004ih-76 for ged-emacs-devel@m.gmane.org; Sat, 12 Feb 2011 08:28:46 -0500 Original-Received: from [140.186.70.92] (port=53668 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PoCYr-0007CO-35 for emacs-devel@gnu.org; Sat, 12 Feb 2011 05:18:42 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PoCYo-0007w9-NZ for emacs-devel@gnu.org; Sat, 12 Feb 2011 05:18:40 -0500 Original-Received: from mail-fx0-f41.google.com ([209.85.161.41]:40069) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PoCYo-0007uk-DC for emacs-devel@gnu.org; Sat, 12 Feb 2011 05:18:38 -0500 Original-Received: by fxm12 with SMTP id 12so3753011fxm.0 for ; Sat, 12 Feb 2011 02:18:37 -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=PjOja716cVIbkGejJSH+B7i/MH6sQ1CTApcnbNJ1FmM=; b=kwtKMG+zk6/9i7cWTpgEcCzqMSyI5uq74bdAupSMTNNhbAIczsc6YX9jtZvyRAkH64 nmkJ/ES4i6bojlHfo+/d4nrRLbcdKcoacuu46oFqZ/HCEfM+pXE3wGpnkAGmI8vmZIbS lTXwhxDVQ5LepOkb7JV3aw+tnSoAeX0DipEnI= 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=qBLTDleR5E3KM7almorhx/I1iyAKAKtWSrU5RtiFgv6ebBXNdlVUh3VbTWT+ET/Pe0 0wsYBPsPvHN4gBfyLKzWVMG6QQHlJG4IovbISmXpPL2qXjJlgTfJmSEk9FTd/bK02PNF egeqNgTpkvTCwB+iyWG8aQh8jaJZAGj9RKvRs= Original-Received: by 10.223.79.74 with SMTP id o10mr1740661fak.63.1297505917202; Sat, 12 Feb 2011 02:18:37 -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 c11sm105873fav.26.2011.02.12.02.18.35 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 12 Feb 2011 02:18:36 -0800 (PST) In-Reply-To: (Stefan Monnier's message of "Fri, 11 Feb 2011 21:03:31 -0500") 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 08:22:58 -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:135941 Archived-At: 12/02/11 03:03, Stefan Monnier > The code you remove already used read-directory-name and deliberately > used read-file-name in some cases, so there seems to be something more > going on here. The comment doesn't explain why we use read-file-name, > but IIRC there's an issue where we want to let the user enter a glob > pattern or something like that. > Can you try and figure out what's really going on here? My guess is that the code was copied over from the commented out bit just below, which does have a reason to distinguish the two cases (to offer completion in the non-graphical case). But on the "simple" version which is what's actually in the code, I don't see any reason not to use read-directory-name. But then I could be missing something. 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. Antoine