summary refs log tree commit diff stats
path: root/user/emacs
diff options
context:
space:
mode:
authorAlan Pearce2023-04-13 13:46:06 +0200
committerAlan Pearce2023-04-14 18:05:49 +0200
commit7e169a20e1da2f949b4a08a54df1b0cfc078c5bd (patch)
tree3054b1dcd515ed34cd3c035bf70f21585768fc1d /user/emacs
parent50b2162aefcf6c63aa07b467e48e8973d5ed254e (diff)
downloadnixfiles-7e169a20e1da2f949b4a08a54df1b0cfc078c5bd.tar.lz
nixfiles-7e169a20e1da2f949b4a08a54df1b0cfc078c5bd.tar.zst
nixfiles-7e169a20e1da2f949b4a08a54df1b0cfc078c5bd.zip
Emacs: don't warn on startup with server running
Diffstat (limited to 'user/emacs')
-rw-r--r--user/emacs/init.el6
1 files changed, 5 insertions, 1 deletions
diff --git a/user/emacs/init.el b/user/emacs/init.el
index 6e0dac50..927ed1fb 100644
--- a/user/emacs/init.el
+++ b/user/emacs/init.el
@@ -17,7 +17,11 @@
   (setq file-name-handler-alist default-file-name-handler-alist))
 (add-hook 'emacs-startup-hook #'restore-file-name-handler-alist)
 
-(add-hook 'after-init-hook #'server-start)
+(defun maybe-start-server ()
+  (require 'server)
+  (unless (server-running-p)
+    (server-start)))
+(add-hook 'after-init-hook #'maybe-start-server)
 
 (eval-when-compile (require 'fringe-helper))