Eduardo Ochs <[email protected]> writes:

> Hi list,

Hi Eduardo,

> Here is a first question. If I run this,
>
>   (setq trd-fname "/scp:edrx@linode:/home/edrx/public_html/o")
>   (setq trd-vec (with-parsed-tramp-file-name trd-fname nil v))

The canonical way in Tramp is

(setq trd-vec (tramp-dissect-file-name trd-fname))

>   (setq trd-dbgb (tramp-debug-buffer-name trd-vec))
>   (setq tramp-verbose 6)

I recommend to set instead

(setq tramp-debug-command-messages t)

This gives you just the primitive file operations which trigger Tramp
(level (4)/(5)) and the sent commands plus received output (level 6).

>   (find-file trd-fname)

> that doesn't depend on anything from eev, the `find-file' at the end
> opens a file on the server that hosts my home page - but it only
> returns after several seconds, and after writing lots of messages
> on the debug buffer whose name is in the variable `trd-dbgb', i.e,
> "*debug tramp/scp edrx@linode*"...
>
> How can I write a function that works like the `find-file' at the end
> of that code but that runs asynchronously, in the sense that it starts
> the mechanisms that open trd-fname in the current window, but it
> returns immediately?

Some years ago, there was an attempt to use threads in Tramp. This
failed.

What you could do is to run a timer. Something like

(run-with-idle-timer 0 nil #'find-file trd-fname)

But likely, it won't help too much, because it still executes
synchronously.

Then there is the ELPA package async. I have no experience with it, but
it could help. Its README mentions Tramp explicitly.

>   Cheers, thanks in advance, more soon, etc,
>     Eduardo Ochs...

Best regards, Michael.

Reply via email to