GNU bug report logs -
#24889
25.1; tramp-dissect-file-name signals a user-error for some invalid files
Previous Next
Reported by: Alex <agrambot <at> gmail.com>
Date: Sun, 6 Nov 2016 19:55:02 UTC
Severity: normal
Found in version 25.1
Fixed in version 26.1
Done: Michael Albinus <michael.albinus <at> gmx.de>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 24889 in the body.
You can then email your comments to 24889 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#24889
; Package
emacs
.
(Sun, 06 Nov 2016 19:55:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Alex <agrambot <at> gmail.com>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Sun, 06 Nov 2016 19:55:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
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}":
Debugger entered--Lisp error: (user-error "Not a Tramp file name: \"/uref{http://www.doc.ic.ac.uk/lab/cplus/c++.rules/}\"")
signal(user-error ("Not a Tramp file name: \"/uref{http://www.doc.ic.ac.uk/lab/cplus/c++.rules/}\""))
tramp-error(nil user-error "Not a Tramp file name: \"%s\"" "/uref{http://www.doc.ic.ac.uk/lab/cplus/c++.rules/}")
apply(tramp-error nil user-error "Not a Tramp file name: \"%s\"" "/uref{http://www.doc.ic.ac.uk/lab/cplus/c++.rules/}")
tramp-dissect-file-name("/uref{http://www.doc.ic.ac.uk/lab/cplus/c++.rules/}" t)
tramp-find-foreign-file-name-handler("/uref{http://www.doc.ic.ac.uk/lab/cplus/c++.rules/}")
tramp-file-name-handler(file-remote-p "/uref{http://www.doc.ic.ac.uk/lab/cplus/c++.rules/}" nil nil)
file-remote-p("/uref{http://www.doc.ic.ac.uk/lab/cplus/c++.rules/}")
Note that when the point is in @uref in the following:
@uref{http://test.com}
then in Emacs 25.1+ ffap will signal the user-error as well.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#24889
; Package
emacs
.
(Tue, 08 Nov 2016 09:09:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 24889 <at> debbugs.gnu.org (full text, mbox):
Thierry Volpiatto <thierry.volpiatto <at> gmail.com> writes:
> Hi Michael,
Hi Thierry,
> I have a bug report at helm about an error when calling helm-find-files
> on a string like `@uref{http://www.doc.ic.ac.uk/lab/cplus/c++.rules/}`.
> Seeing the backtrace, it looks it comes from `file-remote-p` which
> return a user-error in such case, perhaps it should return nil ?
>
> See https://github.com/emacs-helm/helm/issues/1638
Sorry that I come that late to you; I have been offline for a couple of days.
> Note that this is not reproductible on emacs-24.5.
I could reproduce it also on Emacs 24.5.
Anyway, I've started yesterday working on this. Not trivial to fix, I
fear. As consequence, any fix will go into the master branch (Emacs 26)
only.
There is also the bug report #24889 about this. Further communication
shall happen there.
> Thanks.
Best regards, Michael.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#24889
; Package
emacs
.
(Tue, 08 Nov 2016 17:19:02 GMT)
Full text and
rfc822 format available.
Message #11 received at 24889 <at> debbugs.gnu.org (full text, mbox):
Michael Albinus <michael.albinus <at> gmx.de> writes:
> Sorry that I come that late to you; I have been offline for a couple of days.
No urgency ;-).
>> Note that this is not reproductible on emacs-24.5.
>
> I could reproduce it also on Emacs 24.5.
Hmm, I will try again there to reproduce.
> Anyway, I've started yesterday working on this.
Great thanks.
> Not trivial to fix, I fear.
Yes, I saw the tramp-file-name-structure regexp is not trivial!
> As consequence, any fix will go into the master branch (Emacs 26)
> only.
Ok.
> There is also the bug report #24889 about this. Further communication
> shall happen there.
Ah, I see, probably it is the same user.
Thanks.
--
Thierry
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#24889
; Package
emacs
.
(Tue, 08 Nov 2016 19:48:02 GMT)
Full text and
rfc822 format available.
Message #14 received at 24889 <at> debbugs.gnu.org (full text, mbox):
Alex <agrambot <at> gmail.com> 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.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#24889
; Package
emacs
.
(Tue, 08 Nov 2016 20:19:01 GMT)
Full text and
rfc822 format available.
Message #17 received at 24889 <at> debbugs.gnu.org (full text, mbox):
Michael Albinus <michael.albinus <at> gmx.de> writes:
> Alex <agrambot <at> gmail.com> 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?
With the latest master it seems to have fixed the problem, thanks.
Reply sent
to
Michael Albinus <michael.albinus <at> gmx.de>
:
You have taken responsibility.
(Tue, 08 Nov 2016 20:23:02 GMT)
Full text and
rfc822 format available.
Notification sent
to
Alex <agrambot <at> gmail.com>
:
bug acknowledged by developer.
(Tue, 08 Nov 2016 20:23:02 GMT)
Full text and
rfc822 format available.
Message #22 received at 24889-done <at> debbugs.gnu.org (full text, mbox):
Version: 26.1
Alex <agrambot <at> gmail.com> writes:
Hi Alex,
>> I've committed the following patch to the master branch, could you pls
>> check whether this fixes the problem for you?
>
> With the latest master it seems to have fixed the problem, thanks.
Thanks for checking. I'm closing the bug.
Best regards, Michael.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Wed, 07 Dec 2016 12:24:04 GMT)
Full text and
rfc822 format available.
This bug report was last modified 8 years and 247 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.