Commits

seanmcl committed 84288d9

version mismatch message with numbers, show-buffer-for-next-error

Comments (0)

Files changed (3)

+features
+========
+
+changes
+=======
+
+- Omake.errors-follow-point {t,nil} ---> 
+  Omake.show-buffer-for-next-error-in {'dedicated-code-window, 'selected-window}
+- changed tmp directory 
+  /tmp/omake-server/seanmcl/-home-seanmcl-ocaml/elisp --->
+  /tmp/omake-server/seanmcl/home/seanmcl/ocaml/elisp
+- Added version numbers in mismatch message
+
+bug fixes
+=========
+
+--------------------------------------------------------------------------------
+
 features
 ========
 - added support for dhouse-style error navigation
   :group 'omake
   :type 'string)
 
-(defcustom Omake.errors-follow-point nil
-  "When t, Omake.next-error will open the ml file in the current window"
+(defcustom Omake.show-buffer-for-next-error-in 'dedicated-code-window
+  "Either 'dedicated-code-window or 'selected-window"
   :group 'omake
-  :type 'boolean)
-;; (setq Omake.errors-follow-point t)
+  :type 'symbol)
+;; (setq Omake.show-buffer-for-next-error-in 'selected-window)
 
 ;;============================================================================;;
 ;; Faces                                                                      ;;
 (defun Omake.Window.get (kind)
   "Get an omake window.  Return the current window if none is set."
   (assert (Omake.window-kind-p kind))
-  (if (and Omake.errors-follow-point (equal kind Omake.Window.Code))
+  (if (and (equal kind Omake.Window.Code)
+           (equal Omake.show-buffer-for-next-error-in 'selected-window))
       (selected-window)
     (let* ((w (gethash kind Omake.Window.window-table))
            (ok (and w (window-live-p w)))
 ;; (Omake.Server.version)
 
 (defun Omake.Server.detect-mismatch ()
-  (unless (equal (Omake.Server.version) Omake.version)
-    (let ((res (y-or-n-p "The omake server has a different version than your elisp library.  Reload? ")))
-      (if (not res)
-          (error "Not starting server")
-        (load-library "omake")
-        (Omake.Server.start)))))
+  (let ((vs (Omake.Server.version))
+        (vo Omake.version))
+    (unless (equal vs vo)
+      (let ((res (y-or-n-p "Server version (%d) differes from elisp version (%d).  Reload? ")))
+        (if (not res)
+            (error "Not starting server")
+          (load-library "omake")
+          (if (equal vs Omake.version)
+              (Omake.Server.start)
+            (message "The versions still differ.  Aborting.")))))))
 
 (defun Omake.Server.start ()
   (when (Omake.Server.in-use)
   (assert (not (equal server-received server-version)))
   (let ((msg
          (if (< server-received server-version)
-             (format "The server version %d is newer than the elisp version %d.  Run M-x load-library omake" server-version server-received)
-           (format "The server version %d is older than the elisp version %d.  Run M-x Omake.shutdown then M-x Omake.compile" server-version server-received)
+             (format "Server version (%d) is newer than elisp version (%d).  Run M-x load-library omake" server-version server-received)
+           (format "Server version (%d) is older than elisp version (%d).  Run M-x Omake.shutdown then M-x Omake.compile" server-version server-received)
            )))
     (message msg)))
 ;; (Omake.Ping.version-mismatch :server-received 3 :server-version 2)
             pid := Some pid';
             Writer.writef log_writer "Pid: %s\n" (Pid.to_string pid'))
         in
+        (* If the omake process ever returns, this is a fatal problem.  Alert emacs. *)
         (omake_process_status >>> (fun res ->
           Server.logf "Process died for model: %s" (Id.to_string id);
-          (* To_emacs.send_async "(message \"omake is dead for %s\")" (Id.to_string id); *)
           To_emacs.send_async
             "(Omake.Ocaml.update-model-dead :id \"%s\" :msg \"The omake process is dead: %s.\")"
             (Id.to_string id)