[MLton-commit] r6279
Vesa Karvonen
vesak at mlton.org
Mon Dec 17 16:18:28 PST 2007
Add SML def-use symbol movement functions to all SML related modes.
----------------------------------------------------------------------
U mlton/trunk/ide/emacs/esml-du-mlton.el
U mlton/trunk/ide/emacs/esml-util.el
----------------------------------------------------------------------
Modified: mlton/trunk/ide/emacs/esml-du-mlton.el
===================================================================
--- mlton/trunk/ide/emacs/esml-du-mlton.el 2007-12-17 22:56:50 UTC (rev 6278)
+++ mlton/trunk/ide/emacs/esml-du-mlton.el 2007-12-18 00:18:27 UTC (rev 6279)
@@ -149,8 +149,9 @@
(when (let ((c (char-after))) (and c (<= ?0 c) (<= c ?9)))
(search-forward-regexp esml-sml-numeric-literal-regexp point t))))
-(add-to-list 'def-use-mode-to-move-to-symbol-start-alist
- (cons 'sml-mode (function esml-du-move-to-symbol-start)))
+(loop for mode in esml-sml-modes do
+ (add-to-list 'def-use-mode-to-move-to-symbol-start-alist
+ (cons mode (function esml-du-move-to-symbol-start))))
(defun esml-du-move-to-symbol-end ()
"Moves to the end of the SML symbol at point assuming that we are at the
@@ -159,8 +160,9 @@
(when (zerop (skip-chars-forward esml-sml-alphanumeric-chars limit))
(skip-chars-forward esml-sml-symbolic-chars limit))))
-(add-to-list 'def-use-mode-to-move-to-symbol-end-alist
- (cons 'sml-mode (function esml-du-move-to-symbol-end)))
+(loop for mode in esml-sml-modes do
+ (add-to-list 'def-use-mode-to-move-to-symbol-end-alist
+ (cons mode (function esml-du-move-to-symbol-end))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Methods
Modified: mlton/trunk/ide/emacs/esml-util.el
===================================================================
--- mlton/trunk/ide/emacs/esml-util.el 2007-12-17 22:56:50 UTC (rev 6278)
+++ mlton/trunk/ide/emacs/esml-util.el 2007-12-18 00:18:27 UTC (rev 6279)
@@ -35,6 +35,9 @@
"\\(?:\\(?:0w\\)?[0-9]+\\|0w?x[0-9a-fA-F]+\\)"
"Regexp matching the syntax of Standard ML numeric literals.")
+(defconst esml-sml-modes '(sml-mode sml-lex-mode sml-yacc-mode)
+ "List of Emacs modes dealing with SML code.")
+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Some general purpose Emacs Lisp utility functions
More information about the MLton-commit
mailing list