]> code.delx.au - gnu-emacs-elpa/commitdiff
(no commit message)
authormonnier <>
Wed, 31 Oct 2007 16:28:52 +0000 (16:28 +0000)
committermonnier <>
Wed, 31 Oct 2007 16:28:52 +0000 (16:28 +0000)
ChangeLog
sml-mode.el
sml-proc.el
totoe [new file with mode: 0644]
totof [new file with mode: 0644]

index c836bc40d2401552cab9fe4d5db59a6dc01480ec..e505988851b970abf09f3f9121b3bd357f659e70 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2007-10-31  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * sml-mode.el (sml-def-skeleton): If possible, only expand for
+       lower-case abbrevs and not inside strings or comments.
+       (sml-mlton-typecheck): Typo.
+
+       * sml-proc.el (sml-proc-comint-input-filter-function): New function.
+       (inferior-sml-mode): Use it.
+       (sml-update-cursor): Don't forget errors here any more.
+
 2007-10-31  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * sml-util.el (defmap, defsyntax): Avoid defconst.
index 43a642bc3145b75fe61fa0c30275a4191ba472be..35abcea34e11e6f839b3d53a7888d53230b2347d 100644 (file)
@@ -864,6 +864,11 @@ signature, structure, and functor by default.")
             (define-abbrev sml-mode-abbrev-table ,name "" ',fsym nil 'system)
           (wrong-number-of-arguments
            (define-abbrev sml-mode-abbrev-table ,name "" ',fsym)))
+         (when (fboundp 'abbrev-put)
+           (let ((abbrev (abbrev-symbol ,name sml-mode-abbrev-table)))
+             (abbrev-put abbrev :case-fixed t)
+             (abbrev-put abbrev :enable-function
+                         (lambda () (not (nth 8 (syntax-ppss)))))))
         (define-skeleton ,fsym
           ,(format "SML-mode skeleton for `%s..' expressions" name)
           ,interactor
@@ -1011,7 +1016,7 @@ See also `edit-kbd-macro' which is bound to \\[edit-kbd-macro]."
            (read-file-name "Main file: "))))
   (save-some-buffers)
   (require 'compile)
-  (dolist ((x sml-mlton-error-regexp-alist))
+  (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
index f6c55fce5f47d7ad734c8d50a5d88d9a83bfe51d..a5731973060a2a02d26cb10eb9d0b3c9b0eaf7f7 100644 (file)
@@ -308,6 +308,17 @@ If prefix argument ECHO is set, then it only reports on the current state."
       (progn (call-interactively 'run-sml)
             (get-buffer-process (current-buffer)))))
 
+(defun sml-proc-comint-input-filter-function (str)
+  ;; `compile.el' in Emacs-22 fails to notice that file location info from
+  ;; errors should be recomputed afresh (without using stale info from
+  ;; earlier compilations).  We used to cause a refresh in sml-send-string,
+  ;; but this doesn't catch the case when the user types commands directly
+  ;; at the prompt.
+  (compilation-forget-errors)       ;Has to run before compilation-fake-loc.
+  (if (and (fboundp 'compilation-fake-loc) sml-temp-file)
+      (compilation-fake-loc (cdr sml-temp-file) (car sml-temp-file)))
+  str)
+
 (defun inferior-sml-next-error-hook ()
   ;; Try to recognize SML/NJ type error message and to highlight finely the
   ;; difference between the two types (in case they're large, it's not
@@ -386,6 +397,8 @@ TAB file name completion, as in shell-mode, etc.."
 
   ;; Make TAB add a " rather than a space at the end of a file name.
   (set (make-local-variable 'comint-completion-addsuffix) '(?/ . ?\"))
+  (add-hook 'comint-input-filter-functions
+            'sml-proc-comint-input-filter-function nil t)
 
   (set (make-local-variable 'font-lock-defaults)
        inferior-sml-font-lock-defaults)
@@ -664,9 +677,10 @@ Prefix arg AND-GO also means to `switch-to-sml' afterwards."
   ;; Update buffer local variable.
   (set-marker sml-error-cursor (1- (process-mark (sml-proc))))
   (setq sml-endof-error-alist nil)
-  (compilation-forget-errors)
-  (if (and (fboundp 'compilation-fake-loc) sml-temp-file)
-      (compilation-fake-loc (cdr sml-temp-file) (car sml-temp-file)))
+  ;; This is now done in comint-input-filter-functions.
+  ;; (compilation-forget-errors)       ;Has to run before compilation-fake-loc.
+  ;; (if (and (fboundp 'compilation-fake-loc) sml-temp-file)
+  ;;     (compilation-fake-loc (cdr sml-temp-file) (car sml-temp-file)))
   (if (markerp compilation-parsing-end)
       (set-marker compilation-parsing-end sml-error-cursor)
     (setq compilation-parsing-end sml-error-cursor)))
diff --git a/totoe b/totoe
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/totof b/totof
new file mode 100644 (file)
index 0000000..e69de29