From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thierry Volpiatto Newsgroups: gmane.emacs.help Subject: Re: elisp: Text-based file-chooser Date: Thu, 06 Jan 2011 08:46:45 +0100 Message-ID: <877heieaoq.fsf@gmail.com> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1294300157 14753 80.91.229.12 (6 Jan 2011 07:49:17 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 6 Jan 2011 07:49:17 +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 08:49:14 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 1Pakav-0003tl-Qe for geh-help-gnu-emacs@m.gmane.org; Thu, 06 Jan 2011 08:49:13 +0100 Original-Received: from localhost ([127.0.0.1]:55596 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pakav-0004F6-8y for geh-help-gnu-emacs@m.gmane.org; Thu, 06 Jan 2011 02:49:13 -0500 Original-Received: from [140.186.70.92] (port=44439 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PakYx-0003mU-NI for help-gnu-emacs@gnu.org; Thu, 06 Jan 2011 02:47:15 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PakYq-0007Ur-Ld for help-gnu-emacs@gnu.org; Thu, 06 Jan 2011 02:47:05 -0500 Original-Received: from lo.gmane.org ([80.91.229.12]:55348) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PakYq-0007Ue-7W for help-gnu-emacs@gnu.org; Thu, 06 Jan 2011 02:47:04 -0500 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1PakYo-0002yC-NN for help-gnu-emacs@gnu.org; Thu, 06 Jan 2011 08:47:02 +0100 Original-Received: from 117.211.85-79.rev.gaoland.net ([79.85.211.117]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 06 Jan 2011 08:47:02 +0100 Original-Received: from thierry.volpiatto by 117.211.85-79.rev.gaoland.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 06 Jan 2011 08:47:02 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 55 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 117.211.85-79.rev.gaoland.net User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.2.91 (gnu/linux) Cancel-Lock: sha1:+GvthQsQX/1oskBJAJjNU0sq93Q= 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:78252 Archived-At: Hi Larry, Larry Kohlman writes: > 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) Indeed, thanks to report. The problem is tramp that is not loaded. If you do as following, things should work as expected: emacs -Q In scratch buffer, eval: (add-to-list 'load-path "path/to/your/anything/files") (require 'anything-config) (require 'tramp) (defun my-file-browser () (let ((fname (anything-c-read-file-name "AnyPrompt: "))) (message "FILENAME: %s" name))) (my-file-browser) > 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. Yes, because anything-find-files load tramp, but anything-c-read-file-name doesn't. I will fix it as soon as possible. > 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. What mysterious things? Can you give examples? -- A+ Thierry Get my Gnupg key: gpg --keyserver pgp.mit.edu --recv-keys 59F29997