* [bug?] Tramp tries to open remote file links
@ 2014-06-18 9:08 Sebastien Vauban
2014-06-18 9:44 ` Nicolas Richard
2014-06-18 10:14 ` Michael Albinus
0 siblings, 2 replies; 23+ messages in thread
From: Sebastien Vauban @ 2014-06-18 9:08 UTC (permalink / raw)
To: emacs-orgmode-mXXj517/zsQ
Hello,
When I just open an Org file that has a link to a remote file, Tramp
tries to open it, leading to errors and timeouts when offline, at least.
--8<---------------cut here---------------start------------->8---
* References
Some files of interest:
[[file:/me-oHC15RC7JGTNLxjTenLetw@public.gmane.org:papers/current.pdf][paper]]
--8<---------------cut here---------------end--------------->8---
Errors:
╭────
│ Tramp: Opening connection for me-oHC15RC7JGTNLxjTenLetw@public.gmane.org using plink...
│ Tramp: Sending command `plink -l me -ssh -t somewhere.org " env 'TERM=dumb' 'PROMPT_COMMAND=' 'PS1=#$ ' /bin/sh " && exit || exit'
│ Tramp: Waiting for prompts from remote shell...
│ Tramp failed to connect. If this happens repeatedly, try
│ `M-x tramp-cleanup-this-connection'
│ Tramp: Waiting for prompts from remote shell...failed
│ Tramp: Opening connection for me-oHC15RC7JGTNLxjTenLetw@public.gmane.org using plink...failed
╰────
Is this supposed to be normal? Why does Tramp open the file?
Best regards,
Seb
--
Sebastien Vauban
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [bug?] Tramp tries to open remote file links
2014-06-18 9:08 [bug?] Tramp tries to open remote file links Sebastien Vauban
@ 2014-06-18 9:44 ` Nicolas Richard
2014-06-18 12:29 ` Sebastien Vauban
2014-06-18 10:14 ` Michael Albinus
1 sibling, 1 reply; 23+ messages in thread
From: Nicolas Richard @ 2014-06-18 9:44 UTC (permalink / raw)
To: Sebastien Vauban; +Cc: public-emacs-orgmode-mXXj517/zsQ
Sebastien Vauban <sva-news-D0wtAvR13HarG/iDocfnWg@public.gmane.org>
writes:
> Hello,
>
> When I just open an Org file that has a link to a remote file, Tramp
> tries to open it, leading to errors and timeouts when offline, at least.
It doesn't happen to me. I tried "emacs -Q path/to/test.org" and the
file opened normally.
Grepping, I see that tramp-maybe-open-connection is responsible for the
tramp messages. so you could eval:
(trace-function-background
'tramp-maybe-open-connection
"*trace*"
(lambda () (with-output-to-string (backtrace))))
then reproduce and look into the buffer *trace* to see what called
tramp.
Call M-x untrace-function RET TAB RET to remove the tracing.
--
Nico.
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [bug?] Tramp tries to open remote file links
2014-06-18 9:44 ` Nicolas Richard
@ 2014-06-18 12:29 ` Sebastien Vauban
2014-06-18 13:17 ` Nicolas Richard
2014-06-18 13:26 ` Michael Albinus
0 siblings, 2 replies; 23+ messages in thread
From: Sebastien Vauban @ 2014-06-18 12:29 UTC (permalink / raw)
To: emacs-orgmode-mXXj517/zsQ
Hello Nicolas,
Nicolas Richard wrote:
> Sebastien Vauban writes:
>> When I just open an Org file that has a link to a remote file, Tramp
>> tries to open it, leading to errors and timeouts when offline, at least.
>
> It doesn't happen to me. I tried "emacs -Q path/to/test.org" and the
> file opened normally.
>
> Grepping, I see that tramp-maybe-open-connection is responsible for the
> tramp messages. so you could eval:
> (trace-function-background
> 'tramp-maybe-open-connection
> "*trace*"
> (lambda () (with-output-to-string (backtrace))))
>
> then reproduce and look into the buffer *trace* to see what called
> tramp.
--8<---------------cut here---------------start------------->8---
1 -> (tramp-maybe-open-connection [#("plink" 0 5 (tramp-default t)) "myself" "some.where.org" "papers/last.pdf" nil]) backtrace()
(let ((standard-output standard-output)) (backtrace))
(progn (let ((standard-output standard-output)) (backtrace)) (save-current-buffer (set-buffer standard-output) (buffer-string)))
(unwind-protect (progn (let ((standard-output standard-output)) (backtrace)) (save-current-buffer (set-buffer standard-output) (buffer-string))) (kill-buffer standard-output))
(let ((standard-output (get-buffer-create (generate-new-buffer-name " *string-output*")))) (unwind-protect (progn (let ((standard-output standard-output)) (backtrace)) (save-current-buffer (set-buffer standard-output) (buffer-string))) (kill-buffer standard-output)))
(lambda nil (let ((standard-output (get-buffer-create (generate-new-buffer-name " *string-output*")))) (unwind-protect (progn (let ((standard-output standard-output)) (backtrace)) (save-current-buffer (set-buffer standard-output) (buffer-string))) (kill-buffer standard-output))))()
<... lots of contents...>
org-mode()
set-auto-mode-0(org-mode nil)
set-auto-mode()
normal-mode(t)
after-find-file(nil t)
find-file-noselect-1(#<buffer test.org> "~/test.org" nil nil "~/test.org" ((8960 3 . 4947) (24647 . 36859)))
find-file-noselect("~/test.org" nil nil t)
(with-no-warnings (funcall ad--addoit-function filename wildcards))
(setq ad-return-value (with-no-warnings (funcall ad--addoit-function filename wildcards)))
(let ((filename filename) (find-file-time-start (float-time))) (message "(Info) Finding file %s..." filename) (setq ad-return-value (with-no-warnings (funcall ad--addoit-function filename wildcards))) (message "(Info) Found file %s in %.2f s" filename (- (float-time) find-file-time-start)))
(let (ad-return-value) (let ((filename filename) (find-file-time-start (float-time))) (message "(Info) Finding file %s..." filename) (setq ad-return-value (with-no-warnings (funcall ad--addoit-function filename wildcards))) (message "(Info) Found file %s in %.2f s" filename (- (float-time) find-file-time-start))) ad-return-value)
ad-Advice-find-file(...
find-file("~/test.org" t)
funcall-interactively(find-file "~/test.org" t)
call-interactively(find-file nil nil)
command-execute(find-file)
--8<---------------cut here---------------end--------------->8---
See http://screencast.com/t/pXrFeTR5J9
for a video of the full trace.
And, yes, I do have an advice around find-file:
--8<---------------cut here---------------start------------->8---
(defadvice find-file (around leuven-find-file activate)
"Open the file named FILENAME and report time spent."
(let ((filename (ad-get-arg 0))
(find-file-time-start (float-time)))
(message "(Info) Finding file %s..." filename)
ad-do-it
(message "(Info) Found file %s in %.2f s" filename
(- (float-time) find-file-time-start))))
--8<---------------cut here---------------end--------------->8---
Though, commenting that did not solve the current problem at hand...
Best regards,
Seb
--
Sebastien Vauban
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [bug?] Tramp tries to open remote file links
2014-06-18 12:29 ` Sebastien Vauban
@ 2014-06-18 13:17 ` Nicolas Richard
2014-06-18 13:25 ` Sebastien Vauban
2014-06-18 13:26 ` Michael Albinus
1 sibling, 1 reply; 23+ messages in thread
From: Nicolas Richard @ 2014-06-18 13:17 UTC (permalink / raw)
To: Sebastien Vauban; +Cc: public-emacs-orgmode-mXXj517/zsQ
Sebastien Vauban <sva-news-D0wtAvR13HarG/iDocfnWg@public.gmane.org>
writes:
>
> <... lots of contents...>
>
> org-mode()
This means that org-mode calls things which in the end calls
tramp-maybe-open-connection. But what "something" is is in the "lots of
contents" part that you didn't show. Unfortunately a video isn't very
searchable.
Still, I spotted that org-element-context is called at some point, which
in turn calls org-element-link-parser, and that's what does
expand-file-name. Perhaps that would be a bug ?
--
Nico.
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [bug?] Tramp tries to open remote file links
2014-06-18 13:17 ` Nicolas Richard
@ 2014-06-18 13:25 ` Sebastien Vauban
2014-06-18 13:49 ` Michael Albinus
2014-06-18 14:28 ` Nicolas Richard
0 siblings, 2 replies; 23+ messages in thread
From: Sebastien Vauban @ 2014-06-18 13:25 UTC (permalink / raw)
To: emacs-orgmode-mXXj517/zsQ
Nicolas Richard wrote:
> Sebastien Vauban writes:
>
>> org-mode()
>
> This means that org-mode calls things which in the end calls
> tramp-maybe-open-connection. But what "something" is is in the "lots
> of contents" part that you didn't show. Unfortunately a video isn't
> very searchable.
>
> Still, I spotted that org-element-context is called at some point,
> which in turn calls org-element-link-parser, and that's what does
> expand-file-name. Perhaps that would be a bug ?
I found out the responsible line in my setup:
--8<---------------cut here---------------start------------->8---
;; show inline images when loading a new Org file
(setq org-startup-with-inline-images t)
--8<---------------cut here---------------end--------------->8---
With it, the problem occurs; without, it does not.
Though, is it normal to try to open a remote PDF file while Emacs is
unable of displaying it in the buffer (unlike PNG files, IIUC)?
Maybe that's not a bug per se, but rather a feature that should only be
enabled for specific file extensions?
Best regards,
Seb
--
Sebastien Vauban
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [bug?] Tramp tries to open remote file links
2014-06-18 13:25 ` Sebastien Vauban
@ 2014-06-18 13:49 ` Michael Albinus
[not found] ` <8761jy1g5f.fsf-Mmb7MZpHnFY@public.gmane.org>
2014-06-18 14:28 ` Nicolas Richard
1 sibling, 1 reply; 23+ messages in thread
From: Michael Albinus @ 2014-06-18 13:49 UTC (permalink / raw)
To: Sebastien Vauban; +Cc: public-emacs-orgmode-mXXj517/zsQ
Sebastien Vauban <sva-news-D0wtAvR13HarG/iDocfnWg@public.gmane.org>
writes:
> Though, is it normal to try to open a remote PDF file while Emacs is
> unable of displaying it in the buffer (unlike PNG files, IIUC)?
Emacs is also able to open and display a remote PDF file.
> Maybe that's not a bug per se, but rather a feature that should only be
> enabled for specific file extensions?
I wouldn't parse URI-like file names in org-mode at all. There is
url-handlers.el, which shall do it proper.
> Best regards,
> Seb
Best regards, Michael.
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [bug?] Tramp tries to open remote file links
2014-06-18 13:25 ` Sebastien Vauban
2014-06-18 13:49 ` Michael Albinus
@ 2014-06-18 14:28 ` Nicolas Richard
2014-06-18 17:25 ` Nicolas Goaziou
1 sibling, 1 reply; 23+ messages in thread
From: Nicolas Richard @ 2014-06-18 14:28 UTC (permalink / raw)
To: Sebastien Vauban; +Cc: public-emacs-orgmode-mXXj517/zsQ, Nicolas Goaziou
Sebastien Vauban <sva-news-D0wtAvR13HarG/iDocfnWg@public.gmane.org>
> With it, the problem occurs; without, it does not.
Also note that this is a problem in master only ; maint has an older
version of org-display-inline-images which doesn't use org-element.
> Though, is it normal to try to open a remote PDF file while Emacs is
> unable of displaying it in the buffer (unlike PNG files, IIUC)?
Org Mode is not trying to display the PDF (at least not at that point).
The problems occurs when parsing the buffer : org-element-link-parser
uses expand-file-name to normalize the URI. Should it ? IDK. Nicolas
G might have an opinion on this.
--
Nico.
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [bug?] Tramp tries to open remote file links
2014-06-18 14:28 ` Nicolas Richard
@ 2014-06-18 17:25 ` Nicolas Goaziou
0 siblings, 0 replies; 23+ messages in thread
From: Nicolas Goaziou @ 2014-06-18 17:25 UTC (permalink / raw)
To: Nicolas Richard; +Cc: public-emacs-orgmode-mXXj517/zsQ, Sebastien Vauban
Hello,
Nicolas Richard <theonewiththeevillook@yahoo.fr> writes:
> Org Mode is not trying to display the PDF (at least not at that point).
> The problems occurs when parsing the buffer : org-element-link-parser
> uses expand-file-name to normalize the URI. Should it ? IDK. Nicolas
> G might have an opinion on this.
I guess the only way to know is to remove `expand-file-name'. We'll see
if someone complains.
Done in master.
Regards,
--
Nicolas Goaziou
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [bug?] Tramp tries to open remote file links
2014-06-18 12:29 ` Sebastien Vauban
2014-06-18 13:17 ` Nicolas Richard
@ 2014-06-18 13:26 ` Michael Albinus
1 sibling, 0 replies; 23+ messages in thread
From: Michael Albinus @ 2014-06-18 13:26 UTC (permalink / raw)
To: Sebastien Vauban; +Cc: public-emacs-orgmode-mXXj517/zsQ
Sebastien Vauban <sva-news-D0wtAvR13HarG/iDocfnWg@public.gmane.org>
writes:
> <... lots of contents...>
Well, Tramp is invoked via (expand-file-name "/myself@..."). The call
hierarchy is (if I haven't overseen something)
expand-file-name
org-element-link-parser
org-element-context
org-image-file-name-regexp
org-display-inline-images
org-mode
Maybe it is worth to find out, why org-display-inline-images is invoked?
> Best regards,
> Seb
Best regards, Michael.
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [bug?] Tramp tries to open remote file links
2014-06-18 9:08 [bug?] Tramp tries to open remote file links Sebastien Vauban
2014-06-18 9:44 ` Nicolas Richard
@ 2014-06-18 10:14 ` Michael Albinus
2014-06-18 12:18 ` Sebastien Vauban
1 sibling, 1 reply; 23+ messages in thread
From: Michael Albinus @ 2014-06-18 10:14 UTC (permalink / raw)
To: Sebastien Vauban; +Cc: public-emacs-orgmode-mXXj517/zsQ
Sebastien Vauban <sva-news-D0wtAvR13HarG/iDocfnWg@public.gmane.org>
writes:
> Hello,
Hi Sebastien,
> When I just open an Org file that has a link to a remote file, Tramp
> tries to open it, leading to errors and timeouts when offline, at least.
>
> * References
>
> Some files of interest:
>
> [[file:/me-oHC15RC7JGTNLxjTenLetw@public.gmane.org:papers/current.pdf][paper]]
>
> Errors:
>
> ╭────
> │ Tramp: Opening connection for
> me-oHC15RC7JGTNLxjTenLetw@public.gmane.org using plink...
> │ Tramp: Sending command `plink -l me -ssh -t somewhere.org " env
> 'TERM=dumb' 'PROMPT_COMMAND=' 'PS1=#$ ' /bin/sh " && exit || exit'
> │ Tramp: Waiting for prompts from remote shell...
> │ Tramp failed to connect. If this happens repeatedly, try
> │ `M-x tramp-cleanup-this-connection'
> │ Tramp: Waiting for prompts from remote shell...failed
> │ Tramp: Opening connection for
> me-oHC15RC7JGTNLxjTenLetw@public.gmane.org using plink...failed
> ╰────
>
> Is this supposed to be normal? Why does Tramp open the file?
Because Tramp has been instructed so? I suppose, following the above
link results in
(insert-file-contents "/me-oHC15RC7JGTNLxjTenLetw@public.gmane.org:papers/current.pdf")
This is remote file name syntax, and Tramp tries to do its job, using
the default method "plink". You could avoid Tramp's reaction by a link
like (untested)
[[file:/:/me-oHC15RC7JGTNLxjTenLetw@public.gmane.org:papers/current.pdf][paper]]
Alternatively, you could choose another file name.
> Best regards,
> Seb
Best regards, Michael.
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [bug?] Tramp tries to open remote file links
2014-06-18 10:14 ` Michael Albinus
@ 2014-06-18 12:18 ` Sebastien Vauban
2014-06-18 12:49 ` Michael Albinus
0 siblings, 1 reply; 23+ messages in thread
From: Sebastien Vauban @ 2014-06-18 12:18 UTC (permalink / raw)
To: emacs-orgmode-mXXj517/zsQ
Michael Albinus wrote:
> Sebastien Vauban writes:
>> When I just open an Org file that has a link to a remote file, Tramp
>> tries to open it, leading to errors and timeouts when offline, at least.
>>
>> * References
>>
>> Some files of interest:
>>
>> [[file:/me-oHC15RC7JGTNLxjTenLetw@public.gmane.org:papers/current.pdf][paper]]
>>
>> Is this supposed to be normal? Why does Tramp open the file?
>
> Because Tramp has been instructed so? I suppose, following the above
> link results in
I think we did not understand each other (or did we?) because that's the
thing: I don't follow the link, I just open the file which contains such
a link.
See http://screencast.com/t/aXoxf9D1P.
> (insert-file-contents "/me-oHC15RC7JGTNLxjTenLetw@public.gmane.org:papers/current.pdf")
>
> This is remote file name syntax, and Tramp tries to do its job, using
> the default method "plink". You could avoid Tramp's reaction by a link
> like (untested)
>
> [[file:/:/me-oHC15RC7JGTNLxjTenLetw@public.gmane.org:papers/current.pdf][paper]]
>
> Alternatively, you could choose another file name.
Best regards,
Seb
--
Sebastien Vauban
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [bug?] Tramp tries to open remote file links
2014-06-18 12:18 ` Sebastien Vauban
@ 2014-06-18 12:49 ` Michael Albinus
0 siblings, 0 replies; 23+ messages in thread
From: Michael Albinus @ 2014-06-18 12:49 UTC (permalink / raw)
To: Sebastien Vauban; +Cc: public-emacs-orgmode-mXXj517/zsQ
Sebastien Vauban <sva-news-D0wtAvR13HarG/iDocfnWg@public.gmane.org>
writes:
>>> Is this supposed to be normal? Why does Tramp open the file?
>>
>> Because Tramp has been instructed so? I suppose, following the above
>> link results in
>
> I think we did not understand each other (or did we?) because that's the
> thing: I don't follow the link, I just open the file which contains such
> a link.
It doesn't for me, when I have a simple org file with just your
example. I use org 8.2.6.
Do you have some customization, which let org expand links per default?
Does it also happen when you start "emacs -Q"?
Or do you have some customization code in the file itself? Local
variables, code snippets to be evaluated when opening the file?
> See http://screencast.com/t/aXoxf9D1P.
This does not work for me :-(
> Best regards,
> Seb
Best regards, Michael.
^ permalink raw reply [flat|nested] 23+ messages in thread
end of thread, other threads:[~2014-06-20 10:52 UTC | newest]
Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-18 9:08 [bug?] Tramp tries to open remote file links Sebastien Vauban
2014-06-18 9:44 ` Nicolas Richard
2014-06-18 12:29 ` Sebastien Vauban
2014-06-18 13:17 ` Nicolas Richard
2014-06-18 13:25 ` Sebastien Vauban
2014-06-18 13:49 ` Michael Albinus
[not found] ` <8761jy1g5f.fsf-Mmb7MZpHnFY@public.gmane.org>
2014-06-18 13:52 ` Sebastien Vauban
2014-06-18 14:03 ` Michael Albinus
2014-06-18 14:20 ` Sebastien Vauban
2014-06-18 15:11 ` Michael Albinus
2014-06-18 15:53 ` Sebastien Vauban
2014-06-18 16:11 ` Nick Dokos
2014-06-19 8:21 ` Sebastien Vauban
2014-06-19 9:07 ` Michael Albinus
2014-06-19 21:59 ` Andreas Leha
2014-06-20 7:46 ` Sebastien Vauban
2014-06-20 10:52 ` Andreas Leha
2014-06-18 14:28 ` Nicolas Richard
2014-06-18 17:25 ` Nicolas Goaziou
2014-06-18 13:26 ` Michael Albinus
2014-06-18 10:14 ` Michael Albinus
2014-06-18 12:18 ` Sebastien Vauban
2014-06-18 12:49 ` Michael Albinus
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).