Eshel Yaron <[email protected]> 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.
