]> code.delx.au - gnu-emacs-elpa/commitdiff
* sml-proc.el (sml-update-cursor): make sure it also works if compile.el
authormonnier <>
Wed, 7 Jul 1999 13:45:42 +0000 (13:45 +0000)
committermonnier <>
Wed, 7 Jul 1999 13:45:42 +0000 (13:45 +0000)
  is fixed to uses a marker.
* sml-mode.el (sml-indent): fix the `fixindent'.

ChangeLog
Makefile
TODO
sml-defs.el
sml-mode.el
sml-proc.el

index 81cf3c6ffcf5e383d12196b50d88167d919e3156..8f65329235e54f8493d600bcc3ff7455c6001491 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+1999-07-07  Stefan Monnier  <monnier@cs.yale.edu>
+
+       * sml-proc.el (sml-update-cursor): make sure it also works if compile.el
+         is fixed to uses a marker.
+
+       * sml-mode.el (sml-indent): fix the `fixindent'.
+
 1999-06-22  Stefan Monnier  <monnier@cs.yale.edu>
 
        * sml-mode-startup.el: fixed to fulfill autoload.el assumptions.
index 2b40316fcb7b713a59523b1c2b853a2851b1048b..18fbaf0059696510a3daa95131bb609e895342d2 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -61,9 +61,6 @@ TEXEXTS =  *.cps *.fns *.kys *.vr *.tp *.pg *.log *.aux *.toc *.cp *.ky *.fn
 .dvi.ps:
        dvips -f $< >$@
 
-$(PACKAGE)-startup.el:  $(ELFILES)
-       $(EMACS) --batch --eval '(setq generated-autoload-file "'`pwd`'/$@")' -f batch-update-autoloads "."
-
 ######################################################################
 
 default: elcfiles
@@ -108,6 +105,12 @@ distclean: clean
 ###                    don't look below                            ###
 ######################################################################
 
+$(PACKAGE)-startup.el:  $(ELFILES)
+       chmod +w $@
+       $(EMACS) --batch --eval '(setq generated-autoload-file "'`pwd`'/$@")' -f batch-update-autoloads "."
+
+##
+
 TAG = $(shell echo v$(VERSION) | tr '.' '_')
 ftpdir=/home/ftp/pub/monnier/$(PACKAGE)
 
