]> code.delx.au - gnu-emacs-elpa/commitdiff
* sml-defs.el (sml-bindings): removed bindings for TAB and M-C-\
authormonnier <>
Mon, 21 Jun 1999 14:08:30 +0000 (14:08 +0000)
committermonnier <>
Mon, 21 Jun 1999 14:08:30 +0000 (14:08 +0000)
* sml-mode.el (sml-font-lock-keywords): skip type vars in "fun 'a myfn"
(sml-calculate-indentation): add a hack to allow the user to manually
  override the indentation algorithm with a magic comment.
* sml-mode-startup.el: update the autoloads automatically.

ChangeLog
Makefile
sml-defs.el
sml-mode-startup.el
sml-mode.el

index 8feac9dde9ee3b1e785ccb0cb93bb3fae94c6bed..698d8a8846ae2c548019f9c77f9ecfcc8d8ecfbb 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+1999-06-21  Stefan Monnier  <monnier@cs.yale.edu>
+
+       * sml-defs.el (sml-bindings): removed bindings for TAB and M-C-\
+
+1999-06-19  Stefan Monnier  <monnier@cs.yale.edu>
+
+       * sml-mode.el (sml-font-lock-keywords): skip type vars in "fun 'a myfn"
+       (sml-calculate-indentation): add a hack to allow the user to manually
+         override the indentation algorithm with a magic comment.
+
+       * sml-mode-startup.el: update the autoloads automatically.
+
 1999-06-19  Stefan Monnier  <monnier@cs.yale.edu>
 
        * release: 3.9.2
index 49ba619a52ad0d6be1fe370fdd1607417281335d..2b40316fcb7b713a59523b1c2b853a2851b1048b 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -61,6 +61,9 @@ TEXEXTS =  *.cps *.fns *.kys *.vr *.tp *.pg *.log *.aux *.toc *.cp *.ky *.fn
 .dvi.ps:
        dvips -f $< >$@
 
+$(PACKAGE)-startup.el:  $(ELFILES)
+       $(EMACS) --batch --eval '(setq generated-autoload-file "'`pwd`'/$@")' -f batch-update-autoloads "."
+
 ######################################################################
 
 default: elcfiles
index 448f0d43c7836ab4606973c2715a65b7fe4347ce..e440e62827b796266e8eacf23e462241e4dc374e 100644 (file)
@@ -43,8 +43,8 @@
     ("\M-\ "   . sml-electric-pipe)
     ("\;"      . sml-electric-semi)
     ("\M-\t"   . sml-back-to-outer-indent)
-    ("\C-\M-\\"        . sml-indent-region)
-    ("\t"      . sml-indent-line)      ; ...except this one
+    ;;("\C-\M-\\"      . sml-indent-region)
+    ;;("\t"    . sml-indent-line)      ; ...except this one
     ;; Process commands added to sml-mode-map -- these should autoload
     ("\C-c\C-l"        . sml-load-file)
     ("\C-c`"   . sml-next-error))
 ;; regexps
 ;;
 
+(defvar sml-fixindent-re
+  (concat ".*" (regexp-quote comment-start)
+         "[ \t]*fixindent[ \t]*"
+         (regexp-quote comment-end))
+  "Regexp matching the magic string overriding indentation.")
+
+;;
+
 (defun sml-syms-re (&rest syms)
   (concat "\\<" (regexp-opt (flatten syms) t) "\\>"))
 
index df43c3fa383200190662eb115d21187818dc9c5f..11a1139967b7a83266d88e132173fe0789ca218e 100644 (file)
@@ -5,13 +5,69 @@
 ;;#ident "@(#)$Name$:$Id$"
 
 ;; don't forget to add the directory to your load-path
