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 17:46:54 -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 1294274454 21674 80.91.229.12 (6 Jan 2011 00:40:54 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 6 Jan 2011 00:40:54 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Jan 06 01:40:49 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 1PaduG-0006Pi-S6 for geh-help-gnu-emacs@m.gmane.org; Thu, 06 Jan 2011 01:40:45 +0100 Original-Received: from localhost ([127.0.0.1]:56998 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PaduG-0007VY-39 for geh-help-gnu-emacs@m.gmane.org; Wed, 05 Jan 2011 19:40:44 -0500 Original-Path: usenet.stanford.edu!postnews.google.com!news2.google.com!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.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 17:46:54 -0600 Original-Newsgroups: gnu.emacs.help Original-Lines: 47 Original-X-Trace: sv3-h7nrKz2/pbLZX2hzp9BDbdFGFtI6T1jPgRPJ15Ck6eBfLcZM3XoIIR9Wy5Y5hnx9xsv0ieSfvr7Bux1!LPB9kH+hKgBQKEbpKwF84xryjSrG3j4Kae6MfLaBE6lgflEVlvX0aNvDB8F/gkWOao63Nio2/alF!PQGlrOY= 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: 3188 Original-Xref: usenet.stanford.edu gnu.emacs.help:184043 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:78242 Archived-At: On Wed, 05 Jan 2011 19:58:51 +0100, Thierry Volpiatto wrote: > Larry Kohlman 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