{"id":9457,"date":"2021-02-02T18:58:06","date_gmt":"2021-02-02T23:58:06","guid":{"rendered":"https:\/\/irreal.org\/blog\/?p=9457"},"modified":"2021-02-04T16:11:50","modified_gmt":"2021-02-04T21:11:50","slug":"using-a-local-emacs-from-a-remote-host","status":"publish","type":"post","link":"https:\/\/irreal.org\/blog\/?p=9457","title":{"rendered":"Using a Local Emacs From a Remote Host"},"content":{"rendered":"<p>Micha\u0142 Nazarewicz has a <a href=\"https:\/\/mina86.com\/2021\/emacs-remote\/\">very interesting post<\/a> on using Emacs to edit files on a remote system. Your first reaction is likely, \u201cMeh, isn\u2019t that just Tramp?\u201d I know that was mine but Nazarewicz has a specific requirement: he wants to SSH into the remote system, do his work, and, when he wants to edit a file, use <code>emacsclient<\/code> to connect <i>back to the Emacs server running on his local host.<\/i> It is, in a sense, the reverse of what you with Tramp: instead of connecting to a remote file from the local Emacs server, you connect to the local server from the remote host.<\/p>\n<p>The point of this, apparently, is to avoid changing to another shell session when you want to edit a (remote) file. Whether you think this is worth the effort probably depends on what you do on the remote host. If you just want to edit a file or two, Tramp is probably fine. If you\u2019re performing lots of other tasks, Nazarewicz\u2019s method may be useful.<\/p>\n<p>The TL;DR is that when you SSH to the remote host, you arrange to forward the (remote) Emacs server port to the local Emacs server port. That way, when you invoke <code>emacsclient<\/code> on the remote host, it connects to the server on your local machine. It\u2019s a cute trick but the details can be a little fussy. Read Nazarewicz\u2019s post for the details.<\/p>\n<p><b>Update<\/b> <span class=\"timestamp-wrapper\"><span class=\"timestamp\">[2021-02-04 Thu 16:10]<\/span><\/span>: Added link to Nazarewicz\u2019s post.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Micha\u0142 Nazarewicz has a very interesting post on using Emacs to edit files on a remote system. Your first reaction is likely, \u201cMeh, isn\u2019t that just Tramp?\u201d I know that was mine but Nazarewicz has a specific requirement: he wants &hellip; <a href=\"https:\/\/irreal.org\/blog\/?p=9457\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-9457","post","type-post","status-publish","format-standard","hentry","category-general"],"_links":{"self":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/9457","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=9457"}],"version-history":[{"count":2,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/9457\/revisions"}],"predecessor-version":[{"id":9464,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/9457\/revisions\/9464"}],"wp:attachment":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=9457"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=9457"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=9457"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}