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-mode.el
ViewVC logotype

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

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

revision 346, Mon Jun 21 05:07:29 1999 UTC revision 347, Mon Jun 21 15:08:30 1999 UTC
# Line 199  Line 199 
199    
200  (defconst sml-font-lock-keywords  (defconst sml-font-lock-keywords
201    `(;;(sml-font-comments-and-strings)    `(;;(sml-font-comments-and-strings)
202      ("\\<\\(fun\\|and\\)\\s-+\\(\\sw+\\)"      ("\\<\\(fun\\|and\\)\\s-+\\('\\sw+\\s-+\\)*\\(\\sw+\\)"
203       (1 font-lock-keyword-face)       (1 font-lock-keyword-face)
204       (2 font-lock-function-def-face))       (3 font-lock-function-def-face))
205      ("\\<\\(\\(data\\|abs\\|with\\|eq\\)?type\\)\\s-+\\('\\s-*\\sw+\\s-+\\)*\\(\\sw+\\)"      ("\\<\\(\\(data\\|abs\\|with\\|eq\\)?type\\)\\s-+\\('\\sw+\\s-+\\)*\\(\\sw+\\)"
206       (1 font-lock-keyword-face)       (1 font-lock-keyword-face)
207       (4 font-lock-type-def-face))       (4 font-lock-type-def-face))
208      ("\\<\\(val\\)\\s-+\\(\\sw+\\>\\s-*\\)?\\(\\sw+\\)\\s-*="      ("\\<\\(val\\)\\s-+\\(\\sw+\\>\\s-*\\)?\\(\\sw+\\)\\s-*="
# Line 282  Line 282 
282  ;;;###Autoload  ;;;###Autoload
283  (defun sml-mode ()  (defun sml-mode ()
284    "Major mode for editing ML code.    "Major mode for editing ML code.
285  Tab indents for ML code.  Entry to this mode runs the hooks on sml-mode-hook.
 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  
 ========  
286  \\{sml-mode-map}"  \\{sml-mode-map}"
287    
288    (interactive)    (interactive)
# Line 399  Line 377 
377    (interactive)    (interactive)
378    (mark-paragraph))    (mark-paragraph))
379    
380  (defun sml-indent-region (begin end)  ;; (defun sml-indent-region (begin end)
381    "Indent region of ML code."  ;;   "Indent region of ML code."
382    (interactive "r")  ;;   (interactive "r")
383    (message "Indenting region...")  ;;   (message "Indenting region...")
384    (save-excursion  ;;   (save-excursion
385      (goto-char end) (setq end (point-marker)) (goto-char begin)  ;;     (goto-char end) (setq end (point-marker)) (goto-char begin)
386      (while (< (point) end)  ;;     (while (< (point) end)
387        (skip-chars-forward "\t\n ")  ;;       (skip-chars-forward "\t\n ")
388        (sml-indent-line)  ;;       (sml-indent-line)
389        (end-of-line))  ;;       (end-of-line))
390      (move-marker end nil))  ;;     (move-marker end nil))
391    (message "Indenting region... done"))  ;;   (message "Indenting region... done"))
392    
393  (defun sml-indent-line ()  (defun sml-indent-line ()
394    "Indent current line of ML code."    "Indent current line of ML code."
# Line 467  Line 445 
445             (sml-point (point))             (sml-point (point))
446             (sym (save-excursion (sml-forward-sym))))             (sym (save-excursion (sml-forward-sym))))
447         (or         (or
448            ;; allow the user to override the indentation
449            (when (looking-at sml-fixindent-re) (current-indentation))
450    
451          ;; continued comment          ;; continued comment
452          (and (looking-at "\\*") (sml-find-comment-indent))          (and (looking-at "\\*") (sml-find-comment-indent))
453    

Legend:
Removed from v.346  
changed lines
  Added in v.347

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