From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Hadsell Newsgroups: gmane.emacs.bugs Subject: Re: Inconvenience with TRAMP and recentf Date: Mon, 02 Jul 2007 17:31:04 -0400 Organization: Mt. Diablo Systems Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1183411911 29986 80.91.229.12 (2 Jul 2007 21:31:51 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 2 Jul 2007 21:31:51 +0000 (UTC) To: gnu-emacs-bug@ftp.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jul 02 23:31:49 2007 connect(): Connection refused Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1I5TUr-0006vD-8r for geb-bug-gnu-emacs@m.gmane.org; Mon, 02 Jul 2007 23:31:49 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1I5TUq-0005Uz-MR for geb-bug-gnu-emacs@m.gmane.org; Mon, 02 Jul 2007 17:31:48 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1I5TUF-0004S6-UF for bug-gnu-emacs@gnu.org; Mon, 02 Jul 2007 17:31:12 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1I5TUD-0004O5-9p for bug-gnu-emacs@gnu.org; Mon, 02 Jul 2007 17:31:11 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1I5TUC-0004NY-Sm for bug-gnu-emacs@gnu.org; Mon, 02 Jul 2007 17:31:08 -0400 Original-Received: from fencepost.gnu.org ([140.186.70.10]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1I5TUC-00065C-JZ for bug-gnu-emacs@gnu.org; Mon, 02 Jul 2007 17:31:08 -0400 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by fencepost.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1I5TUC-0002D3-DZ for gnu-emacs-bug@ftp.gnu.org; Mon, 02 Jul 2007 17:31:08 -0400 Original-Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1I5TUB-000652-RP for gnu-emacs-bug@ftp.gnu.org; Mon, 02 Jul 2007 17:31:08 -0400 Original-Received: from trinity.supernews.net ([216.168.1.22]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1I5TUB-00064s-Ey for gnu-emacs-bug@ftp.gnu.org; Mon, 02 Jul 2007 17:31:07 -0400 Original-Received: from pa-sjc-01.sjc-v12.supernews.net ([10.20.222.34]:55445 helo=pa-sjc-01.supernews.net) by trinity.supernews.net with esmtp (Exim 4.66 (FreeBSD)) (envelope-from ) id 1I5TU9-0007wa-Lz for gnu-emacs-bug@ftp.gnu.org; Mon, 02 Jul 2007 21:31:05 +0000 Original-Received: (from news@localhost) by pa-sjc-01.supernews.net (8.13.8/8.13.8/Submit) id l62LV5ua088376 for gnu-emacs-bug@prep.ai.mit.edu; Mon, 2 Jul 2007 21:31:05 GMT (envelope-from nntp-bounce@supernews.net) Original-Path: news.supernews.com!not-for-mail Original-Newsgroups: gnu.emacs.bug Mail-Copies-To: never User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (windows-nt) Cancel-Lock: sha1:xLVh/d5QAZpBpALmwQ+dlvaZ6QY= Original-X-Complaints-To: abuse@supernews.com Original-Lines: 48 X-detected-kernel: FreeBSD 6.x (1) X-detected-kernel: Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:16056 Archived-At: Michael Albinus writes: > I did test it locally (Emacs 22.1.50.2, Tramp 2.0.56). If the remote > file name in .recentf contains already an absolute local file name, > expand-file-name does NOT open a connection. The connection is opened by > file-readable-p. > > The remote connection is NOT opened with the following settings in my > .emacs: > > (require 'recentf) > (add-to-list 'recentf-keep 'file-remote-p) > (recentf-mode 1) You're right. That works. Clearly I missed something when I was reviewing the code; I'll have to re-read it. >> Incidentally, maybe it would be a good idea to canonicalize the remote >> filenames when they are first placed in the recentf-list, rather than >> waiting for recentf-cleanup to do it. > > Yes. But it seems all file names in .recentf are already absolute; at > least according to my tests. So the settings above might be sufficient, > aren't they? Yes, they show up in absolute format in .recentf, which is what matters for this purpose. I was fooled by the fact that they initially show up in relative format in the recentf menu, and only change to absolute format when emacs is restarted. So the only problem with this approach is that a remote file that disappears or becomes unreadable will not be removed from the recent file list until it falls off the end. I proposed an alternative solution in another branch of this thread, but it was baroque and tricky. I suppose one could construct another predicate for the recentf-keep list. Rather than file-remote-p, one could use tramp-remote-host-offline-p, which would return true if the file name was remote and there was no session open to the remote host. That would allow the normal file-readable-p test to be performed if the remote host was already online, but would not create a new session if it was not. Maybe I'll try this approach if I get sufficient tuits. Thanks for your help. -- Alan Hadsell