diff --git a/TODO b/TODO
index 9b04bad2721fee451f0a9717401b86f363e0145e..8ab7fb027ee5bc46deea1290b781dba5e3403388 100644 (file)
--- a/TODO
+++ b/TODO
@@ -5,95 +5,16 @@
 
 * ignore warnings in C-x ` ????
 
+* recognize irrefutable patterns (with "Capital"-heuristics, for example).
+  This can then be used to allow indenting like
+
+               (fn x =>
+                some expressions)
+
+* obey fixity directives
+
 * improve the run-sml to allow running on another machine and to take args
 
-* allow right-aligning "and" with its correspondant.
+* right-align "and" with its correspondant.
 
 * sample problematic indentations:
-
-let fun toStringFKind {isrec,cconv,inline,...} =
-       (if isSome isrec then "R" else "")^
-       (if cconv = F.CC_FCT then "FCT" else "FUN")^
-       (foo)
-       
-      | toStringFKind =
-       let fun cfun (fk,f,args,body) = let 
-           in (fk, f, args, loop body)
-           end
-           fun foo x = let
-             val 
-           in 
-             
-             let f
-             in if 2 then
-                  ~3
-                else 
-                  asdf
-             end
-                 
-                 (
-                  if foo then 1 else 2;
-                  ())
-           end
-       end
-      | toStringFKind =
-       let bla
-       in foooooooooo;
-          faaaaaaaaaaa
-       end
-           
-           
-           let bla
-           in (fn toto => 1,
-               fn tata => 2)
-           end
-           
-           let
-           in clet1 (fn [nv] => (Conlv, nv, ndc),
-                     fn ([nv],nle) => F.CON(dcon, tycs, nv, lv, nle))
-                    (lv,[v],le)
-           end
-           
-           let
-           in a d
-                awsdfg
-                sadf
-                (fn bla =>
-                    gfsse
-                  | ss => 
-                    asdf)
-           end
-           (* sadgasgf *) 
-           app (fn (fk,f,args,body as F.APP(F.VAR g,vs)) =>
-                   if not C.escaping f
-                      orelse vs = (map (F.VAR o #1) args) andalso
-                             not (C.escaping g)
-                   then
-                     let val g = F.VAR g
-                     in substitute(f, val2sval g, g)
-                     end
-                     handle NotFound =>
-                            addbind (f, Fun(f, body, args, fk, od))
-                   else addbind (f, Fun(f, body, args, fk, od))
-                 | (fk,f,args,body) =>
-                   addbind (f, Fun(f, body, args, fk, od)))
-           
-           (if 1 then 1 + 2 else if
-              1 then
-              1
-              + df
-            else
-              hell
-                  de
-                  der
-                  +1)
-           
-           case
-             case a of
-                2 =>
-                1
-                + 2
-              |  => 
-            of 1 =>
-               sd
-             |  => 
index e440e62827b796266e8eacf23e462241e4dc374e..4a516e1a562207cd948a6beb0e8859f762769040 100644 (file)
 ;; regexps
 ;;
 
-(defvar sml-fixindent-re
-  (concat ".*" (regexp-quote comment-start)
-         "[ \t]*fixindent[ \t]*"
-         (regexp-quote comment-end))
-  "Regexp matching the magic string overriding indentation.")
-
-;;
-
 (defun sml-syms-re (&rest syms)
   (concat "\\<" (regexp-opt (flatten syms) t) "\\>"))
 
index 3adcc53eb7c7ac1b328a630f60f81afdf3c1490d..eb3a0ada841c9e7b645f7d18c7353c95e1660d48 100644 (file)
@@ -305,8 +305,10 @@ Entry to this mode runs the hooks on sml-mode-hook.
   (set (make-local-variable 'indent-line-function) 'sml-indent-line)
   (set (make-local-variable 'comment-start) "(* ")
   (set (make-local-variable 'comment-end) " *)")
+  ;;(set (make-local-variable 'block-comment-start) "* ")
+  ;;(set (make-local-variable 'block-comment-end) "")
   (set (make-local-variable 'comment-column) 40)
-  (set (make-local-variable 'comment-start-skip) "(\\*+[ \t]?")
+  (set (make-local-variable 'comment-start-skip) "(\\*+\\s-*")
   (set (make-local-variable 'comment-indent-function) 'sml-comment-indent)
   (set (make-local-variable 'font-lock-defaults) sml-font-lock-defaults))
 
@@ -440,13 +442,16 @@ If anyone has a good algorithm for this..."
     (sml-with-ist
      ;; Indentation for comments alone on a line, matches the
      ;; proper indentation of the next line.
-     (when (looking-at comment-start-skip) (sml-forward-spaces))
+     (when (looking-at "(\\*") (sml-forward-spaces))
      (let (data
           (sml-point (point))
           (sym (save-excursion (sml-forward-sym))))
        (or
        ;; allow the user to override the indentation
-       (when (looking-at sml-fixindent-re) (current-indentation))
+       (when (looking-at (concat ".*" (regexp-quote comment-start)
+                                 "[ \t]*fixindent[ \t]*"
+                                 (regexp-quote comment-end)))
+         (current-indentation))
 
        ;; continued comment
        (and (looking-at "\\*") (sml-find-comment-indent))
index 36f70bda7d700385bdf9fbe90334c2312c90fa30..ad113b0df7af9b1241da5346ddf5264b7fca7758 100644 (file)
@@ -234,11 +234,11 @@ prettyprinting switches.")
     ("\\(Error\\|Warning:\\) in '\\(.+\\)', line \\([0-9]+\\)" 2 3)
     ;; Moscow ML
     ("File \"\\([^\"]+\\)\", line \\([0-9]+\\)\\(-\\([0-9]+\\)\\)?, characters \\([0-9]+\\)-\\([0-9]+\\):" 1 2 5)
-    ;; SML/NJ:  the file-pattern is restricted to no-spaces to avoid
+    ;; SML/NJ:  the file-pattern is anchored to avoid
     ;; pathological behavior with very long lines.
-    ("^[-= ]*\\([^ ]+\\):\\([0-9]+\\)\\.\\([0-9]+\\)\\(-\\([0-9]+\\)\\.\\([0-9]+\\)\\)? \\(Error\\|Warning\\): .*" 1 sml-make-error 2 3 5 6)
+    ("^[-= ]*\\(.+\\):\\([0-9]+\\)\\.\\([0-9]+\\)\\(-\\([0-9]+\\)\\.\\([0-9]+\\)\\)? \\(Error\\|Warning\\): .*" 1 sml-make-error 2 3 5 6)
     ;; SML/NJ's exceptions:  see above.
-    ("^ +\\(raised at: \\)?\\([^ ]+\\):\\([0-9]+\\)\\.\\([0-9]+\\)\\(-\\([0-9]+\\)\\.\\([0-9]+\\)\\)" 2 sml-make-error 3 4 6 7)))
+    ("^ +\\(raised at: \\)?\\(.+\\):\\([0-9]+\\)\\.\\([0-9]+\\)\\(-\\([0-9]+\\)\\.\\([0-9]+\\)\\)" 2 sml-make-error 3 4 6 7)))
 
 (defvar sml-error-regexp nil
   "*Regexp for matching \(the start of\) an error message.")
@@ -283,7 +283,7 @@ prettyprinting switches.")
 ;; buffer-local
 
 (defvar sml-temp-file nil)
-(defvar sml-error-file nil)             ; file from which the last error came
+;;(defvar sml-error-file nil)             ; file from which the last error came
 (defvar sml-error-cursor nil)           ;   ditto
 
 (defun sml-proc-buffer ()
@@ -678,7 +678,9 @@ be executed to change the compiler's working directory\; a trailing
   (set-marker sml-error-cursor (1- (process-mark (sml-proc))))
   (setq sml-endof-error-alist nil)
   (compilation-forget-errors)
-  (setq compilation-parsing-end sml-error-cursor))
+  (if (markerp compilation-parsing-end)
+      (set-marker compilation-parsing-end sml-error-cursor)
+    (setq compilation-parsing-end sml-error-cursor)))
 
 (defun sml-make-error (f c)
   (let ((err (point-marker))