From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.bugs Subject: bug#24889: 25.1; tramp-dissect-file-name signals a user-error for some invalid files Date: Tue, 08 Nov 2016 20:47:20 +0100 Message-ID: <87zil94uuv.fsf@gmx.de> References: <87twbkqt8p.fsf@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1478634502 1892 195.159.176.226 (8 Nov 2016 19:48:22 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 8 Nov 2016 19:48:22 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) Cc: 24889@debbugs.gnu.org, Thierry Volpiatto To: Alex Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Nov 08 20:48:14 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1c4CNM-00078D-IH for geb-bug-gnu-emacs@m.gmane.org; Tue, 08 Nov 2016 20:48:08 +0100 Original-Received: from localhost ([::1]:35095 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c4CNP-0007G1-Gb for geb-bug-gnu-emacs@m.gmane.org; Tue, 08 Nov 2016 14:48:11 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58770) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c4CNJ-0007Fu-8O for bug-gnu-emacs@gnu.org; Tue, 08 Nov 2016 14:48:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c4CNG-0007UF-Lx for bug-gnu-emacs@gnu.org; Tue, 08 Nov 2016 14:48:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:34600) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1c4CNG-0007U9-I9 for bug-gnu-emacs@gnu.org; Tue, 08 Nov 2016 14:48:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1c4CNG-000246-9W for bug-gnu-emacs@gnu.org; Tue, 08 Nov 2016 14:48:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Michael Albinus Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 08 Nov 2016 19:48:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24889 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 24889-submit@debbugs.gnu.org id=B24889.14786344507891 (code B ref 24889); Tue, 08 Nov 2016 19:48:02 +0000 Original-Received: (at 24889) by debbugs.gnu.org; 8 Nov 2016 19:47:30 +0000 Original-Received: from localhost ([127.0.0.1]:49998 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c4CMk-00023D-Fb for submit@debbugs.gnu.org; Tue, 08 Nov 2016 14:47:30 -0500 Original-Received: from mout.gmx.net ([212.227.17.22]:53390) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c4CMi-000230-UT for 24889@debbugs.gnu.org; Tue, 08 Nov 2016 14:47:29 -0500 Original-Received: from detlef.gmx.de ([93.209.66.244]) by mail.gmx.com (mrgmx101) with ESMTPSA (Nemesis) id 0MTfZc-1cD23F3dWS-00QS52; Tue, 08 Nov 2016 20:47:22 +0100 In-Reply-To: <87twbkqt8p.fsf@gmail.com> (Alex's message of "Sun, 06 Nov 2016 13:54:30 -0600") X-Provags-ID: V03:K0:/l+vxgqUifnCFNY9RtVRR5EIL4wnUdQTbxFIPFSJo65XxfsHwyw xd3lJkVpQfsp2Cl6I1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ence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.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" Xref: news.gmane.org gmane.emacs.bugs:125485 Archived-At: Alex writes: Hi Alex, > This user-error affects commands such as file-remote-p and ffap. I > believe that these should just return nil or no valid file instead of > signalling an error. > > Backtrace of (file-remote-p "/uref{http://test.com}": Thanks for the report. I could reproduce it also with Emacs 24.5. I've committed the following patch to the master branch, could you pls check whether this fixes the problem for you? --8<---------------cut here---------------start------------->8--- *** /home/albinus/src/emacs/lisp/net/tramp.el.~3424c27abb7c8ea64c32eaf54cf53fc58323e5ce~ 2016-11-08 20:22:58.382424617 +0100 --- /home/albinus/src/emacs/lisp/net/tramp.el 2016-11-08 20:21:39.625098305 +0100 *************** *** 867,890 **** See `tramp-file-name-structure' for more explanations.") ;;;###autoload ! (defconst tramp-file-name-regexp (cond ((equal tramp-syntax 'ftp) tramp-file-name-regexp-unified) ((equal tramp-syntax 'sep) tramp-file-name-regexp-separate) (t (error "Wrong `tramp-syntax' defined"))) "Regular expression matching file names handled by Tramp. ! This regexp should match Tramp file names but no other file names. ! When tramp.el is loaded, this regular expression is prepended to ! `file-name-handler-alist', and that is searched sequentially. Thus, ! if the Tramp entry appears rather early in the `file-name-handler-alist' ! and is a bit too general, then some files might be considered Tramp ! files which are not really Tramp files. ! ! Please note that the entry in `file-name-handler-alist' is made when ! this file \(tramp.el) is loaded. This means that this variable must be set ! before loading tramp.el. Alternatively, `file-name-handler-alist' can be ! updated after changing this variable. ! ! Also see `tramp-file-name-structure'.") ;;;###autoload (defconst tramp-completion-file-name-regexp-unified --- 867,880 ---- See `tramp-file-name-structure' for more explanations.") ;;;###autoload ! (defvar tramp-file-name-regexp (cond ((equal tramp-syntax 'ftp) tramp-file-name-regexp-unified) ((equal tramp-syntax 'sep) tramp-file-name-regexp-separate) (t (error "Wrong `tramp-syntax' defined"))) "Regular expression matching file names handled by Tramp. ! This regexp should match Tramp file names but no other file ! names. When calling `tramp-register-file-name-handlers', the ! initial value is overwritten by the car of `tramp-file-name-structure'.") ;;;###autoload (defconst tramp-completion-file-name-regexp-unified *************** *** 1055,1063 **** . tramp-completion-handle-file-name-all-completions) (file-name-completion . tramp-completion-handle-file-name-completion)) "Alist of completion handler functions. ! Used for file names matching `tramp-file-name-regexp'. Operations ! not mentioned here will be handled by Tramp's file name handler ! functions, or the normal Emacs functions.") ;; Handlers for foreign methods, like FTP or SMB, shall be plugged here. ;;;###tramp-autoload --- 1045,1053 ---- . tramp-completion-handle-file-name-all-completions) (file-name-completion . tramp-completion-handle-file-name-completion)) "Alist of completion handler functions. ! Used for file names matching `tramp-completion-file-name-regexp'. ! Operations not mentioned here will be handled by Tramp's file ! name handler functions, or the normal Emacs functions.") ;; Handlers for foreign methods, like FTP or SMB, shall be plugged here. ;;;###tramp-autoload *************** *** 2192,2197 **** --- 2182,2191 ---- tramp-autoload-file-name-handler)) (let ((a1 (rassq fnh file-name-handler-alist))) (setq file-name-handler-alist (delq a1 file-name-handler-alist)))) + ;; The initial value of `tramp-file-name-regexp' is too simple + ;; minded, but we cannot give it the real value in the autoload + ;; pattern. See Bug#24889. + (setq tramp-file-name-regexp (car tramp-file-name-structure)) ;; Add the handlers. (add-to-list 'file-name-handler-alist (cons tramp-file-name-regexp 'tramp-file-name-handler)) --8<---------------cut here---------------end--------------->8--- Best regards, Michael.