[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to autoload Tramp methods
From: |
Michael Albinus |
Subject: |
Re: How to autoload Tramp methods |
Date: |
Tue, 08 Oct 2024 11:51:24 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
Eshel Yaron <me@eshelyaron.com> writes:
> Hello Michael, all,
Hi Eshel,
sorry for the late reply, I was out of order last days.
> Is it possible to autoload a Tramp method that some extension provides?
>
> My problem is as follows: package foo-tramp defines a Tramp method foo.
> It also, for example, provides an autoloaded command foo-dired that
> starts Dired in some remote foo directory. From that Dired buffer I use
> C-x C-f to open some other remote file via the same foo method, now I
> have a remote foo file name in my file name history. So far so good.
> But then at some point I restart Emacs, and I want to find that remote
> file again. The file name is in my history so I can dig it up with M-p
> in the C-x C-f prompt. However, since I didn't invoke foo-dired or any
> command from the foo-tramp package or otherwise loaded that package yet,
> Tramp doesn't know about the foo method and I get an error:
> "Method ‘foo’ is not known"
>
> Can package foo-tramp somehow arrange to be autoloaded when the foo
> method is used?
Tramp recognizes the "foo" method in remote file names if tramp-methods
contains an entry for "foo". So you might autoload the settings for
"foo" in your foo-tramp package. See the approach in tramp-container.el.
However, you must replace the ;;;###tramp-autoload cookie by ;;;###autoload.
Or see the ELPA packages lxc-tramp, lxd-tramp or incus-tramp.
> Thanks,
>
> Eshel
Best regards, Michael.
- How to autoload Tramp methods, Eshel Yaron, 2024/10/05
- Re: How to autoload Tramp methods,
Michael Albinus <=
- Re: How to autoload Tramp methods, Eshel Yaron, 2024/10/08
- Re: How to autoload Tramp methods, Michael Albinus, 2024/10/08
- Re: How to autoload Tramp methods, Eshel Yaron, 2024/10/08
- Re: How to autoload Tramp methods, Michael Albinus, 2024/10/08
- Re: How to autoload Tramp methods, Eshel Yaron, 2024/10/08
- Re: How to autoload Tramp methods, Michael Albinus, 2024/10/08
- Re: How to autoload Tramp methods, Eshel Yaron, 2024/10/09
- Re: How to autoload Tramp methods, Michael Albinus, 2024/10/09