;;; sml-mode.el --- Major mode for editing (Standard) ML -*- lexical-binding: t; coding: utf-8 -*-
-;; Copyright (C) 1989,1999,2000,2004,2007,2010-2012 Free Software Foundation, Inc.
+;; Copyright (C) 1989,1999,2000,2004,2007,2010-2013 Free Software Foundation, Inc.
;; Maintainer: (Stefan Monnier) <monnier@iro.umontreal.ca>
-;; Version: 6.2
+;; Version: 6.4
;; Keywords: SML
;; Author: Lars Bo Nielsen
;; Olin Shivers
(basic sml-indent-level)
(args sml-indent-args)))
(:list-intro (member token '("fn")))
+ (:close-all t)
(:after
(cond
((equal token "struct") 0)
;;;; Imenu support
;;;;
-(defvar sml-imenu-regexp
+(defconst sml-imenu-regexp
(concat "^[ \t]*\\(let[ \t]+\\)?"
(regexp-opt (append sml-module-head-syms
'("and" "fun" "datatype" "abstype" "type")) t)
(name (sml-smie-forward-token)))
;; Eliminate trivial renamings.
(when (or (not (member kind '("structure" "signature")))
- (progn (search-forward "=")
- (forward-comment (point-max))
- (looking-at "sig\\|struct")))
+ (when (search-forward "=" nil t)
+ (forward-comment (point-max))
+ (looking-at "sig\\|struct")))
(push (cons (concat (make-string (/ column 2) ?\ ) name) location)
alist)))))
alist))
(add-hook 'next-error-hook 'inferior-sml-next-error-hook)
;; Make TAB add a " rather than a space at the end of a file name.
- (set (make-local-variable 'comint-completion-addsuffix) '(?/ . ?\"))
+ (set (make-local-variable 'comint-completion-addsuffix) '("/" . "\""))
(set (make-local-variable 'font-lock-defaults)
inferior-sml-font-lock-defaults)
This mode runs `sml-mode-hook' just before exiting.
See also (info \"(sml-mode)Top\").
\\{sml-mode-map}"
- (set (make-local-variable 'sml-prog-proc-descriptor) sml-pp-functions)
(set (make-local-variable 'font-lock-defaults) sml-font-lock-defaults)
(set (make-local-variable 'outline-regexp) sml-outline-regexp)
(set (make-local-variable 'imenu-create-index-function)
(sml-mode-variables))
(defun sml-mode-variables ()
+ (set (make-local-variable 'sml-prog-proc-descriptor) sml-pp-functions)
(set-syntax-table sml-mode-syntax-table)
(setq local-abbrev-table sml-mode-abbrev-table)
;; Setup indentation and sexp-navigation.