Commits

camlspotter committed 4fc0510

ocamlspot val or type

Comments (0)

Files changed (1)

ocamlspot/ocamlspot.el

       (message "no type found here")
       nil)))
 
-(defun ocamlspot-find-val-in-buffer (&optional to-kill)
+(defun ocamlspot-find-val-or-type-in-buffer (&optional to-kill)
   (set-buffer (get-buffer-create ocamlspot-buffer))
   (goto-char (point-min))
   (if (re-search-forward "^Val: \\(.*\\(\n +.*\\)*\\)" nil t)
 	(if to-kill (kill-new type))
 	(message "Val: %s" type)
 	type)
-    (progn 
-      nil)))
+    (ocamlspot-find-type-in-buffer to-kill)))
 
 (defun ocamlspot-find-spot-in-buffer ()
   (set-buffer (get-buffer-create ocamlspot-buffer))
 	    (position (buffer-substring (match-beginning 2)
 					(match-end 2))))
 	;; display the result
-	(let ((type (ocamlspot-find-type-in-buffer)))
+	(let ((type (ocamlspot-find-val-or-type-in-buffer)))
 	  (ocamlspot-jump-to-spot filename position)
 	  (if type (message "Type: %s" type))))
     (progn
 	  (progn
 	    ;; display debug info
 	    (message "No spot found there") 
-	    (ocamlspot-find-type-in-buffer)
+	    (ocamlspot-find-val-or-type-in-buffer)
 	    ;; (display-buffer ocamlspot-buffer)
 	    ))))))
 
   (interactive)
   (if (ocamlspot-gen-query '("-n"))
       (save-current-buffer 
-	(ocamlspot-find-type-in-buffer to-kill)))
+	(ocamlspot-find-val-or-type-in-buffer to-kill)))
   (ocamlspot-delete-overlays))
 
 (defun ocamlspot-type-and-copy ()