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 17:46:54 -0600

On Wed, 05 Jan 2011 19:58:51 +0100, Thierry Volpiatto wrote:

> Larry Kohlman <nospam@nospam.invalid> writes:
> 
>> 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.
> 
> See in anything-config.el `anything-c-read-file-name'.
> http://repo.or.cz/w/anything-config.git
> 
> You use it like that:
> 
> (defun my-file-browser ()
>   (let ((fname (anything-c-read-file-name "AnyPrompt: ")))
>       (do-what-you-want-on-fname fname)))

Thanks. Just to see how that functions I changed the code to:

 (defun my-file-browser ()
   (let ((fname (anything-c-read-file-name "AnyPrompt: ")))
       (message "FILENAME: %s" name)))

Calling that yields the following error message:

anything-compute-matches: error when processing source: 
Read file name (`C-.':Go to precedent level)

Next I used the Anything menu (Anything->Find Files) to see if Anything
would work when run normally. It did. On a hunch I tried the above code
again and it also worked. Then I checked and found that Anything->Find
Files doesn't even invoke anything-c-read-file-name. After that I exited
Emacs and was able to repeat everything several times in a row.

Ah, well, mysterious things happen when you use functions that weren't
intended for external use. I'll just mess around with this until it
works.

> It have full support for tramp.
> It work on windows and in tty.
> 
> For more questions about anything ask on
> https://groups.google.com/group/emacs-anything?hl=en



reply via email to

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