]> code.delx.au - gnu-emacs-elpa/commitdiff
Make MLton regexps work in M-x compile.
authormonnier <>
Fri, 29 Jun 2007 04:13:04 +0000 (04:13 +0000)
committermonnier <>
Fri, 29 Jun 2007 04:13:04 +0000 (04:13 +0000)
ChangeLog
sml-mode.el

index ed49fdfdcdb1542fc89ccc94082659a5bb08ecbe..672679a374bc390a86b45086f7555ede59ba833d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2007-06-29  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * sml-mode.el (sml-mlton-error-regexp-alist): New var.
+       (sml-mlton-typecheck): Use it.
+       (compilation-error-regexp-alist): Add entries after loading "compile"
+       so that M-x compile works.
+
+       * sml-proc.el (inferior-sml-mode): Make TAB add a " rather than a space
+       at the end of a file name.
+
 2007-06-14  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * sml-mode.el (sml-mode-variables): Set comment-quote-nested instead of
index 085d7a8acfd35d31d6519f40dd23f1f8019f2698..df5d814ab62cb392288956a03947c9faaaced4b7 100644 (file)
@@ -992,6 +992,18 @@ See also `edit-kbd-macro' which is bound to \\[edit-kbd-macro]."
 
 (defvar sml-mlton-mainfile nil)
 
+(defconst sml-mlton-error-regexp-alist
+  ;; I wish they just changed MLton to use one of the standard
+  ;; error formats.
+  `(("^\\(?:Error\\|\\(Warning\\)\\): \\(.+\\) \\([0-9]+\\)\\.\\([0-9]+\\)\\.$"
+     2 3 4
+     ;; If subgroup 1 matched, then it's a warning, otherwise it's an error.
+     ,@(if (fboundp 'compilation-fake-loc) '((1))))))
+
+(eval-after-load "compile"
+  '(dolist ((x sml-mlton-error-regexp-alist))
+     (add-to-list 'compilation-error-regexp-alist x)))
+
 (defun sml-mlton-typecheck (mainfile)
   "typecheck using MLton."
   (interactive
@@ -1000,14 +1012,8 @@ See also `edit-kbd-macro' which is bound to \\[edit-kbd-macro]."
            (read-file-name "Main file: "))))
   (save-some-buffers)
   (require 'compile)
-  (add-to-list
-   'compilation-error-regexp-alist
-   ;; I wish they just changed MLton to use one of the standard
-   ;; error formats.
-   `("^\\(?:Error\\|\\(Warning\\)\\): \\(.+\\) \\([0-9]+\\)\\.\\([0-9]+\\)\\."
-     2 3 4
-     ;; If subgroup 1 matched, then it's a warning, otherwise it's an error.
-     ,@(if (fboundp 'compilation-fake-loc) '((1)))))
+  (dolist ((x sml-mlton-error-regexp-alist))
+    (add-to-list 'compilation-error-regexp-alist x))
   (with-current-buffer (find-file-noselect mainfile)
     (compile (concat sml-mlton-command
                      " -stop tc "       ;Stop right after type checking.