emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] [bug?] Tramp tries to open remote file links


From: Sebastien Vauban
Subject: Re: [O] [bug?] Tramp tries to open remote file links
Date: Wed, 18 Jun 2014 14:29:28 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (windows-nt)

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]