diff lisp/server.el @ 85944:69f410562c03

(server-start): Only register cleanup after server was started.
author Andreas Schwab <schwab@suse.de>
date Wed, 07 Nov 2007 00:27:01 +0000
parents 29ea503e1863
children d3e87ee5aa0e
line wrap: on
line diff
--- a/lisp/server.el	Tue Nov 06 21:17:36 2007 +0000
+++ b/lisp/server.el	Wed Nov 07 00:27:01 2007 +0000
@@ -483,6 +483,7 @@
 	  (add-hook 'delete-frame-functions 'server-handle-delete-frame)
 	  (add-hook 'kill-buffer-query-functions 'server-kill-buffer-query-function)
 	  (add-hook 'kill-emacs-query-functions 'server-kill-emacs-query-function)
+	  (add-hook 'kill-emacs-hook (lambda () (server-mode -1))) ;Cleanup upon exit.
 	  (setq server-process
 		(apply #'make-network-process
 		       :name server-name
@@ -1293,7 +1294,6 @@
   ;; continue standard unloading
   nil)
 
-(add-hook 'kill-emacs-hook (lambda () (server-mode -1))) ;Cleanup upon exit.
 (defvar server-unload-function 'server-unload-function)
 
 (provide 'server)