help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: elisp: Text-based file-chooser


From: Larry Kohlman
Subject: Re: elisp: Text-based file-chooser
Date: Wed, 05 Jan 2011 12:23:53 -0600

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. 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]