I'm running a TCP server locally, and I'm trying to open a file from a remote host on my local Emacs through emacsclient. The reason for this is that I have emacspeak running locally which gives me speech, and I want to use this for commands that use the $EDITOR variable, like editing crontab, or kubectl edit and so on.
This question already exists on StackOverflow and has an answer, but at the time the question was asked, this feature was not yet introduced. This feature is introduced in Emacs 26.0.50, according to the relevant issue.
So, here is what I've set:
server-auth-keyis set to a key I generated withserver-generate-keyserver-hostis set to my local computer's hostnameserver-portis set to 1990server-use-tcpis set tot
I copied and pasted the local ~/.emacs.d/server/server into the remote host's ~/.emacs.d/server/server, and then ran the following command:
$ emacsclient -f server test
This gave me the following output:
emacsclient: connected to remote socket at 10.156.54.246
And then nothing. Nothing pops up on my local Emacs.
Running the same command locally works.
I investigated further and doing a telnet to the host mentioned in the output of emacsclient on port 1990 doesn't work either.
It looks like I'm not setting the value of server-host correctly. I've set it to my hostname, but that doesn't seem to be working.
How should I set my server-host? What should I set it to?
M-x trace-function RET server-execute RETto try and start investigating what the local Emacs does. Note that you're probably going to have to add some code somewhere becauseemacsclientwill provide names of files that are on the remote machine and which your local Emacs will hence need to access over Tramp. E.g. you may need to set$EDITORto a script that doesemacsclient -f server "/ssh:my.remote.host:$1". – Stefan Jul 28 '18 at 16:09--trampoption which seems to be introduced in Emacs 26.0.50. I'll try this and let you know. – Parham Doustdar Jul 29 '18 at 07:43server-hostvariable to my hostname. Should I change it to anything else? Is there a way of dynamically setting it? – Parham Doustdar Jul 29 '18 at 13:45