+1999-06-21 Stefan Monnier <monnier@cs.yale.edu>
+
+ * sml-defs.el (sml-bindings): removed bindings for TAB and M-C-\
+
+1999-06-19 Stefan Monnier <monnier@cs.yale.edu>
+
+ * sml-mode.el (sml-font-lock-keywords): skip type vars in "fun 'a myfn"
+ (sml-calculate-indentation): add a hack to allow the user to manually
+ override the indentation algorithm with a magic comment.
+
+ * sml-mode-startup.el: update the autoloads automatically.
+
1999-06-19 Stefan Monnier <monnier@cs.yale.edu>
* release: 3.9.2
.dvi.ps:
dvips -f $< >$@
+$(PACKAGE)-startup.el: $(ELFILES)
+ $(EMACS) --batch --eval '(setq generated-autoload-file "'`pwd`'/$@")' -f batch-update-autoloads "."
+
######################################################################
default: elcfiles
("\M-\ " . sml-electric-pipe)
("\;" . sml-electric-semi)
("\M-\t" . sml-back-to-outer-indent)
- ("\C-\M-\\" . sml-indent-region)
- ("\t" . sml-indent-line) ; ...except this one
+ ;;("\C-\M-\\" . sml-indent-region)
+ ;;("\t" . sml-indent-line) ; ...except this one
;; Process commands added to sml-mode-map -- these should autoload
("\C-c\C-l" . sml-load-file)
("\C-c`" . sml-next-error))
;; 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) "\\>"))
;;#ident "@(#)$Name$:$Id$"
;; don't forget to add the directory to your load-path
-(setq load-path (cons "@elcdir@" load-path))
+(add-to-list 'load-path "@elcdir@")
;; make sure the mode is loaded when necessary
-(setq auto-mode-alist
- (cons '("\\.s\\(ml\\|ig\\)\\'" . sml-mode) auto-mode-alist))
-(autoload 'sml-mode "sml-mode" "Major mode for editing SML." t)
-(autoload 'run-sml "sml-proc" "Run an inferior SML process" t)
+(add-to-list 'auto-mode-alist '("\\.s\\(ml\\|ig\\)\\'" . sml-mode))
;; put this also if you feel like it (for SML/NJ's compilation manager)
-(setq completion-ignored-extensions (cons "CM/" completion-ignored-extensions))
+(add-to-list 'completion-ignored-extensions "CM/")
+
+;; the rest is the auto-generated autoloads
+\f
+;;;### (autoloads (sml-mode) "sml-mode" "sml-mode.el" (14190 21314))
+;;; Generated autoloads from sml-mode.el
+
+(autoload (quote sml-mode) "sml-mode" "\
+Major mode for editing ML code.
+Entry to this mode runs the hooks on sml-mode-hook.
+\\{sml-mode-map}" t nil)
+
+;;;***
+\f
+;;;### (autoloads (sml-load-file sml-send-buffer sml-send-region
+;;;;;; switch-to-sml run-sml) "sml-proc" "sml-proc.el" (14187 25166))
+;;; Generated autoloads from sml-proc.el
+
+(autoload (quote run-sml) "sml-proc" "\
+Run an inferior ML process, input and output via buffer *sml*.
+With a prefix argument, this command allows you to specify any command
+line options to pass to the complier. The command runs hook functions
+on `comint-mode-hook' and `inferior-sml-mode-hook' in that order.
+
+If there is a process already running in *sml*, just switch to that
+buffer instead.
+
+In fact the name of the buffer created is chosen to reflect the name
+of the program name specified by `sml-program-name', or entered at the
+prompt. You can have several inferior ML process running, but only one
+current one -- given by `sml-buffer' (qv).
+
+\(Type \\[describe-mode] in the process buffer for a list of commands.)" t nil)
+
+(autoload (quote switch-to-sml) "sml-proc" "\
+Switch to the ML process buffer.
+With prefix argument, positions cursor at point, otherwise at end of buffer." t nil)
+
+(autoload (quote sml-send-region) "sml-proc" "\
+Send current region to the inferior ML process.
+Prefix argument means switch-to-sml afterwards.
+
+The region is written out to a temporary file and a \"use <temp-file>\" command
+is sent to the compiler.
+See variables `sml-use-command'." t nil)
+
+(autoload (quote sml-send-buffer) "sml-proc" "\
+Send buffer to inferior shell running ML process.
+With a prefix argument switch to the sml buffer as well
+\(cf. `sml-send-region')." t nil)
+
+(autoload (quote sml-load-file) "sml-proc" "\
+Load an ML file into the current inferior ML process.
+With a prefix argument switch to sml buffer as well.
+
+This command uses the ML command template `sml-use-command' to construct
+the command to send to the ML process; a trailing \";\\n\" will be added
+automatically." t nil)
+
+;;;***
(defconst sml-font-lock-keywords
`(;;(sml-font-comments-and-strings)
- ("\\<\\(fun\\|and\\)\\s-+\\(\\sw+\\)"
+ ("\\<\\(fun\\|and\\)\\s-+\\('\\sw+\\s-+\\)*\\(\\sw+\\)"
(1 font-lock-keyword-face)
- (2 font-lock-function-def-face))
- ("\\<\\(\\(data\\|abs\\|with\\|eq\\)?type\\)\\s-+\\('\\s-*\\sw+\\s-+\\)*\\(\\sw+\\)"
+ (3 font-lock-function-def-face))
+ ("\\<\\(\\(data\\|abs\\|with\\|eq\\)?type\\)\\s-+\\('\\sw+\\s-+\\)*\\(\\sw+\\)"
(1 font-lock-keyword-face)
(4 font-lock-type-def-face))
("\\<\\(val\\)\\s-+\\(\\sw+\\>\\s-*\\)?\\(\\sw+\\)\\s-*="
;;;###Autoload
(defun sml-mode ()
"Major mode for editing ML code.
-Tab indents for ML code.
-Comments are delimited with (* ... *).
-Blank lines and form-feeds separate paragraphs.
-Delete converts tabs to spaces as it moves back.
-
-For information on running an inferior ML process, see the documentation
-for inferior-sml-mode (set this up with \\[sml]).
-
-Customisation: Entry to this mode runs the hooks on sml-mode-hook.
-
-Variables controlling the indentation
-=====================================
-
-Seek help (\\[describe-variable]) on individual variables to get current settings.
-
-sml-indent-level (default 4)
- The indentation of a block of code.
-
-sml-electric-semi-mode (default nil)
- If t, a `\;' will reindent line, and perform a newline.
-
-Mode map
-========
+Entry to this mode runs the hooks on sml-mode-hook.
\\{sml-mode-map}"
(interactive)
(interactive)
(mark-paragraph))
-(defun sml-indent-region (begin end)
- "Indent region of ML code."
- (interactive "r")
- (message "Indenting region...")
- (save-excursion
- (goto-char end) (setq end (point-marker)) (goto-char begin)
- (while (< (point) end)
- (skip-chars-forward "\t\n ")
- (sml-indent-line)
- (end-of-line))
- (move-marker end nil))
- (message "Indenting region... done"))
+;; (defun sml-indent-region (begin end)
+;; "Indent region of ML code."
+;; (interactive "r")
+;; (message "Indenting region...")
+;; (save-excursion
+;; (goto-char end) (setq end (point-marker)) (goto-char begin)
+;; (while (< (point) end)
+;; (skip-chars-forward "\t\n ")
+;; (sml-indent-line)
+;; (end-of-line))
+;; (move-marker end nil))
+;; (message "Indenting region... done"))
(defun sml-indent-line ()
"Indent current line of ML code."
(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))
+
;; continued comment
(and (looking-at "\\*") (sml-find-comment-indent))