From a887714a785cfded7bba3c704861466e164fb6b0 Mon Sep 17 00:00:00 2001 From: Jeremy Dormitzer Date: Tue, 9 Mar 2021 09:24:07 -0500 Subject: [PATCH] Only start server if not already running --- emacs/.emacs.d/init.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/emacs/.emacs.d/init.el b/emacs/.emacs.d/init.el index 54e1f37..822e392 100644 --- a/emacs/.emacs.d/init.el +++ b/emacs/.emacs.d/init.el @@ -12,7 +12,11 @@ file-name-handler-alist file-name-handler-alist-backup))) ;; Start the server after init -(add-hook 'emacs-startup-hook #'server-start) +(autoload 'server-running-p "server") +(defun server-start-if-not-running () + (unless (server-running-p) + (server-start))) +(add-hook 'emacs-startup-hook #'server-start-if-not-running) ;; Bootstrap the straight.el package manager (defvar bootstrap-version)