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

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

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

revision 1691, Mon Nov 15 03:26:57 2004 UTC revision 1692, Mon Nov 15 03:49:46 2004 UTC
# Line 226  Line 226 
226  (defun sml-get-depth-st ()  (defun sml-get-depth-st ()
227    (save-excursion    (save-excursion
228      (let* ((disp (if (eq (char-before) ?\)) (progn (backward-char) -1) nil))      (let* ((disp (if (eq (char-before) ?\)) (progn (backward-char) -1) nil))
229             (foo (backward-char))             (_ (backward-char))
230             (disp (if (eq (char-before) ?\() (progn (backward-char) 0) disp))             (disp (if (eq (char-before) ?\() (progn (backward-char) 0) disp))
231             (pt (point)))             (pt (point)))
232        (when disp        (when disp
# Line 447  Line 447 
447       ;; proper indentation of the next line.       ;; proper indentation of the next line.
448       (when (looking-at "(\\*") (sml-forward-spaces))       (when (looking-at "(\\*") (sml-forward-spaces))
449       (let (data       (let (data
            (sml-point (point))  
450             (sym (save-excursion (sml-forward-sym))))             (sym (save-excursion (sml-forward-sym))))
451         (or         (or
452          ;; Allow the user to override the indentation.          ;; Allow the user to override the indentation.
# Line 561  Line 560 
560           (current-column))))           (current-column))))
561    
562  (defun sml-get-indent (data sym)  (defun sml-get-indent (data sym)
563    (let ((head-sym (pop data)) d)    (let (d)
564      (cond      (cond
565       ((not (listp data)) data)       ((not (listp data)) data)
566       ((setq d (member sym data)) (second d))       ((setq d (member sym data)) (cadr d))
567       ((and (consp data) (not (stringp (car data)))) (car data))       ((and (consp data) (not (stringp (car data)))) (car data))
568       (t sml-indent-level))))       (t sml-indent-level))))
569    
# Line 605  Line 604 
604          (when idata          (when idata
605            ;;(if (or style (not delegate))            ;;(if (or style (not delegate))
606            ;; normal indentation            ;; normal indentation
607            (let ((indent (sml-get-indent idata sym)))            (let ((indent (sml-get-indent (cdr idata) sym)))
608              (when indent (+ (sml-delegated-indent) indent)))              (when indent (+ (sml-delegated-indent) indent)))
609            ;; delgate indentation to the parent            ;; delgate indentation to the parent
610            ;;(sml-forward-sym) (sml-backward-sexp nil)            ;;(sml-forward-sym) (sml-backward-sexp nil)
# Line 613  Line 612 
612            ;;     (parent-indent (cdr (assoc parent-sym sml-indent-starters))))            ;;     (parent-indent (cdr (assoc parent-sym sml-indent-starters))))
613            ;; check the special rules            ;; check the special rules
614            ;;(+ (sml-delegated-indent)            ;;(+ (sml-delegated-indent)
615            ;; (or (sml-get-indent indent-data 1 'strict)            ;; (or (sml-get-indent (cdr indent-data) 1 'strict)
616            ;; (sml-get-indent parent-indent 1 'strict)            ;; (sml-get-indent (cdr parent-indent) 1 'strict)
617            ;; (sml-get-indent indent-data 0)            ;; (sml-get-indent (cdr indent-data) 0)
618            ;; (sml-get-indent parent-indent 0))))))))            ;; (sml-get-indent (cdr parent-indent) 0))))))))
619            )))))            )))))
620    
621  (defun sml-indent-default (&optional noindent)  (defun sml-indent-default (&optional noindent)
# Line 809  Line 808 
808  ;;  ;;
809    
810  (defun sml-forms-menu (menu)  (defun sml-forms-menu (menu)
811    (mapcar (lambda (x)    (mapcar (lambda (x) (vector (car x) (cdr x) t))
             (let ((name (car x))  
                   (fsym (cdr x)))  
               (vector name fsym t)))  
812            sml-forms-alist))            sml-forms-alist))
813    
814  (defvar sml-last-form "let")  (defvar sml-last-form "let")

Legend:
Removed from v.1691  
changed lines
  Added in v.1692

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