4

Is it considered better to use TRAMP to access remote files on a local copy of Emacs, or to ssh into the remote server and access the files using a remote copy of Emacs in the ssh session?

What are some of the considerations involved in making this decision?

7

Since TRAMP uses ssh by default, the real question you are asking is if you should use local or remote emacs to edit remote files. Right?

Is it considered better to use ...

There is no better, just that use cases differ for both local and remote editing.

What are some of the considerations involved in making this decision?

If you normally work with a variety of servers as part of your workflow, then use local Emacs with TRAMP. On the other hand, if you access remote server from a variety of clients, laptops, locations, or devices, then ssh into the server might be more convenient.

The size of the edits and any compilation needs also need to be taken into consideration. You can avoid large file downloads and uploads by using ssh. You probably cannot avoid this, say if you are editing in languages that are not natively supported by the server, but you have the tools locally.

If all your tools are local to your laptop, then using TRAMP makes sense. But if your servers mandate compilation on that machine (for security reasons), then ssh might be more appropriate.

Lastly, if your emacs usage is not dependent on mouse and other input devices (for multiple languages), then ssh is the way to go as it is optimized for keyboard interaction. Otherwise local Emacs with the full GUI interface is what you'd want.

5

I agree with Emacs User: Neither approach is objectively "better". If you don't have any obvious compelling reason to go with one or the other, then it's really just a subjective balance between performance and convenience.

If you need only occasional access to any given server, the ease of using TRAMP ought to trump a low-to-moderate performance hit.

If you will be making moderate-to-heavy use of Emacs with a given server, then running Emacs on the remote server is a more obvious consideration (but by no means a necessity).

Use TRAMP to start with. If you have no issues with performance, then that's likely the best and simplest solution. If the performance hit bothers you, try running it remotely.

You'll also need to decide whether to run GUI Emacs or not. Remote GUI Emacs brings its own performance issues (I do use it when running Emacs inside a locally-hosted VM, but not otherwise). If you usually use GUI Emacs and you'd need to use terminal Emacs remotely, that's obviously another trade-off to consider.

Use whatever feels best to you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.