Peter Szilagyi avatar Peter Szilagyi committed 46a9987

Jane.emacsian-ocamlspot: Fixed type display in minibuffer in hack.

Comments (0)

Files changed (1)


+;; (Jane.emacsian-ocamlspot)
 (defun Jane.emacsian-ocamlspot ()
-  "nlinger and pszilagyi find the default `ocamlspot-query'
-behavior annoying.  Let's try something a little more Emacsian,
-i.e., more like `find-function'."
+  "Tweak `ocamlspot' functions to act more like Emacs functions."
   (require 'ocamlspot)
   ;; Use advice rather than redefining, so it's easy to disable.
   (defadvice ocamlspot-query (around Jane.emacsian-ocamlspot activate)
+    "Act more like `find-function-other-window'."
+    ;; nlinger and pszilagyi find the default behavior annoying.  In
+    ;; particular, point moves to the query window, capturing
+    ;; keystrokes like C-x C-b, but only temporarily, until
+    ;; `ocaml-wait' returns and the original window is re-selected.
+    ;; This is visually distracting and deceptive and creates a
+    ;; partial UI race condition.
+    ;;
+    ;; Go further than merely fixing the existing behavior, which
+    ;; could be accomplished by switching back to the originally
+    ;; selected window before calling `ocamlspot-wait'.
     (ocamlspot-message-init (buffer-file-name))
     (ocamlspot-query-at-cursor (ad-get-arg 0))
     (when (ocamlspot-find-tree)
       ;; search the result
-      (ocamlspot-find-spot))))
+      (ocamlspot-find-spot))
+    (ocamlspot-wait)))
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
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.