Re:Emacs 26 Brings Generators and Threads
by BooneJS on Friday June 01, 2018 @10:59AM
(#17205840)
Emacs is compared to vim because both can be run in a terminal on a remote machine, not because it’s the JS-editor-of-the-month. There’s a fairly decent chance I’d switch away from vim if I ever had a job where I could edit code locally.
[ Parent
| on HN ]
Emacs has TRAMP, which allows transparent access to files on remote systems using a variety of protocols (but mostly ssh/sftp).
...and if you haven't given TRAMP an honest shot, you definitely should. I took the leap not too long ago, and it is absolutely amazing. Whenever I can't access a host using TRAMP (does happen, but very rarely), I put off whatever task I have to do on that host for a very long time.
The fact that TRAMP lets you open files on remote systems in and of itself is fairly mundane. What makes it really cool is that it works seamlessly also with dual-pane dired, and just about anything you do in Emacs. It turns remote filesystems into local ones.
Being able to, in my regular file manager (I like Sunrise Commander), treat any combination of remote and local filesystems as though they were local, is a huge productivity boost.
Re:Emacs 26 Brings Generators and Threads
by technofiend on Friday June 01, 2018 @04:09PM
(#17209649)
It's this sort of thing that when I first saw it on Apollo's Aegis and again later on Plan 9 it was so obviously useful I figured it would just be everywhere in no time. At then Sun touted "The Network Is The Computer (TM)" and I was like here it comes! But it hasn't quite panned out that way. Considering the number of viruses and ransomware perhaps that's a good thing but it would be cool as hell if I had shared name spaces with my wife, mother, sister, etc rather than the artificial constraint of mapping into Facebook or Google Photos (for example) to share a photo album.
Not that it's the /correct/ solution, but Keybase does a good job of providing that shared-directory experience, and the free tier is pretty roomy.
Not affiliated, just getting good use out of it.
But the coolest thing by far is that you can now go the reverse direction. If you have a ssh tunnel you can run emacsclient --tramp $file on the remote system and it will pop up on your local Emacs window.
Consider my mind blown! :)
Once I had to work remotely over 2g cell phone. Using remote terminal was too painful due to huge latencies approaching 1s. What worked surprisingly well was to work on a local copy of files in a local editor and then to run command remotely I would prefix them with a script that I aliased like rc. The script rsyncs first the tree to the remote host and then run the command there. These days for much simpler setup I use lsyncd to sync file trees and then the rc command just runs the command over ssh.
For that use case, if you have Emacs locally, you could use TRAMP - which basically works the way your script does. It allows you to transparently access files, directory structures, or even run shells on remote machines. It supports many protocols; the typical way it works, is it starts an ssh connection in the background, and uses the shell to ferry the file you want to edit to your local machine, and then transparently ship it back when you save.
TRAMP does not work like that. First it does not have a whole directory tree, rather it just caches the opened buffers so things like grep etc. must run remotely which sucks on a high latency link or could be much slower if the server is not very powerful VM. Second at least like 5 years ago when the last time I played with TAMP it worked really badly on an unreliable connections or when the laptop switches to different wifi network. If ssh connection hangs, the whole GUI often hangs and sometimes after reconnecting I had to throw away resent edits and reopen the buffer. It could be that nowadays things are better, but for me nothing beats my lsyncd + explicit remote command script. Even file completion works with trivial efforts. As paths in my local tree copy matches the remote paths, completing by files just works, and it is trivial to call completion scripts for remote command from the completion script for rc.
sshfs is a thing. If i had to use remote machines only, i would use tramp; not run an emacs instance on a remote machine. I haven't had good experience running editors inside tmux.
I see this occasionally. Why can't you edit locally?
Sometimes it’s policy (no source code on laptops), but mostly it’s because my line of work uses the verilog language and the tool suites require “very stable” (read: archaic) versions of Linux.
Re:Emacs 26 Brings Generators and Threads
by hprotagonist on Friday June 01, 2018 @12:02PM
(#17206669)
do you know about TRAMP? https://www.emacswiki.org/emacs/TrampMode
Can you use ssh/scp? Emacs is able to use that to edit files remotely. I often use it when I work with small Arm Linux boards.
https://www.gnu.org/software/emacs/manual/html_node/emacs/Re...