-(setq load-path (cons "@elcdir@" load-path))
+(add-to-list 'load-path "@elcdir@")
 
 ;; make sure the mode is loaded when necessary
-(setq auto-mode-alist
-      (cons '("\\.s\\(ml\\|ig\\)\\'" . sml-mode) auto-mode-alist))
-(autoload 'sml-mode "sml-mode" "Major mode for editing SML." t)
-(autoload 'run-sml "sml-proc" "Run an inferior SML process" t)
+(add-to-list 'auto-mode-alist '("\\.s\\(ml\\|ig\\)\\'" . sml-mode))
 
 ;; put this also if you feel like it (for SML/NJ's compilation manager)
-(setq completion-ignored-extensions (cons "CM/" completion-ignored-extensions))
+(add-to-list 'completion-ignored-extensions "CM/")
+
+;; the rest is the auto-generated autoloads
+\f
+;;;### (autoloads (sml-mode) "sml-mode" "sml-mode.el" (14190 21314))
+;;; Generated autoloads from sml-mode.el
+
+(autoload (quote sml-mode) "sml-mode" "\
+Major mode for editing ML code.
+Entry to this mode runs the hooks on sml-mode-hook.
+\\{sml-mode-map}" t nil)
+
+;;;***
+\f
+;;;### (autoloads (sml-load-file sml-send-buffer sml-send-region
+;;;;;;  switch-to-sml run-sml) "sml-proc" "sml-proc.el" (14187 25166))
+;;; Generated autoloads from sml-proc.el
+
+(autoload (quote run-sml) "sml-proc" "\
+Run an inferior ML process, input and output via buffer *sml*. 
+With a prefix argument, this command allows you to specify any command
+line options to pass to the complier. The command runs hook functions
+on `comint-mode-hook' and `inferior-sml-mode-hook' in that order.
+
+If there is a process already running in *sml*, just switch to that
+buffer instead. 
+
+In fact the name of the buffer created is chosen to reflect the name
+of the program name specified by `sml-program-name', or entered at the
+prompt. You can have several inferior ML process running, but only one
+current one -- given by `sml-buffer' (qv).
+
+\(Type \\[describe-mode] in the process buffer for a list of commands.)" t nil)
+
+(autoload (quote switch-to-sml) "sml-proc" "\
+Switch to the ML process buffer.
+With prefix argument, positions cursor at point, otherwise at end of buffer." t nil)
+
+(autoload (quote sml-send-region) "sml-proc" "\
+Send current region to the inferior ML process.
+Prefix argument means switch-to-sml afterwards.
+
+The region is written out to a temporary file and a \"use <temp-file>\" command
+is sent to the compiler.
+See variables `sml-use-command'." t nil)
+
+(autoload (quote sml-send-buffer) "sml-proc" "\
+Send buffer to inferior shell running ML process. 
+With a prefix argument switch to the sml buffer as well
+\(cf. `sml-send-region')." t nil)
+
+(autoload (quote sml-load-file) "sml-proc" "\
+Load an ML file into the current inferior ML process. 
+With a prefix argument switch to sml buffer as well.
+
+This command uses the ML command template `sml-use-command' to construct
+the command to send to the ML process; a trailing \";\\n\" will be added
+automatically." t nil)
+
+;;;***
index 3728b686f706a0029ea0d398a6a7dd8570bea17c..3adcc53eb7c7ac1b328a630f60f81afdf3c1490d 100644 (file)
@@ -199,10 +199,10 @@ Full documentation will be available after autoloading the function."))
 
 (defconst sml-font-lock-keywords
   `(;;(sml-font-comments-and-strings)
-    ("\\<\\(fun\\|and\\)\\s-+\\(\\sw+\\)"
+    ("\\<\\(fun\\|and\\)\\s-+\\('\\sw+\\s-+\\)*\\(\\sw+\\)"
      (1 font-lock-keyword-face)
-     (2 font-lock-function-def-face))
-    ("\\<\\(\\(data\\|abs\\|with\\|eq\\)?type\\)\\s-+\\('\\s-*\\sw+\\s-+\\)*\\(\\sw+\\)"
+     (3 font-lock-function-def-face))
+    ("\\<\\(\\(data\\|abs\\|with\\|eq\\)?type\\)\\s-+\\('\\sw+\\s-+\\)*\\(\\sw+\\)"
      (1 font-lock-keyword-face)
      (4 font-lock-type-def-face))
     ("\\<\\(val\\)\\s-+\\(\\sw+\\>\\s-*\\)?\\(\\sw+\\)\\s-*="
@@ -282,29 +282,7 @@ Full documentation will be available after autoloading the function."))
 ;;;###Autoload
 (defun sml-mode ()
   "Major mode for editing ML code.
-Tab indents for ML code.
-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
-========
+Entry to this mode runs the hooks on sml-mode-hook.
 \\{sml-mode-map}"
 
   (interactive)
@@ -399,18 +377,18 @@ If anyone has a good algorithm for this..."
   (interactive)
   (mark-paragraph))
 
-(defun sml-indent-region (begin end)
-  "Indent region of ML code."
-  (interactive "r")
-  (message "Indenting region...")
-  (save-excursion
-    (goto-char end) (setq end (point-marker)) (goto-char begin)
-    (while (< (point) end)
-      (skip-chars-forward "\t\n ")
-      (sml-indent-line)
-      (end-of-line))
-    (move-marker end nil))
-  (message "Indenting region... done"))
+;; (defun sml-indent-region (begin end)
+;;   "Indent region of ML code."
+;;   (interactive "r")
+;;   (message "Indenting region...")
+;;   (save-excursion
+;;     (goto-char end) (setq end (point-marker)) (goto-char begin)
+;;     (while (< (point) end)
+;;       (skip-chars-forward "\t\n ")
+;;       (sml-indent-line)
+;;       (end-of-line))
+;;     (move-marker end nil))
+;;   (message "Indenting region... done"))
 
 (defun sml-indent-line ()
   "Indent current line of ML code."
@@ -467,6 +445,9 @@ If anyone has a good algorithm for this..."
           (sml-point (point))
           (sym (save-excursion (sml-forward-sym))))
        (or
+       ;; allow the user to override the indentation
+       (when (looking-at sml-fixindent-re) (current-indentation))
+
        ;; continued comment
        (and (looking-at "\\*") (sml-find-comment-indent))