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 09:37:08 +0100 Message-ID: <87wrmi5sy3.fsf@gmail.com> References: <877heieaoq.fsf@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1294303069 26399 80.91.229.12 (6 Jan 2011 08:37:49 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 6 Jan 2011 08:37: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 Thu Jan 06 09:37: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 1PalLs-0008Gz-NA for geh-help-gnu-emacs@m.gmane.org; Thu, 06 Jan 2011 09:37:44 +0100 Original-Received: from localhost ([127.0.0.1]:50827 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PalLr-0007k5-N8 for geh-help-gnu-emacs@m.gmane.org; Thu, 06 Jan 2011 03:37:43 -0500 Original-Received: from [140.186.70.92] (port=51832 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PalLW-0007jt-Fc for help-gnu-emacs@gnu.org; Thu, 06 Jan 2011 03:37:23 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PalLV-0007cB-El for help-gnu-emacs@gnu.org; Thu, 06 Jan 2011 03:37:22 -0500 Original-Received: from lo.gmane.org ([80.91.229.12]:49653) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PalLU-0007bx-Mc for help-gnu-emacs@gnu.org; Thu, 06 Jan 2011 03:37:21 -0500 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1PalLT-00085V-S1 for help-gnu-emacs@gnu.org; Thu, 06 Jan 2011 09:37:19 +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 09:37:19 +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 09:37:19 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 59 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:QL1TFTma0nAZjCIDNduMYztJ+NQ= 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:78253 Archived-At: Thierry Volpiatto writes: > 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. Ok fixed, you can check it out on anything git repo. >> 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