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.texi
ViewVC logotype

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

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

revision 1298, Sun Jan 12 18:40:19 2003 UTC revision 1299, Sun Jan 12 19:19:24 2003 UTC
# Line 729  Line 729 
729  @end defvr  @end defvr
730    
731    
 @defvr Hook inferior-sml-load-hook  
 Default: @code{nil}  
   
 This hook is analogous to @code{sml-load-hook} and is run just after the  
 code for @code{inferior-sml-mode} is loaded into Emacs. Use this to set  
 process defaults, and preferred key bindings for the interaction buffer.  
 @end defvr  
   
   
732  @deffn Command switch-to-sml  @deffn Command switch-to-sml
733  Key: @kbd{C-c C-s}  Key: @kbd{C-c C-s}
734  @kindex @kbd{C-c C-s}  @kindex @kbd{C-c C-s}
# Line 1009  Line 1000 
1000  are global (variables):  are global (variables):
1001    
1002  @lisp  @lisp
1003  (defun my-sml-load-hook () "Global defaults for SML mode"  (defun my-sml-mode-hook () "Global defaults for SML mode"
1004    (define-key   sml-mode-map "\C-cd" 'sml-cd))    (define-key   sml-mode-map "\C-cd" 'sml-cd))
1005  (add-hook 'sml-load-hook 'my-sml-load-hook)  (add-hook 'sml-mode-hook 'my-sml-mode-hook)
1006  @end lisp  @end lisp
1007  @noindent  @noindent
1008  This has the effect of binding @code{sml-cd} to the key @kbd{C-c d}.  This has the effect of binding @code{sml-cd} to the key @kbd{C-c d}.
1009  If you want the same behaviour from @kbd{C-c d} in the ML buffer:  If you want the same behaviour from @kbd{C-c d} in the ML buffer:
1010    
1011  @lisp  @lisp
1012  (defun my-inf-sml-load-hook () "Global defaults for inferior SML mode"  (defun my-inf-sml-mode-hook () "Global defaults for inferior SML mode"
1013    (define-key inferior-sml-mode-map "\C-cd" 'sml-cd)    (define-key inferior-sml-mode-map "\C-cd" 'sml-cd)
1014    ;; NB. for SML/NJ '96    ;; NB. for SML/NJ '96
1015    (setq sml-cd-command "OS.FileSys.chDir \"%s\""))    (setq sml-cd-command "OS.FileSys.chDir \"%s\""))
1016  (add-hook 'inferior-sml-load-hook 'my-inf-sml-load-hook)  (add-hook 'inferior-sml-mode-hook 'my-inf-sml-mode-hook)
1017  @end lisp  @end lisp
1018    
1019  There is nothing to stop you rebuilding the entire keymap for  There is nothing to stop you rebuilding the entire keymap for
# Line 1085  Line 1076 
1076  to add @code{NAME} to @code{sml-forms-alist} permanently yourself:  to add @code{NAME} to @code{sml-forms-alist} permanently yourself:
1077    
1078  @lisp  @lisp
1079  (defun my-sml-load-hook () "Global defaults for SML mode"  (defun my-sml-mode-hook () "Global defaults for SML mode"
1080    ;; whatever else you do    ;; whatever else you do
1081    (add-to-list 'sml-forms-alist '("NAME" . FUNCTION)))    (add-to-list 'sml-forms-alist '("NAME" . FUNCTION)))
1082  @end lisp  @end lisp
# Line 1093  Line 1084 
1084  If you want to create templates like `case' that prompt for parameters  If you want to create templates like `case' that prompt for parameters
1085  you'll have to do some Lisp programming. The @code{skeleton} package is  you'll have to do some Lisp programming. The @code{skeleton} package is
1086  a good stating point.  Better yet, you can reuse the wrappers used by  a good stating point.  Better yet, you can reuse the wrappers used by
1087  sml-mode itself in your sml-load-hook:  sml-mode itself in your sml-mode-hook:
1088    
1089  @lisp  @lisp
1090  (add-hook 'sml-load-hook  (add-hook 'sml-mode-hook
1091    (lambda ()    (lambda ()
1092      (sml-def-skeleton "case" "Case expr: "      (sml-def-skeleton "case" "Case expr: "
1093        str " of" \n _ " => ")))        str " of" \n _ " => ")))

Legend:
Removed from v.1298  
changed lines
  Added in v.1299

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