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 332, Tue Jun 15 00:51:38 1999 UTC revision 333, Tue Jun 15 03:41:26 1999 UTC
# Line 509  Line 509 
509                 (+ (current-column) sml-indent-case-of)))                 (+ (current-column) sml-indent-case-of)))
510    
511          (and (looking-at sml-starters-re)          (and (looking-at sml-starters-re)
512               (let ((sym (sml-move-read (sml-move-if (not (sml-backward-arg))))))               (let ((sym (unless (save-excursion (sml-backward-arg))
513                              (sml-backward-spaces)
514                              (sml-backward-sym))))
515                 (if sym (sml-get-sym-indent sym)                 (if sym (sml-get-sym-indent sym)
516                   (sml-find-matching-starter sml-starters-re)                   (sml-find-matching-starter sml-starters-re)
517                   (current-column))))                   (current-column))))
# Line 525  Line 527 
527      (if (looking-at "|")      (if (looking-at "|")
528          (if (sml-bolp) (current-column) (sml-indent-pipe))          (if (sml-bolp) (current-column) (sml-indent-pipe))
529        (cond        (cond
530         ((looking-at "datatype")         ((looking-at "datatype\\>")
531          (re-search-forward "=")          (re-search-forward "=")
532          (forward-char))          (forward-char))
533         ((looking-at "case\\>")         ((looking-at "case\\>")
# Line 588  Line 590 
590                       indent)))                       indent)))
591              ;; delgate indentation to the parent              ;; delgate indentation to the parent
592              (sml-forward-sym) (sml-backward-sexp nil)              (sml-forward-sym) (sml-backward-sexp nil)
593              (let* ((parent-sym (save-excursion (sml-move-read (sml-forward-sym))))              (let* ((parent-sym (save-excursion (sml-forward-sym)))
594                     (parent-indent (sml-re-assoc sml-indent-starters parent-sym)))                     (parent-indent (sml-re-assoc sml-indent-starters parent-sym)))
595                ;; check the special rules                ;; check the special rules
596                ;;(sml-move-if (backward-word 1)                ;;(sml-move-if (backward-word 1)
# Line 608  Line 610 
610          )))          )))
611    
612  (defun sml-indent-default (&optional noindent)  (defun sml-indent-default (&optional noindent)
613    (let* ((sym-after (save-excursion (sml-move-read (sml-forward-sym))))    (let* ((sym-after (save-excursion (sml-forward-sym)))
614           (prec-after (sml-op-prec sym-after 'back))           (prec-after (sml-op-prec sym-after 'back))
615           (_ (sml-backward-spaces))           (_ (sml-backward-spaces))
616           (sym-before (sml-move-read (sml-backward-sym)))           (sym-before (sml-backward-sym))
617           (prec (or (sml-op-prec sym-before 'back) prec-after 100))           (prec (or (sml-op-prec sym-before 'back) prec-after 100))
618           (sym-indent (and sym-before (sml-get-sym-indent sym-before))))           (sym-indent (and sym-before (sml-get-sym-indent sym-before))))
619      (or (and sym-indent (if noindent (current-column) sym-indent))      (or (and sym-indent (if noindent (current-column) sym-indent))
# Line 630  Line 632 
632                     (= prec 65) (string-equal "=" sym-before)                     (= prec 65) (string-equal "=" sym-before)
633                     (save-excursion                     (save-excursion
634                       (sml-backward-spaces)                       (sml-backward-spaces)
635                       (let* ((sym (sml-move-read (sml-backward-sym)))                       (let* ((sym (sml-backward-sym))
636                              (sym-indent (sml-re-assoc sml-indent-starters sym)))                              (sym-indent (sml-re-assoc sml-indent-starters sym)))
637                         (when sym-indent                         (when sym-indent
638                           (if noindent                           (if noindent

Legend:
Removed from v.332  
changed lines
  Added in v.333

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