Stefan Monnier [Wed, 11 Apr 2012 20:28:24 +0000 (16:28 -0400)]
Use SMIE by default and make sml-oldindent optional.
* sml-mode.el: Only load sml-oldindent if necessary.
(sml-use-smie): Default to t.
(sml-smie-datatype-|-p): Better handle incomplete datatype branch.
(sml-mode): Use prog-mode. Setup electric-layout and electric-indent.
(sml-mode-variables): Always setup SMIE if possible.
(sml-imenu-create-index, sml-funname-of-and, sml-electric-pipe)
(sml-beginning-of-defun, sml-defuse-symdata-at-point)
(sml-yacc-font-lock-keywords, sml-yacc-indentation):
Avoid sml-oldindent functions.
(sml-find-forward): Move from sml-oldindent and re-implement.
(sml-electric-semi): Use self-insert-command so electric-layout and
electric-indent can do their job.
(sml-smie-find-matching-starter, sml-find-matching-starter)
(sml-smie-skip-siblings, sml-skip-siblings): New functions.
* sml-oldindent.el (sml-starters-indent-after, sml-exptrail-syms):
Remove, unused.
(sml-find-forward): Move back to sml-mode.el.
(sml-old-find-matching-starter): Rename from sml-find-matching-starter.
(sml-old-skip-siblings): Move&rename from sml-mode:sml-skip-siblings.
Stefan Monnier [Wed, 11 Apr 2012 15:40:56 +0000 (11:40 -0400)]
Get rid of ancient compatibility and small utility file.
* sml-proc.el (inferior-sml-mode-map): Don't use defmap.
* sml-move.el (sml-internal-syntax-table): Don't use defsyntax.
* sml-mode.el (sml-syntax-prop-table): Don't use defsyntax.
(sml-electric-space): `last-command-char' -> `last-command-event'.
(sml-defuse-jump-to-def): Don't use goto-line from Elisp.
* sml-defs.el (sml-mode-map): Don't use defmap.
(sml-mode-syntax-table): Don't use defsyntax.
(sml-preproc-alist, sml-builtin-nested-comments-flag):
Move from sml-util.el.
* sml-compat.el, sml-utils.el: Remove.
* makefile.pkg (ELFILES): Update.
Stefan Monnier [Wed, 11 Apr 2012 15:00:58 +0000 (11:00 -0400)]
Add SMIE support.
* .bzrignore: New file.
* makefile.pkg (test): Use sml-mode-startup.
* sml-mode.el (sml-use-smie): New config var.
(sml-smie-grammar, sml-indent-separator-outdent): New vars.
(sml-smie-rules, sml-smie-definitional-equal-p)
(sml-smie-non-nested-of-p, sml-smie-datatype-|-p)
(sml-smie-forward-token-1, sml-smie-forward-token)
(sml-smie-backward-token-1, sml-smie-backward-token): New functions.
(sml-mode): Don't set forward-sexp-function.
(sml-mode-variables): Set it here instead, and setup SMIE instead
if applicable.
monnier [Thu, 4 Mar 2010 20:07:06 +0000 (20:07 +0000)]
* sml-mode.el: Don't setup load-path here any more.
* Makefile ($(PACKAGE)-startup.el): Recreate from scratch every time.
Setup load-path.
(dist): Try to update it to use Svn rather than CVS.
* NEWS: Update.
monnier [Mon, 15 Nov 2004 04:11:27 +0000 (04:11 +0000)]
(sml-font-lock-symbols, sml-font-lock-symbols-alist): New vars.
(sml-font-lock-compose-symbol, sml-font-lock-symbols-keywords): New funs.
(sml-font-lock-keywords): Use them.
(sml-error-regexp-alist): Use new compile.el features if available.
(sml-send-region): Remove unused var `file'.
(sml-drag-region): Remove unused function.
(sml-update-cursor): Use compilation-fake-loc if available.
(compilation-goto-locus): Only advise if necessary.
* testcases.sml: Add a nasty case that is still wrong.
* sml-proc.el (sml-error-regexp-alist): Tune the regexp for sml/nj.
* sml-mode.el (sml-mode): Batter handle paragraphs in comments.
(sml-mode-variables): Clean up paragraph settings.
(sml-electric-pipe): Fix a boundary bug.
(sml-indent-starter, sml-get-sym-indent, sml-find-matching-starter):
Fix indentation algorithm. Can't remember what it was about.
This code is nasty, I just can't understand what's doing what.
(completion-ignored-extensions): Add the new .cm directory.
(sml-rightalign-and): New defcustom.
(sml-tyvarseq-re): New var.
(sml-font-lock-keywords): Use it.
(sml-imenu-create-index): Don't get confused by tyvarseq's.
(sml-mode-variables): Don't set `comment-column'.
(sml-funname-of-and): New function.
(sml-electric-pipe): Use it.
(sml-find-comment-indent): Try to ignore comment-markers in strings.
(sml-calculate-indentation): Handle closing parens specially.
(sml-indent-pipe): Recognize the case where `and' defines a datatype.
(sml-dangling-sym): Make it work if the symbol is an open-paren.
(sml-indent-default): Change the behavior when preceded by `end',
although I'm not quite sure why.
Understand dangling open-parens.
Properly skip *all* subexpressions of lower precedence.
Allow use of sml-symbol-indent to outdent lines starting with , or ;.
(sml-insert-form): Use preceding-char to avoid bug at bobp.
monnier [Sun, 24 Dec 2000 19:59:53 +0000 (19:59 +0000)]
Require `skeleton'.
(sml-mode): Add the menu for XEmacs. Make sure @ is a valid skeleton.
(sml-comment-indent): Remove.
(sml-mode-variables): Don't set comment-indent-function.
(sml-def-skeleton): Nop if skeletons aren't available.
(skeletons): Use `> _' and `@'.
(sml-forms-menu): Don't bother with easy-menu-filter-return crap.
(sml-cm-mode-syntax-table, sml-cm-font-lock-keywords): New vars.
(sml-cm-mode): Use define-derived-mode rather than define-generic-mode.
(sml-lex-font-lock-keywords, sml-lex-font-lock-defaults): New vars.
(sml-yacc-font-lock-keywords): Use sml-lex-font-lock-keywords.
Refine pattern to recognize the %prec keyword.
(sml-yacc-font-lock-defaults): Fix typo.
monnier [Sat, 7 Oct 2000 02:21:59 +0000 (02:21 +0000)]
Make the toplevel closer to usual practice.
(sml-imenu-regexp, sml-imenu-create-index): New var and fun.
(sml-mode): Use them.
(sml-beginning-of-defun): Add `and' as function-leader.
(sml-lex-mode): New trivial mode.
(sml-yacc-bnf-face, sml-yacc-indent-action, sml-yacc-indent-pipe)
(sml-yacc-indent-term, sml-yacc-font-lock-keywords)
(sml-yacc-font-lock-defaults): New vars.
(sml-yacc-indent-line, sml-yacc-indentation, sml-yacc-mode): New funs.
monnier [Thu, 24 Aug 2000 19:35:39 +0000 (19:35 +0000)]
* sml-proc.el (inferior-sml-mode-map): Don't inherit from sml-bindings.
Add the binding for C-c C-l explicitly instead.
(sml-run): Look in cwd (but only if the command has slashes).
* sml-mode.el (sml-mode-abbrev-table): Remove (created by
define-derived-mode).
(sml-mode): Setup add-log's current-defun-function.
(sml-indent-line): Never indent to a negative level.
(sml-skip-siblings, sml-beginning-of-defun, sml-max-name-components)
(sml-current-fun-name): New funs and vars for add-log support.
(sml-comment-indent): Simplify.
(sml-def-skeleton): Also create the skeleton as an abbrev.
(skeletons): New for "struct", "sig", "val", "fn" and "fun".
(sml-electric-space): Rewrite to use abbrev's machinery.
* sml-defs.el (sml-mode-map): merge with sml-bindings.
(sml-bindings): Remove.