From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#9793: 24.0.90; Unwanted tramp connection on eshell completion. Date: Mon, 24 Oct 2011 10:20:36 -0400 Message-ID: References: <87r529a8g2.fsf@gmail.com> <871uu7lcv7.fsf@gmail.com> <87wrbxjrfi.fsf@gmx.de> <87y5wamva0.fsf@gmx.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1319466106 26332 80.91.229.12 (24 Oct 2011 14:21:46 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 24 Oct 2011 14:21:46 +0000 (UTC) Cc: 9793@debbugs.gnu.org, Thierry Volpiatto To: Michael Albinus Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Oct 24 16:21:41 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RILPI-0004XC-6N for geb-bug-gnu-emacs@m.gmane.org; Mon, 24 Oct 2011 16:21:40 +0200 Original-Received: from localhost ([::1]:44453 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RILPH-0008Ju-GN for geb-bug-gnu-emacs@m.gmane.org; Mon, 24 Oct 2011 10:21:39 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:42297) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RILPC-0008JJ-R3 for bug-gnu-emacs@gnu.org; Mon, 24 Oct 2011 10:21:36 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RILP8-0006eK-8P for bug-gnu-emacs@gnu.org; Mon, 24 Oct 2011 10:21:34 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:42751) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RILP8-0006eF-6n for bug-gnu-emacs@gnu.org; Mon, 24 Oct 2011 10:21:30 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1RILQb-0000hy-KF for bug-gnu-emacs@gnu.org; Mon, 24 Oct 2011 10:23:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 24 Oct 2011 14:23:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 9793 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 9793-submit@debbugs.gnu.org id=B9793.13194661362654 (code B ref 9793); Mon, 24 Oct 2011 14:23:01 +0000 Original-Received: (at 9793) by debbugs.gnu.org; 24 Oct 2011 14:22:16 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RILPs-0000gk-Ga for submit@debbugs.gnu.org; Mon, 24 Oct 2011 10:22:16 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.183] helo=ironport2-out.pppoe.ca) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RILPq-0000gX-0h for 9793@debbugs.gnu.org; Mon, 24 Oct 2011 10:22:15 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av0EALxzpU5MCqLO/2dsb2JhbABDqRGBBoFuAQEEAVYjBQsLNBIUGA0kiBOzYohABKE7hEU X-IronPort-AV: E=Sophos;i="4.69,398,1315195200"; d="scan'208";a="144118255" Original-Received: from 76-10-162-206.dsl.teksavvy.com (HELO pastel.home) ([76.10.162.206]) by ironport2-out.pppoe.ca with ESMTP/TLS/ADH-AES256-SHA; 24 Oct 2011 10:20:36 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 16DED58B4A; Mon, 24 Oct 2011 10:20:36 -0400 (EDT) In-Reply-To: <87y5wamva0.fsf@gmx.de> (Michael Albinus's message of "Mon, 24 Oct 2011 14:25:11 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.90 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Mon, 24 Oct 2011 10:23:01 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:53067 Archived-At: >> This looks like a workaround rather than a fix. Also, I notice that in >> `shell' (rather than `eshell') the problem does not occur. So I'd like >> to better understand what's going on. > In shell just the local file names are taken for completion. I don't > know how this is implemented, maybe via pcompletion tables? Both use pretty much the same pcomplete code. I think I finally figured out what is the difference between the two cases: if you set pcomplete-file-ignore and pcomplete-dir-ignore in shell-mode like it is set in eshell, the same problem shows up. So what happens is: - in eshell-mode - file-name-all-completions returns '("tic:" "tequila:" "tmp/") - completion-file-name-table then checks the predicate (which combines file-directory-p with regexp matching to avoid CVS and a few other directories). - this calls (file-directory-p "tequila:") in the "/" dir, which triggers Tramp. - in shell-mode - file-name-all-completions returns '("tic:" "tequila:" "tmp/") - completion-file-name-table then checks the predicate (file-directory-p) - file-directory-p is *not* called because completion-file-name-table handles it specially (just checks the presence of a terminating "/"). I still don't understand why in eshell, tramp-maybe-open-connection is called within the following backtrace: tramp-completion-file-name-handler(file-directory-p "/tequila:") file-directory-p("tequila:") whereas when I manually call (let ((default-directory "/")) (file-directory-p "tequila:")) tramp-maybe-open-connection is called within the following backtrace: tramp-completion-file-name-handler(expand-file-name "tequila:" "/") file-directory-p("tequila:") > In eshell, all file names are good for completion, also remote > ones. This is valid, because "cd /sudo::" is a valid command in > eshell. In shell-mode completion also understands Tramp file names (yup, that's a bug, we should probably default comint-file-name-prefix to "/:/"), so that's not the problem. > But this makes the trouble with the completion predicate > `file-directory-p'. Yup, I think we should somehow make it so Tramp can say (file-directory-p "/tequila:") => t without trying to connect to tequila (after all, even if we can't connect to tequila, this is still a "directory", just one we currently can't access). Stefan