From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.devel Subject: Re: Change Tramp syntax Date: Sun, 12 Mar 2017 10:10:28 +0100 Message-ID: <874lyyhncr.fsf@detlef> References: <20170309184457.29604.13048@vcs0.savannah.gnu.org> <20170309184458.08C9725FCF@vcs0.savannah.gnu.org> <87k27xfo3q.fsf@detlef> <87efy5fmml.fsf@detlef> <87mvcti5he.fsf_-_@detlef> <8760jfegz4.fsf@detlef> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1489309882 7767 195.159.176.226 (12 Mar 2017 09:11:22 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 12 Mar 2017 09:11:22 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Mar 12 10:11:19 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cmzX3-00015a-TV for ged-emacs-devel@m.gmane.org; Sun, 12 Mar 2017 10:11:18 +0100 Original-Received: from localhost ([::1]:46277 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cmzX6-0006au-Hw for ged-emacs-devel@m.gmane.org; Sun, 12 Mar 2017 05:11:20 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56616) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cmzWS-0006ao-V8 for emacs-devel@gnu.org; Sun, 12 Mar 2017 05:10:42 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cmzWP-0004Ui-Oy for emacs-devel@gnu.org; Sun, 12 Mar 2017 05:10:40 -0400 Original-Received: from mout.gmx.net ([212.227.17.20]:56373) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cmzWP-0004UI-Cy for emacs-devel@gnu.org; Sun, 12 Mar 2017 05:10:37 -0400 Original-Received: from detlef.gmx.de ([87.146.62.175]) by mail.gmx.com (mrgmx103 [212.227.17.168]) with ESMTPSA (Nemesis) id 0LmrZY-1cJQT443uW-00h45i; Sun, 12 Mar 2017 10:10:31 +0100 In-Reply-To: (Stefan Monnier's message of "Sat, 11 Mar 2017 16:54:13 -0500") X-Provags-ID: V03:K0:Yf5ymRzt2AYgtrxMh7UHF3a/ESbrh0bSYr84du6LMwfDU4/lQ6L EFymoLp81jeDoSbMcWmVff23sqqoYr5MYaKLrUVIRq8Q0/hqtWiX6dPvHEoSdrRf9Rveswk pe+5NoIgiUrOxHvawPeHQtcVqGL5dvtauoG707CSg5Gnihp1H2omaUqbyjL9CNkoaGAhEzB /gWdd84Fpw1PjgiZddPyg== X-UI-Out-Filterresults: notjunk:1;V01:K0:QrJc5DcgJKo=:Zmbinchpi+01fJqI5P6NcG +WG1Fpmc+S+zhLQyJIua1FhAuNhdEdwG6B1xyKFqDCuyuYs+HCf4ZTK98pzGDllJXHKcUv9oT lq0hxEGJ6HVpwpPsIRuoNmSLnrOY/g8UQ1EZqN6rNcAbRy4ChhLES0QYt/BltaE+Rxla+SEiD MmO7F59juzYl3rrtFjyZ5B6LavF72qmu3jqv1Os54Sqtd2YhEikR50NE10Y5Cyw7rnidynqqT swTea0RePZBHjfNDI3kXTP0pk/PYvfTh/o+KFx9yBzJkqGA89hjQr3FbdrYK7na0MlcTARR3Q x37nyVeRt2pe5fT+Jd3/TgwK4+zJ0LxJo0c+9V2OcMASCM9XLfQjZ+jgAPrBXvB2abb9a6O+o IEUgm9ty4bPNIGUdI76T71SrXefjbBy0bywplki0QIZwF4ASzWY9GuVgekCjVrZh5+c68hlVy 9R+c52c+0Jckwc2rzxUJrvbdk0TavZI/J6VU6cLRfBU2h0EI/oAXswEsw7jmXwhZCy+DWKI3D YrSkswZa8syb83AjRuCTiuvNRquZfMHkeP/ODiaOc8yGA9D4YeXppZyy4XOr3rN+IRvozAfFc U+f/FiUakEedXt9XZIcqQKjHdhUZ4Kh2P2ybbf3jg6YE+lO9pFc7wviHD5WpZ2Eh2W8kMGZHL H1cBPIL1sgV1FWX78SrqO2R4xWFgFd1vCv0B9SBI/dacm2xL5xF9/XOeTxb2wruhzm5YK/ewq 8lq0cr8nWp06ewlZ6Ubap+y9cFTiyCed0KorCypAmr5gOSOamPzviS1jeMuY55zYZeFM0SdP X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 212.227.17.20 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:212936 Archived-At: Stefan Monnier writes: Hi Stefan, > I don't understand this either. Currently I see two Tramp entries in > f-n-h-alist: > > ("\\`/[^/]*\\'" . tramp-completion-file-name-handler) > ("^/\\(\\(?:\\(?:\\([a-zA-Z_0-9-]+\\):\\)?\\(?:\\([^/|: ]+\\)@\\)?\\(\\(?:[a-zA-Z0-9_.-]+\\|\\[\\(?:\\(?:\\(?:[a-zA-Z0-9]+\\)?:\\)+[a-zA-Z0-9.]+\\)?]\\)\\(?:#[0-9]+\\)?\\)?|\\)+\\)?\\(?:\\([a-zA-Z_0-9-]+\\):\\)?\\(?:\\([^/|: ]+\\)@\\)?\\(\\(?:[a-zA-Z0-9_.-]+\\|\\[\\(?:\\(?:\\(?:[a-zA-Z0-9]+\\)?:\\)+[a-zA-Z0-9.]+\\)?]\\)\\(?:#[0-9]+\\)?\\)?:\\(.*$\\)" . tramp-file-name-handler) > > Neither of those regexps seems to handle an /ssh: prefix differently > from a /host: prefix. The first file name handler is intended to perform method, user name and host name completion. It offers only handlers for `expand-file-name', `file-name-all-completions' and `file-name-completion', everything else will be handled either by `tramp-file-name-handler' (if the regexp matches that handler), or by the native file name operation. In `tramp-completion-handle-file-name-all-completions' it checks for both possibilities, "/ssh:" and "/host:". The second file name handler is intended to handle everything else. It also performs a check, that a host name is not a method. But this is not part of the regexp; this check is performed in `tramp-maybe-open-connection', when a remote connection is being opened. It would be preferable to extend the second regexp such a way, that remote file names like "/ssh:whatever" are not allowed. But this is not possible, because the method names to be excluded as host names are not known at the time this file name handler is installed in `file-name-handler-alist'. If we discard ange-ftp syntax, the two entries would look like ("\\`/\\(-:\\)?[^:]*\\'" . tramp-completion-file-name-handler) ("\\`/[a-zA-Z_0-9-]+:\\([^/|: \t]+@\\)?[a-zA-Z0-9_.-]+:" ;; method user name host name . tramp-file-name-handler) The two regexps don't overlap any longer, which is the key. Of course, the second regexp must be more complex, due to the multi-hop syntax, due to Samba domains, due to IPv6 addresses, and due to port numbers. But you see the idea. > Stefan Best regards, Michael.