all repos — archive/dotfiles @ 86e1b50e0491b1047e3c0484ef7aad7a02019b67

Superseded by nixfiles

Emacs: Start server when idle
Alan Pearce alan.pearce@spotcap.com
Wed, 09 Dec 2015 17:00:19 +0100
commit

86e1b50e0491b1047e3c0484ef7aad7a02019b67

parent

fd9d7a3ec850d44fbefe9c45922c1caa112343e4

1 files changed, 6 insertions(+), 5 deletions(-)

jump to
M tag-emacs/emacs.d/init.orgtag-emacs/emacs.d/init.org
@@ -2428,11 +2428,12 @@ * End 
 Start a server if possible.  A daemon is already a server.
 #+BEGIN_SRC emacs-lisp
-  (unless (daemonp)
-    (require 'server)
-    (if (server-running-p server-name)
-        (message "Server already appears to be running")
-      (server-start)))
+  (run-with-idle-timer 2 nil (lambda ()
+                               (unless (daemonp)
+                                 (require 'server)
+                                 (if (server-running-p server-name)
+                                     (message "Server already appears to be running")
+                                   (server-start)))))
   (benchmark-init/deactivate)
   (setq gc-cons-threshold 800000)
 #+END_SRC