seanmcl avatar seanmcl committed a37aa93

patched hanging due to Jane.server

Comments (0)

Files changed (3)

 
 - Performance improvement for big builds via computing error hashes on the
   ocaml side and caching string representation of errors on the elisp side.
+- Temporarily patched a problem with the Jane.server microfeature.  The 
+  feature needs to be eliminated, but it will require some discussion.
 
 --------------------------------------------------------------------------------
 

elisp/jane/jane-lib.el

     (message "removing compiled file")
     (delete-file (concat file "c"))))
 
+(defun server-restart ()
+    "Force a restart of the emacs server"
+    (interactive)
+    (progn
+      (server-force-delete)
+      (server-start)))
+
 
 ;;----------------------------------------------------------------------------;;
 ;; Hg                                                                         ;;

elisp/jane/jane-micro-features.el

 
 
 ;; (Jane.server)
-(defun Jane.server ()
-  "Server stuff"
-  (require 'server)
-  ;; If there's another server running, (server-start) will
-  ;; fail.  Don't die if this happens.
-  (unless (server-running-p) (server-start))
-  (defun server-restart ()
-    "Force a restart of the emacs server"
-    (interactive)
-    (progn
-      (server-force-delete)
-      (server-start)))
-  ;; Close open server connections when you kill a buffer
-  (add-hook 'kill-buffer-hook
-            (lambda ()
-              (server-buffer-done (current-buffer) t)))
-  ;; This way, "crvet.exe review interactive -emacs" won't cause the
-  ;; focus to shift to emacs.
-  (custom-set-variables '(server-raise-frame nil)))
+(progn
+  (defun Jane.server ()
+    "Server stuff"
+    (require 'server)
+    ;; If there's another server running, (server-start) will
+    ;; fail.  Don't die if this happens.
+    ;; (server-running-p) can also hang when there is a stopped
+    ;; emacs controlling the server.  Just check for the 
+    ;; existence of the file
+    ;; (unless (server-running-p) (server-start))
+    (unless (server-socket-file-exists) (server-start))
+    ;; Close open server connections when you kill a buffer
+    (add-hook 'kill-buffer-hook
+              (lambda ()
+                (server-buffer-done (current-buffer) t)))
+    ;; This way, "crvet.exe review interactive -emacs" won't cause the
+    ;; focus to shift to emacs.
+    (custom-set-variables '(server-raise-frame nil)))
+  (defun server-socket-file-exists ()
+    (file-exists-p (expand-file-name server-name server-socket-dir))))
 
 
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.