This is probably a somewhat out-of-wack question. I use tramp to edit remote files, but I also open several terminals ssh-ing to that remote machine as well for other works (I had problems running ssh shell inside emacs).
Often times during the terminal work I would like to edit some file, and my current procedure is to copy the file name, and then use emacs tramp to open that file (after messing all around with getting the file path in the tramp format). This is way too much work for a quick edit and quite error prone in the path handling part.
The question is: Can I execute some command in the remote ssh session that takes the filename, transform that to tramp format (that's the easy part), and run a local command (like emacsclient blahblahblah
) so that I can edit the remote file using tramp in my local emacs?
I'm not sure if I'm clear enough. I don't want to run emacs on the remote machine (either on the terminal or through an x session), but I do want to send file to my local emacs from a remote prompt, like this:
user@remote-machien ~/ $ run_local_emacs somefile
# then the file "/ssh:user@remote-machine/:/home/user/somefile" shows up
# in my local emacs