is fixed to uses a marker.
* sml-mode.el (sml-indent): fix the `fixindent'.
+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.
.dvi.ps:
dvips -f $< >$@
-$(PACKAGE)-startup.el: $(ELFILES)
- $(EMACS) --batch --eval '(setq generated-autoload-file "'`pwd`'/$@")' -f batch-update-autoloads "."
-
######################################################################
default: elcfiles
### 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)
* 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
- | =>
;; 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) "\\>"))
(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))
(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))
("\\(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.")
;; 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 ()
(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))