Commits

Anonymous committed 30f6ce0

PR#5137: caml-types-explore does not work

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12696f963ae5c-01c2-4b8c-9fe0-0dff7051ff02

Comments (0)

Files changed (2)

   segmentation faults due to stack overflow in C code
 - PR#5073: wrong location for 'Unbound record field label' error
 - PR#5131: compilation of custom runtime with g++ generates lots of warnings
+- PR#5137: caml-types-explore does not work
 - PR#5211: updated Genlex documentation to state that camlp4 is mandatory for
   'parser' keyword and associated notation
 - PR#5218: use $(MAKE) instead of "make" in Makefiles

emacs/caml-types.el

  . One overlay delimits the largest region whose all subnodes
    are well-typed.
  . Another overlay delimits the current node under the mouse (whose type
-   annotation is beeing displayed).
+   annotation is being displayed).
 "
   (interactive "e")
   (set-buffer (window-buffer (caml-event-window event)))
                            target-pos
                            (vector target-file target-line target-bol cnum))
                      (save-excursion
-                       (setq node (caml-types-find-location "type"
-                                   target-pos () target-tree))
+                       (setq node (caml-types-find-location target-pos "type" ()
+							    target-tree))
                        (set-buffer caml-types-buffer)
                        (erase-buffer)
                        (cond
-                        (node
-                         (setq Left
-                               (caml-types-get-pos target-buf (elt node 0))
-                               Right
-                               (caml-types-get-pos target-buf (elt node 1)))
-                         (move-overlay
-                          caml-types-expr-ovl Left Right target-buf)
-                         (setq limits
-                               (caml-types-find-interval target-buf
-                                                         target-pos node)
-                               type (elt node 2))
-                         )
-                        (t
+			((null node)
                          (delete-overlay caml-types-expr-ovl)
                          (setq type "*no type information*")
                          (setq limits
                                (caml-types-find-interval
-                                target-buf target-pos target-tree))
+                                target-buf target-pos target-tree)))
+                        (t
+			 (let ((left
+				(caml-types-get-pos target-buf (elt node 0)))
+                               (right
+				(caml-types-get-pos target-buf (elt node 1))))
+                         (move-overlay
+                          caml-types-expr-ovl left right target-buf)
+                         (setq limits
+                               (caml-types-find-interval target-buf
+                                                         target-pos node)
+                               type (cdr (assoc "type" (elt node 2))))
                          ))
+			)
                        (setq mes (format "type: %s" type))
                        (insert type)
                        ))
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.