[MLton-commit] r5082

Vesa Karvonen vesak at mlton.org
Tue Jan 30 00:30:30 PST 2007


jump-to-next that doesn't quite work yet.

----------------------------------------------------------------------

U   mlton/trunk/ide/emacs/def-use-data.el
U   mlton/trunk/ide/emacs/def-use-mode.el

----------------------------------------------------------------------

Modified: mlton/trunk/ide/emacs/def-use-data.el
===================================================================
--- mlton/trunk/ide/emacs/def-use-data.el	2007-01-30 07:30:49 UTC (rev 5081)
+++ mlton/trunk/ide/emacs/def-use-data.el	2007-01-30 08:30:29 UTC (rev 5082)
@@ -64,6 +64,7 @@
   (let* ((ref (def-use-sym-ref sym))
          (src (def-use-ref-src ref))
          (info (def-use-src-to-info src)))
+    (puthash ref ref (def-use-sym-to-use-set sym))
     (puthash src src (def-use-duf-to-src-set duf))
     (puthash sym sym (def-use-info-sym-set info))
     (puthash (def-use-ref-pos ref) sym (def-use-info-pos-to-sym info))))

Modified: mlton/trunk/ide/emacs/def-use-mode.el
===================================================================
--- mlton/trunk/ide/emacs/def-use-mode.el	2007-01-30 07:30:49 UTC (rev 5081)
+++ mlton/trunk/ide/emacs/def-use-mode.el	2007-01-30 08:30:29 UTC (rev 5082)
@@ -90,6 +90,17 @@
         (def-use-goto-ref (def-use-sym-ref sym))
       (message "Sorry, no known symbol at cursor."))))
 
+(defun def-use-jump-to-next ()
+  "Jumps to the next use (or def) of the symbol under the cursor."
+  (interactive)
+  (let ((sym (def-use-current-sym)))
+    (if (not sym)
+        (message "Sorry, no information on the symbol at point!")
+      (let* ((uses (def-use-sym-to-uses sym))
+             (uses (append uses uses)))
+        (while (not (equal (pop uses) (def-use-sym-ref sym))))
+        (def-use-goto-ref (car uses))))))
+
 (defun def-use-goto-ref (ref)
   "Find the referenced source and moves point to the referenced position."
   (find-file (def-use-ref-src ref))




More information about the MLton-commit mailing list