Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Diff of /sml/trunk/sml-mode/sml-defs.el
ViewVC logotype

Diff of /sml/trunk/sml-mode/sml-defs.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 339, Thu Jun 17 16:14:01 1999 UTC revision 535, Fri Feb 18 16:49:10 2000 UTC
# Line 25  Line 25 
25  ;;; Code  ;;; Code
26  ;;;  ;;;
27    
28    (defgroup sml ()
29      "Editing SML code."
30      :group 'languages)
31    
32  (defvar sml-outline-regexp "[ \t]*\\((\\*+\\|\\(let[ \t]+\\)?fun.\\)"  (defvar sml-outline-regexp "[ \t]*\\((\\*+\\|\\(let[ \t]+\\)?fun.\\)"
33    "Regexp matching a major heading.")    "Regexp matching a major heading.")
34    
# Line 40  Line 44 
44      ("\C-c\C-m" . sml-insert-form)      ("\C-c\C-m" . sml-insert-form)
45      ("\C-c\C-i" . sml-mode-info)      ("\C-c\C-i" . sml-mode-info)
46      ("\M-|"     . sml-electric-pipe)      ("\M-|"     . sml-electric-pipe)
47        ("\M-\ "    . sml-electric-pipe)
48      ("\;"       . sml-electric-semi)      ("\;"       . sml-electric-semi)
49      ("\M-\t"    . sml-back-to-outer-indent)      ("\M-\t"    . sml-back-to-outer-indent)
50      ("\C-\M-\\" . sml-indent-region)      ;;("\C-\M-\\"       . sml-indent-region)
51      ("\t"       . sml-indent-line)      ; ...except this one      ;;("\t"     . sml-indent-line)      ; ...except this one
52      ;; Process commands added to sml-mode-map -- these should autoload      ;; Process commands added to sml-mode-map -- these should autoload
53      ("\C-c\C-l" . sml-load-file)      ("\C-c\C-l" . sml-load-file)
54      ("\C-c`"    . sml-next-error))      ;;("\C-c`"  . sml-next-error)
55    "Generic bindings used in sml-mode and sml-inferior-mode.")      )
56      "Generic bindings used in `sml-mode' and `inferior-sml-mode'."
57      :group 'sml)
58    
59  (defmap sml-mode-map  (defmap sml-mode-map
60    '(("\C-c\C-c" . sml-compile)    '(("\C-c\C-c" . sml-compile)
61      ("\C-c\C-s" . switch-to-sml)      ("\C-c\C-s" . switch-to-sml)
62      ("\C-c\C-r" . sml-send-region)      ("\C-c\C-r" . sml-send-region)
63      ("\C-c\C-b" . sml-send-buffer))      ("\C-c\C-b" . sml-send-buffer)
64    "The keymap used in sml-mode."      ([(meta shift down-mouse-1)] . sml-drag-region))
65    :inherit sml-bindings)    "The keymap used in `sml-mode'."
66      :inherit sml-bindings
67      :group 'sml)
68    
69  (defsyntax sml-mode-syntax-table  (defsyntax sml-mode-syntax-table
70    '((?\*   . ". 23n")    `((?\*   . ,(if sml-builtin-nested-comments-flag ". 23n" ". 23"))
71      (?\(   . "()1")      (?\(   . "()1")
72      (?\)   . ")(4")      (?\)   . ")(4")
73      ("._'" . "_")      ("._'" . "_")
# Line 82  Line 91 
91       ["send buffer contents"    sml-send-buffer (featurep 'sml-proc)]       ["send buffer contents"    sml-send-buffer (featurep 'sml-proc)]
92       ["send region"             sml-send-region (featurep 'sml-proc)]       ["send region"             sml-send-region (featurep 'sml-proc)]
93       ["send paragraph"          sml-send-function (featurep 'sml-proc)]       ["send paragraph"          sml-send-function (featurep 'sml-proc)]
94       ["goto next error"         sml-next-error  (featurep 'sml-proc)]       ;;["goto next error"               sml-next-error  (featurep 'sml-proc)]
95         ["goto next error"         next-error      (featurep 'sml-proc)]
96       ["---" nil nil]       ["---" nil nil]
97       ["Standard ML of New Jersey" sml-smlnj     (fboundp 'sml-smlnj)]       ["Standard ML of New Jersey" sml-smlnj     (fboundp 'sml-smlnj)]
98       ["Poly/ML"                 sml-poly-ml     (fboundp 'sml-poly-ml)]       ["Poly/ML"                 sml-poly-ml     (fboundp 'sml-poly-ml)]
# Line 107  Line 117 
117      ["SML mode *info*"             sml-mode-info t]      ["SML mode *info*"             sml-mode-info t]
118      ["SML mode version"            sml-mode-version t]      ["SML mode version"            sml-mode-version t]
119      ["-----" nil nil]      ["-----" nil nil]
120      ["Remove overlay"    (sml-error-overlay 'undo) :active (sml-overlay-active-p)]))      ["Remove overlay"    (sml-error-overlay 'undo) ;:active (sml-overlay-active-p)
121         ]))
122    
123  ;;; Make's sure they appear in the menu bar when sml-mode-map is active.  ;;; Make's sure they appear in the menu bar when sml-mode-map is active.
124  ;; On the hook for XEmacs only -- see easy-menu-add in auc-menu.el.  ;; On the hook for XEmacs only -- see easy-menu-add in auc-menu.el.
# Line 134  Line 145 
145    '("let" "abstype" "local" "struct" "sig")    '("let" "abstype" "local" "struct" "sig")
146    "Symbols matching the `end' symbol.")    "Symbols matching the `end' symbol.")
147    
148  (defconst sml-begin-symbols-re  (defconst sml-begin-syms-re
149    (sml-syms-re "let" "abstype" "local" "struct" "sig")    (sml-syms-re "let" "abstype" "local" "struct" "sig")
150    "Symbols matching the `end' symbol.")    "Symbols matching the `end' symbol.")
151    
# Line 194  Line 205 
205  (defconst sml-symbol-indent  (defconst sml-symbol-indent
206    '(("fn" . -3)    '(("fn" . -3)
207      ("of" . 1)      ("of" . 1)
208        ("|" . -2)
209      ;;("in" . 1)      ;;("in" . 1)
210      ("d=" . 2))      ("d=" . 2))
211    "Special indentation alist for some symbols.")    "Special indentation alist for some symbols.")
212    
213  (defconst sml-open-paren  (defconst sml-open-paren
214    (sml-preproc-alist    (sml-preproc-alist
215     `((,(list* "with" "in" sml-begin-syms) . "\\<end\\>")))     `((,(list* "with" "in" sml-begin-syms) ,sml-begin-syms-re "\\<end\\>")))
216    "Symbols that should behave somewhat like opening parens.")    "Symbols that should behave somewhat like opening parens.")
217    
218  (defconst sml-close-paren  (defconst sml-close-paren
219    `(("in" "\\<l\\(ocal\\|et\\)\\>")    `(("in" "\\<l\\(ocal\\|et\\)\\>")
220      ("with" "\\<abstype\\>")      ("with" "\\<abstype\\>")
221      ("withtype" "\\<\\(abs\\|data\\)type\\>")      ("withtype" "\\<\\(abs\\|data\\)type\\>")
222      ("end" ,sml-begin-symbols-re)      ("end" ,sml-begin-syms-re)
223      ("then" "\\<if\\>")      ("then" "\\<if\\>")
224      ("else" "\\<if\\>" (sml-bolp))      ("else" "\\<if\\>" (sml-bolp))
225      ("of" "\\<case\\>")      ("of" "\\<case\\>")
# Line 236  Line 248 
248  (defconst sml-pipehead-re  (defconst sml-pipehead-re
249    (concat    (concat
250     "|\\S.\\|"     "|\\S.\\|"
251     (sml-syms-re "of" "fun" "fn" "and" "handle" "datatype" "abstype"))     (sml-syms-re "fun" "fn" "and" "handle" "datatype" "abstype"))
252    "A `|' corresponds to one of these.")    "A `|' corresponds to one of these.")
253    
254  ;;  ;;

Legend:
Removed from v.339  
changed lines
  Added in v.535

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0