From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.help Subject: RE: elisp: Text-based file-chooser Date: Wed, 5 Jan 2011 11:06:59 -0800 Message-ID: <29A76B05501941B285452E8D76239503@us.oracle.com> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1294254456 20015 80.91.229.12 (5 Jan 2011 19:07:36 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 5 Jan 2011 19:07:36 +0000 (UTC) To: "'Larry Kohlman'" , Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jan 05 20:07:30 2011 Return-path: Envelope-to: geh-help-gnu-emacs@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 1PaYhl-0000oJ-DD for geh-help-gnu-emacs@m.gmane.org; Wed, 05 Jan 2011 20:07:29 +0100 Original-Received: from localhost ([127.0.0.1]:58924 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PaYhk-000641-LQ for geh-help-gnu-emacs@m.gmane.org; Wed, 05 Jan 2011 14:07:28 -0500 Original-Received: from [140.186.70.92] (port=38108 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PaYhQ-00063i-26 for help-gnu-emacs@gnu.org; Wed, 05 Jan 2011 14:07:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PaYhO-0000Br-GF for help-gnu-emacs@gnu.org; Wed, 05 Jan 2011 14:07:07 -0500 Original-Received: from rcsinet10.oracle.com ([148.87.113.121]:55436) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PaYhO-0000Bl-AY for help-gnu-emacs@gnu.org; Wed, 05 Jan 2011 14:07:06 -0500 Original-Received: from acsinet15.oracle.com (acsinet15.oracle.com [141.146.126.227]) by rcsinet10.oracle.com (Switch-3.4.2/Switch-3.4.2) with ESMTP id p05J7370029692 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 5 Jan 2011 19:07:05 GMT Original-Received: from acsmt355.oracle.com (acsmt355.oracle.com [141.146.40.155]) by acsinet15.oracle.com (Switch-3.4.2/Switch-3.4.1) with ESMTP id p05IfNH2005573; Wed, 5 Jan 2011 19:07:00 GMT Original-Received: from abhmt009.oracle.com by acsmt355.oracle.com with ESMTP id 932671731294254418; Wed, 05 Jan 2011 11:06:58 -0800 Original-Received: from dradamslap1 (/130.35.178.194) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 05 Jan 2011 11:06:58 -0800 X-Mailer: Microsoft Office Outlook 11 Thread-Index: AcutB/2GSoO9ZOEyR2Crx5ccMaBLEgAAT18w In-Reply-To: X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5994 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:78221 Archived-At: > > So I guess you're saying that you do not want (necessarily) > > to visit the file, you just want to read a file name. > > Exactly. > > > But you do not want to use the > > "GUI file selector", by which I suppose you mean a > > file-selection dialog box. Is that it? > > I want a file-browsing dialog box, but I want it to be text-mode so it > can be used on a raw terminal or inside an xterm. Dunno what such an animal is or how you get it. By "dialog box" I meant a graphic dialog box, not available from a terminal. > Something roughly like dired but that lets the user browse > files and directories So far, that sounds like Dired. > and only returns the path with a selected or entered filename > and does absolutely nothing else. In Dired, you have the path in the buffer header. You can also get the path as a string from variable `default-directory'. If you are trying to get the absolute name of the file where the cursor is, as a string, you can use `(dired-get-filename)'. > I know it's out there because I've seen it before, but I > just can't find the magic command or plugin. Well it's not clear to me what you want. And I'm probably not familiar with the magic command or plugin anyway. Perhaps someone else can help you. > > If all you want is to read a file name without using a > > dialog box, then just use `read-file-name' with `use-file-dialog' > > bound to `t'. > > (let ((use-file-dialog t)) > > (read-file-name ...)...) (All that does is ensure that you don't get a graphic dialog box.) > All I get when I do that is a one-line prompt for a filename. It gives > me completion Which should show you a list of files that match your input. With empty input, TAB TAB should show you all files and subdirs in the directory. > but I don't get a file list to browse. You get a file list, but not to browse, depending on what you mean by browse. You can explore the entire file system from `read-file-name', showing the contents of any directory, and reading any file name. I would call that browsing, but you might not. > The manual is vague on whether read-file-name even has a text > dialog. I don't know what a text dialog is, so I wouldn't know if the manual is vague about it. If you think it is, consider `M-x report-emacs-bug' to get it cleared up. > If it's bringing up a text dialog on some installations then > either there's some well-hidden secret to triggering one, or > read-file-name may be redirecting the request to the function I need via > read-file-name-function. `read-file-name' just reads a file name with completion. It brings up a graphic dialog box only in certain situations, and you are anyway not interested in that. Other than that it does just what you saw - on all installations (AFAIK).