From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thierry Volpiatto Newsgroups: gmane.emacs.bugs Subject: bug#5840: 24.0.50; wrong tramp-file-name-regexp Date: Sun, 11 Apr 2010 22:12:39 +0200 Organization: ThierryVolpiatto Message-ID: <87y6gthhoo.fsf@tux.homenetwork> References: <87d3ydw1wr.fsf@tux.homenetwork> <87tyri53r7.fsf@gmx.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1271018071 26241 80.91.229.12 (11 Apr 2010 20:34:31 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 11 Apr 2010 20:34:31 +0000 (UTC) To: bug-gnu-emacs@gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Apr 11 22:34:30 2010 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.69) (envelope-from ) id 1O13rQ-0003Pk-Nb for geb-bug-gnu-emacs@m.gmane.org; Sun, 11 Apr 2010 22:34:29 +0200 Original-Received: from localhost ([127.0.0.1]:41666 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O13rQ-0004jm-0e for geb-bug-gnu-emacs@m.gmane.org; Sun, 11 Apr 2010 16:34:28 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O13m0-0002Kw-Fs for bug-gnu-emacs@gnu.org; Sun, 11 Apr 2010 16:28:52 -0400 Original-Received: from [140.186.70.92] (port=45028 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O13ly-0002K9-UF for bug-gnu-emacs@gnu.org; Sun, 11 Apr 2010 16:28:52 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O13lx-0003Wx-E0 for bug-gnu-emacs@gnu.org; Sun, 11 Apr 2010 16:28:50 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:38649) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O13lx-0003Wt-C9 for bug-gnu-emacs@gnu.org; Sun, 11 Apr 2010 16:28:49 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1O13aY-0006G1-Cy; Sun, 11 Apr 2010 16:17:02 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: <87d3ydw1wr.fsf@tux.homenetwork> Resent-From: Thierry Volpiatto Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 11 Apr 2010 20:17:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 5840 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by submit@debbugs.gnu.org id=B.127101700924043 (code B ref -1); Sun, 11 Apr 2010 20:17:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 11 Apr 2010 20:16:49 +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 1O13aL-0006Fk-BM for submit@debbugs.gnu.org; Sun, 11 Apr 2010 16:16:49 -0400 Original-Received: from mx10.gnu.org ([199.232.76.166]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O13aI-0006Ff-2Q for submit@debbugs.gnu.org; Sun, 11 Apr 2010 16:16:47 -0400 Original-Received: from lists.gnu.org ([199.232.76.165]:47099) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1O13aD-0001tv-JA for submit@debbugs.gnu.org; Sun, 11 Apr 2010 16:16:41 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O13aD-0006pJ-2a for bug-gnu-emacs@gnu.org; Sun, 11 Apr 2010 16:16:41 -0400 Original-Received: from [140.186.70.92] (port=49142 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O13aB-0006oa-If for bug-gnu-emacs@gnu.org; Sun, 11 Apr 2010 16:16:40 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O13a9-0002MJ-Lj for bug-gnu-emacs@gnu.org; Sun, 11 Apr 2010 16:16:39 -0400 Original-Received: from lo.gmane.org ([80.91.229.12]:43092) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O13a9-0002M4-Ba for bug-gnu-emacs@gnu.org; Sun, 11 Apr 2010 16:16:37 -0400 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1O13a7-0006QD-BB for bug-gnu-emacs@gnu.org; Sun, 11 Apr 2010 22:16:35 +0200 Original-Received: from 162.211.85-79.rev.gaoland.net ([79.85.211.162]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 11 Apr 2010 22:16:35 +0200 Original-Received: from thierry.volpiatto by 162.211.85-79.rev.gaoland.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 11 Apr 2010 22:16:35 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 88 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 162.211.85-79.rev.gaoland.net Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAElBMVEUHBARgJRFPS0WbMBTC TSG/uJs0yyVHAAAACXBIWXMAAAsSAAALEgHS3X78AAAACXZwQWcAAAAwAAAAMADO7oxXAAABpUlE QVQ4y3VTQXKDMAyUnD7AwvQOhtxj5N4LFh9ow/+/UtlpM0BczWSS0Wola7UBeEb3+3kJ/5p9ZLz3 UI0n0J0Y4K/lh1nG24FhlJOR2LdSKtpV5gfi/Zd+NdaJBbB4D5N0JnfUIVp6obZURkJwS2a8b9uX AkgxA5gCEcknAH1s2z0DPooWmjGKcJR+HNZt+9bm0GtGRycRuZGs98Ffr02vABWGopIAhmXmxnQN BwBXZjgFLHRoqbfeYxCLWqsjLyKhbEHW+A5nEs699Q2O80ALrgHTmUTy6P0MnKyKQpKHpoNWokxs F0D5VegvWmEozyE6nuMiS98mWzlUQ9bW8qYfqOaFtzWlYCqGeIs6HEyl08jkrxUG9MF5ipXpOOpd ZMoXPPVSLWJiiwNNB+eRSyxJZmQKcacikgucnCRiHuJOLmyYJRDPwOqAvY4pA+Wy+VS8G26BAsdb Ph2Hw7ORy/H0IOG0TnaM8Cp0XrFYyU0v2z8AqkifPVbLZ0qo/gsRg60C7p+8Ov9jrUIxFde+jnAq X42hyp/c+ZcnVyUYBarrqZt3+R8450png3cWKgAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAwOC0wNS0z MVQyMjoxNDoyMiswMjowMK3VBDcAAAAldEVYdGRhdGU6bW9kaWZ5ADIwMDctMTAtMjhUMTc6MDg6 NDgrMDE6MDDLdIcLAAAAEXRFWHRqcGVnOmNvbG9yc3BhY2UAMix1VZ8AAAAgdEVYdGpwZWc6c2Ft cGxpbmctZmFjdG9yADJ4MiwxeDEsMXgxSfqmtAAAAABJRU5ErkJggg== User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) Cancel-Lock: sha1:/3IYmLYRCuTstR/wm/pz5DRqRCc= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Sun, 11 Apr 2010 16:17:02 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) 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: , 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:36192 Archived-At: Stefan Monnier writes: >>> with these settings: >>> >>> ,---- >>> | (add-hook 'minibuffer-setup-hook >>> | (lambda () (add-hook 'post-command-hook >>> | 'minibuffer-completion-help nil t))) >>> `---- >>> >>> If you do: >>> C-x C-f ==> /su: >>> >>> You have not the time to type the second ":" and tramp fail. >>> (same for ssh/ftp) > > While I do get a Tramp failure, indeed, this does not prevent me from > typing the second :. I think the problem is more that the Tramp error > is very loud and makes you think it's the end of the world, whereas in > reality Emacs is still there waiting for you keep on typing. > >>> This could be fixed by modifying tramp-file-name-regexp like this: >>> (tramp-file-name-regexp "\\`/\\([^[/:]+\\|[^/]+]\\):.*:") >> This would be wrong. "/hostname:/path" is a valid remote file name, which >> would not be catched by your regexp. I didn't know and never use /hostname:, i always prefix it with method (e.g ssh). So i end up to this problem in anything by systematically translating path like /su:: /sudo:: or /hostname: by: /su:hostname: /sudo:hostname: /ssh:hostname: To achieve that i use (in a let) to avoid connecting before the second ":": (tramp-file-name-regexp "\\`/\\([^[/:]+\\|[^/]+]\\):.*:?") And i translate the matched string in the path with: ,---- | (defun anything-create-tramp-name (fname) | "Build filename for `anything-pattern' \ | like /su::, /sudo:: or /hostname:." | (apply #'tramp-make-tramp-file-name | (loop | with v = (tramp-dissect-file-name fname) | for i across v collect i))) `---- >> (For the records, I also dislike Tramp's syntactic ambiguity. But this is >> history, I guess we cannot change it anymore.) > > Everything can be changed. > >> In order to fix this problem, one could tweak >> `minibuffer-completion-predicate' in `minibuffer-completion-help', >> which is `file-exists-p' in the given case. > > I think we somehow need to make the error a bit more quiet. > Most of it needs to be done on Tramp's side, but maybe we can help it by > having the completion code warn Tramp that this is only used > for completion. Or maybe the completion code can catch the error and > just display it calmly. And/Or always translate like above to avoid as much as possible errors. > I wonder, tho: why is Tramp so loud? Shouldn't it just call `signal' > with appropriate parameters to indicate an error, without popping up > any window? > > > Stefan > > > > > > -- Thierry Volpiatto Gpg key: http://pgp.mit.edu/