68 |
("%&$+-/:<=>?@`^|" . ".")) |
("%&$+-/:<=>?@`^|" . ".")) |
69 |
"The syntax table used in sml-mode.") |
"The syntax table used in sml-mode.") |
70 |
|
|
71 |
|
(defconst sml-menu |
72 |
|
'("SML" |
73 |
|
("Process" |
74 |
|
["Start default ML compiler" sml :active (fboundp 'sml)] |
75 |
|
["-" nil nil] |
76 |
|
["run CM.make" sml-make :active (featurep 'sml-proc)] |
77 |
|
["load ML source file" sml-load-file :active (featurep 'sml-proc)] |
78 |
|
["switch to ML buffer" switch-to-sml :active (featurep 'sml-proc)] |
79 |
|
["--" nil nil] |
80 |
|
["send buffer contents" sml-send-buffer :active (featurep 'sml-proc)] |
81 |
|
["send region" sml-send-region :active (featurep 'sml-proc)] |
82 |
|
["send paragraph" sml-send-function :active (featurep 'sml-proc)] |
83 |
|
["goto next error" sml-next-error :active (featurep 'sml-proc)] |
84 |
|
["---" nil nil] |
85 |
|
["Standard ML of New Jersey" sml-smlnj :active (fboundp 'sml-smlnj)] |
86 |
|
["Poly/ML" sml-poly-ml :active (fboundp 'sml-poly-ml)] |
87 |
|
["Moscow ML" sml-mosml :active (fboundp 'sml-mosml)] |
88 |
|
["Help for Inferior ML" (describe-function 'inferior-sml-mode) :active (featurep 'sml-proc)]) |
89 |
|
["electric pipe" sml-electric-pipe t] |
90 |
|
["insert SML form" sml-insert-form t] |
91 |
|
("Forms" |
92 |
|
["abstype" sml-form-abstype t] |
93 |
|
["datatype" sml-form-datatype t] |
94 |
|
["-" nil nil] |
95 |
|
["let" sml-form-let t] |
96 |
|
["local" sml-form-local t] |
97 |
|
["case" sml-form-case t] |
98 |
|
["--" nil nil] |
99 |
|
["signature" sml-form-signature t] |
100 |
|
["functor" sml-form-functor t] |
101 |
|
["structure" sml-form-structure t]) |
102 |
|
("Format/Mode Variables" |
103 |
|
["indent region" sml-indent-region t] |
104 |
|
["outdent" sml-back-to-outer-indent t] |
105 |
|
["-" nil nil] |
106 |
|
["set indent-level" sml-indent-level t] |
107 |
|
["set pipe-indent" sml-pipe-indent t] |
108 |
|
["--" nil nil] |
109 |
|
["toggle type-of-indent" (sml-type-of-indent) t] |
110 |
|
["toggle nested-if-indent" (sml-nested-if-indent) t] |
111 |
|
["toggle case-indent" (sml-case-indent) t] |
112 |
|
["toggle electric-semi-mode" (sml-electric-semi-mode) t]) |
113 |
|
["-----" nil nil] |
114 |
|
["SML mode help (brief)" describe-mode t] |
115 |
|
["SML mode *info*" sml-mode-info t] |
116 |
|
["SML mode version" sml-mode-version t] |
117 |
|
["-----" nil nil] |
118 |
|
["Remove overlay" (sml-error-overlay 'undo) :active (sml-overlay-active-p)])) |
119 |
|
|
120 |
|
(when (ignore-errors (require 'easymenu)) |
121 |
|
(easy-menu-define sml-mode-menu |
122 |
|
sml-mode-map |
123 |
|
"Menu used in sml-mode." |
124 |
|
sml-menu)) |
125 |
|
|
126 |
|
;;; Make's sure they appear in the menu bar when sml-mode-map is active. |
127 |
|
;; On the hook for XEmacs only -- see easy-menu-add in auc-menu.el. |
128 |
|
;; (defun sml-mode-menu-bar () |
129 |
|
;; "Make sure menus appear in the menu bar as well as under mouse 3." |
130 |
|
;; (and (eq major-mode 'sml-mode) |
131 |
|
;; (easy-menu-add sml-mode-menu sml-mode-map))) |
132 |
|
;; (add-hook 'sml-mode-hook 'sml-mode-menu-bar) |
133 |
|
|
134 |
;; |
;; |
135 |
;; regexps |
;; regexps |
136 |
;; |
;; |
173 |
(cons "\\<local\\>" '(sml-indent-level 0)) |
(cons "\\<local\\>" '(sml-indent-level 0)) |
174 |
(cons "\\<of\\>" '(3 nil)) |
(cons "\\<of\\>" '(3 nil)) |
175 |
(cons "\\<else\\>" '(sml-indent-level 0)) |
(cons "\\<else\\>" '(sml-indent-level 0)) |
176 |
(cons "\\<in\\>" '(sml-indent-level nil)) |
(cons "\\<in\\|fun\\|and\\>" '(sml-indent-level nil)) |
177 |
(cons (sml-syms-re "abstype" "and" "case" "of" "datatype" |
(cons (sml-syms-re "abstype" "case" "datatype" |
178 |
"fun" "if" "then" "else" "sharing" "infix" "infixr" |
"if" "then" "else" "sharing" "infix" "infixr" |
179 |
"let" "in" "local" "nonfix" "open" "raise" "sig" |
"let" "local" "nonfix" "open" "raise" "sig" |
180 |
"struct" "type" "val" "while" "do" "with" "withtype") |
"struct" "type" "val" "while" "do" "with" "withtype") |
181 |
'sml-indent-level)) |
'sml-indent-level)) |
182 |
"") |
"") |