[MLton-commit] r5295

Vesa Karvonen vesak at mlton.org
Thu Feb 22 09:44:34 PST 2007


Highlight unused definitions with a different color.
----------------------------------------------------------------------

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-22 13:36:51 UTC (rev 5294)
+++ mlton/trunk/ide/emacs/def-use-mode.el	2007-02-22 17:44:23 UTC (rev 5295)
@@ -36,6 +36,13 @@
   :group 'faces
   :group 'def-use)
 
+(defface def-use-unused-def-face
+  '((((class color)) (:background "pink"))
+    (t (:background "gray")))
+  "Face for highlighting definitions that have no uses."
+  :group 'faces
+  :group 'def-use)
+
 (defface def-use-use-face
   '((((class color)) (:background "darkseagreen3"))
     (t (:background "gray")))
@@ -448,7 +455,10 @@
             (when buffer
               (set-buffer buffer)
               (def-use-highlight-ref
-                length (def-use-ref-pos ref) 'def-use-def-face))))))))
+                length (def-use-ref-pos ref)
+                (if (def-use-sym-to-uses sym)
+                    'def-use-def-face
+                  'def-use-unused-def-face)))))))))
 
 (defun def-use-highlight-current ()
   "Highlights the symbol at the point."




More information about the MLton-commit mailing list