From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: read-directory-name, the unloved Date: Fri, 11 Feb 2011 21:03:31 -0500 Message-ID: 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 1297476225 4972 80.91.229.12 (12 Feb 2011 02:03:45 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 12 Feb 2011 02:03:45 +0000 (UTC) Cc: emacs-devel@gnu.org To: Antoine Levitt Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Feb 12 03:03:38 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 1Po4pm-0007LF-4Z for ged-emacs-devel@m.gmane.org; Sat, 12 Feb 2011 03:03:38 +0100 Original-Received: from localhost ([127.0.0.1]:50812 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Po4pl-0007e1-7I for ged-emacs-devel@m.gmane.org; Fri, 11 Feb 2011 21:03:37 -0500 Original-Received: from [140.186.70.92] (port=55700 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Po4ph-0007dc-JM for emacs-devel@gnu.org; Fri, 11 Feb 2011 21:03:34 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Po4pg-0007xo-SN for emacs-devel@gnu.org; Fri, 11 Feb 2011 21:03:33 -0500 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.183]:46774 helo=ironport2-out.pppoe.ca) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Po4pg-0007xj-KS for emacs-devel@gnu.org; Fri, 11 Feb 2011 21:03:32 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvsEAF95VU1FxIyy/2dsb2JhbAClf3S8VoVdBIUBjzk X-IronPort-AV: E=Sophos;i="4.60,459,1291611600"; d="scan'208";a="91454722" Original-Received: from 69-196-140-178.dsl.teksavvy.com (HELO ceviche.home) ([69.196.140.178]) by ironport2-out.pppoe.ca with ESMTP/TLS/ADH-AES256-SHA; 11 Feb 2011 21:03:31 -0500 Original-Received: by ceviche.home (Postfix, from userid 20848) id 518D3660C9; Fri, 11 Feb 2011 21:03:31 -0500 (EST) In-Reply-To: <87hbcbt0hm.fsf@gmail.com> (Antoine Levitt's message of "Fri, 11 Feb 2011 09:54:29 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.248.154.183 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:135929 Archived-At: >> Sorry about that, there was a syntax mistake in the patch, here's the >> correct version http://pastebin.com/Z7fRevAV > I got asked by mail to post the patch on the list. There it is. Thanks. This looks pretty good overall, although the first hunk doesn't sound quite so simple: > @@ -601,14 +601,8 @@ > (if current-prefix-arg > (read-string "Dired listing switches: " > dired-listing-switches)) > - ;; 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 (next-read-file-uses-dialog-p) > - (read-directory-name (format "Dired %s(directory): " str) > - nil default-directory nil) > - (read-file-name (format "Dired %s(directory): " str) > - nil default-directory nil))))) > + (read-directory-name (format "Dired %s(directory): " str) > + nil default-directory nil)))) > > ;; We want to switch to a more sophisticated version of > ;; dired-read-dir-and-switches like the following, if there is a way 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? Stefan