tramp-devel
[Top][All Lists]
Advanced

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

question about `tramp-file-name-handler'


From: Thierry Volpiatto
Subject: question about `tramp-file-name-handler'
Date: Sat, 26 Jan 2013 18:53:24 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.92 (gnu/linux)

Hi Michael,
I see that in `tramp-file-name-handler' you fall back to
`tramp-run-real-handler' when 'suppress is thrown by
`tramp-sh-file-name-handler'.

Here the problem I have with this:
The process I run on remote host is "find" shell command.

I run quickly on remote:

"find process" => "kill this process" => "find process"
                  (less than 5s delay)

The second "find process" is running now locally (It fallback to
`tramp-run-real-handler')

So my question is why running `tramp-run-real-handler' when 'suppress is
thrown ?
Isn't there a better solution ? (possibly with delaying the next call to
process?)

I fixed the problem here by stopping call to process during 5s in a
sentinel:

--8<---------------cut here---------------start------------->8---
(when (string= event "finished\n")
      (when (or (file-remote-p (helm-default-directory))
                helm-suspend-update-flag)
        (setq helm-suspend-update-flag t)
        ;; When tramp tries to open the same connection twice in a
        ;; short time frame (less than 5s) it throw 'suppress which
        ;; call the real-handler on the main "Emacs", so we wait
        ;; 5s before updating to avoid this, but allowing user to
        ;; enter input during this delay.
        (run-at-time 5 nil #'(lambda ()
          (setq helm-suspend-update-flag nil)
          (helm-check-minibuffer-input)))))
--8<---------------cut here---------------end--------------->8---

It is working fine, but I would like something more general, possibly a
flag or similar.
Maybe you have an idea?

Thanks.

-- 
  Thierry
Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997 




reply via email to

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