]> code.delx.au - gnu-emacs-elpa/blobdiff - packages/sml-mode/sml-mode.el
Merge branch 'master' of github.com:leoliu/ggtags
[gnu-emacs-elpa] / packages / sml-mode / sml-mode.el
index e1ee75bb058e7e6cb7dbf6b348f37615107504a3..aee66baf84d25e17fb78be4326e353ba60bf31c9 100644 (file)
@@ -1,9 +1,9 @@
 ;;; 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
@@ -656,7 +656,7 @@ Assumes point is right before the | symbol."
 ;;;; 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)
@@ -678,9 +678,9 @@ Assumes point is right before the | symbol."
              (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))
@@ -1201,7 +1201,7 @@ TAB file name completion, as in shell-mode, etc.."
   (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)
@@ -1227,7 +1227,6 @@ TAB file name completion, as in shell-mode, etc.."
 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)
@@ -1254,6 +1253,7 @@ See also (info \"(sml-mode)Top\").
   (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.