[MLton-commit] r5283

Vesa Karvonen vesak at mlton.org
Wed Feb 21 03:54:21 PST 2007


Only update marker ring if jump is really attempted.
----------------------------------------------------------------------

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

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

Modified: mlton/trunk/ide/emacs/def-use-mode.el
===================================================================
--- mlton/trunk/ide/emacs/def-use-mode.el	2007-02-20 23:41:33 UTC (rev 5282)
+++ mlton/trunk/ide/emacs/def-use-mode.el	2007-02-21 11:54:17 UTC (rev 5283)
@@ -204,16 +204,15 @@
 (defun def-use-jump-to-def (&optional other-window)
   "Jumps to the definition of the symbol under the cursor."
   (interactive "P")
-  (ring-insert def-use-marker-ring (point-marker))
   (let ((sym (def-use-current-sym)))
     (if (not sym)
         (message "%s" def-use-apology)
+      (ring-insert def-use-marker-ring (point-marker))
       (def-use-goto-ref (def-use-sym-ref sym) other-window))))
 
 (defun def-use-jump-to-next (&optional other-window reverse)
   "Jumps to the next use (or def) of the symbol under the cursor."
   (interactive "P")
-  (ring-insert def-use-marker-ring (point-marker))
   (let* ((ref (def-use-current-ref))
          (sym (def-use-sym-at-ref ref)))
     (if (not sym)
@@ -222,12 +221,12 @@
              (refs (if reverse (reverse refs) refs))
              (refs (append refs refs)))
         (while (not (equal (pop refs) ref)))
+        (ring-insert def-use-marker-ring (point-marker))
         (def-use-goto-ref (car refs) other-window)))))
 
 (defun def-use-jump-to-prev (&optional other-window)
   "Jumps to the prev use (or def) of the symbol under the cursor."
   (interactive "P")
-  (ring-insert def-use-marker-ring (point-marker))
   (def-use-jump-to-next other-window t))
 
 (defun def-use-goto-ref (ref &optional other-window)




More information about the MLton-commit mailing list