From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Larry Kohlman Newsgroups: gmane.emacs.help Subject: Re: elisp: Text-based file-chooser Date: Wed, 05 Jan 2011 12:23:53 -0600 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Trace: dough.gmane.org 1294252849 11392 80.91.229.12 (5 Jan 2011 18:40:49 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 5 Jan 2011 18:40:49 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jan 05 19:40:45 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 1PaYHs-0000Is-5q for geh-help-gnu-emacs@m.gmane.org; Wed, 05 Jan 2011 19:40:44 +0100 Original-Received: from localhost ([127.0.0.1]:58425 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PaYHr-0005vh-KC for geh-help-gnu-emacs@m.gmane.org; Wed, 05 Jan 2011 13:40:43 -0500 Original-Path: usenet.stanford.edu!news.glorb.com!news2.glorb.com!border3.nntp.dca.giganews.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!nntp.supernews.com!news.supernews.com.POSTED!not-for-mail Original-NNTP-Posting-Date: Wed, 05 Jan 2011 12:23:53 -0600 Original-Newsgroups: gnu.emacs.help Original-Lines: 43 Original-X-Trace: sv3-Pw1feyzsNkWGPbtkb2bjNQlcLM55ReQH5HM62dAbWYPT4n2Scf1EflOofm4dT6h66C60UWVEjsIxVIU!WoiiNJXUbLixOjRjTtc8wbgmLL+BAZU6sKNXiWd9LDs1pmKwC84semN4sqN/pm7IrAJQh1cW30Pw!O4g8OCoy Original-X-Complaints-To: www.supernews.com/docs/abuse.html X-DMCA-Complaints-To: www.supernews.com/docs/dmca.html X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 3199 Original-Xref: usenet.stanford.edu gnu.emacs.help:184022 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:78218 Archived-At: On Mon, 03 Jan 2011 13:49:44 -0800, Drew Adams wrote: >> What I'm trying to do here is replace the GUI file selector with a more >> general (and mouseless) text-mode hierarchical file-selector that I can >> use both in a GUI and at a text-only console. My lisp code often uses >> the GUI file selector to select files that I want to process in other >> ways besides editing, so I need its replacement to only return the >> filename and let me decide for myself what action to take. > > 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. Something roughly like dired but that lets the user browse files and directories and only returns the path with a selected or entered filename and does absolutely nothing else. I know it's out there because I've seen it before, but I just can't find the magic command or plugin. > > 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 I get when I do that is a one-line prompt for a filename. It gives me completion but I don't get a file list to browse. I also tried it with use-dialog-box set both ways, then I tried loading emacs without an init file just to be sure one of my customizations isn't messing me up. The manual is vague on whether read-file-name even has a text dialog. 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.