{"id":5785,"date":"2016-12-12T14:26:00","date_gmt":"2016-12-12T19:26:00","guid":{"rendered":"http:\/\/irreal.org\/blog\/?p=5785"},"modified":"2016-12-12T14:26:11","modified_gmt":"2016-12-12T19:26:11","slug":"running-multiple-emacs-servers","status":"publish","type":"post","link":"https:\/\/irreal.org\/blog\/?p=5785","title":{"rendered":"Running Multiple Emacs Servers"},"content":{"rendered":"<p> Tycho Garen has an interesting use case. Because he uses a single laptop to work on many projects, he wanted a way to have separate Emacs instances so that his buffers don&rsquo;t get mixed up between projects. That&rsquo;s easy enough to do by simply invoking multiple Emacs instances but then if his X-Windows dies he loses everything. As <a href=\"http:\/\/irreal.org\/blog\/?p=5159\">Sacha told us<\/a>, the way to avoid that is to run Emacs in daemon mode. But how can you run multiple Emacs instances in daemon mode? <\/p>\n<p> Garen has the answer. His solution involves <a href=\"http:\/\/tychoish.com\/post\/running-multiple-emacs-daemons-on-a-single-system\/\">having emacsclient connect to the server with TCP<\/a>. Follow the link for the details. One of the commenters points out that this can be a security problem if external users can reach the socket. Stefan Monnier replied that there&rsquo;s a secret key in the server file so the security problem isn&rsquo;t as bad as it sounds but in any event you can still use local Unix sockets by specifying <code>--socket-name<\/code> rather than <code>--server-file<\/code> as an option to <code>emacsclient<\/code>. This is explained (sort of) in the <a href=\"https:\/\/www.gnu.org\/software\/emacs\/manual\/html_node\/emacs\/emacsclient-Options.html#emacsclient-Options\">emacsclient options<\/a> section of the Emacs manual. <\/p>\n<p> Garen shows another nice trick in his post. I often see people starting the Emacs daemon at boot time by messing with <code>systemd<\/code> or whatever their system uses to control the boot process. Garen simply makes use of the fact that <code>crontab<\/code> has a <code>@reboot<\/code> &ldquo;time&rdquo; that will perform the action when the system boots. That solves the problem nicely and easily. Again, see his post for the details. <\/p>\n<p> Most of us probably won&rsquo;t have occasion to need multiple Emacs instances but it&rsquo;s nice to know how to do it in case the need does arise. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Tycho Garen has an interesting use case. Because he uses a single laptop to work on many projects, he wanted a way to have separate Emacs instances so that his buffers don&rsquo;t get mixed up between projects. That&rsquo;s easy enough &hellip; <a href=\"https:\/\/irreal.org\/blog\/?p=5785\">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":[18],"class_list":["post-5785","post","type-post","status-publish","format-standard","hentry","category-general","tag-emacs"],"_links":{"self":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/5785","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=5785"}],"version-history":[{"count":1,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/5785\/revisions"}],"predecessor-version":[{"id":5786,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/5785\/revisions\/5786"}],"wp:attachment":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5785"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5785"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5785"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}