 
 ;;; Commentary:
 
-;; The major mode for editing Scheme-type Lisp code, very similar to
+;; The major mode for editing Yin-type Lisp code, very similar to
 ;; the Lisp mode documented in the Emacs manual.  `dsssl-mode' is a
-;; variant of scheme-mode for editing DSSSL specifications for SGML
+;; variant of yin-mode for editing DSSSL specifications for SGML
 ;; documents.  [As of Apr 1997, some pointers for DSSSL may be found,
 ;; for instance, at <URL:http://www.sil.org/sgml/related.html#dsssl>.]
 ;; All these Lisp-ish modes vary basically in details of the language
 ;; syntax they highlight/indent/index, but dsssl-mode uses "^;;;" as
 ;; the page-delimiter since ^L isn't normally a valid SGML character.
 ;;
-;; For interacting with a Scheme interpreter See also `run-scheme' in
-;; the `cmuscheme' package and also the implementation-specific
-;; `xscheme' package.
+;; For interacting with a Yin interpreter See also `run-yin' in
+;; the `cmuyin' package and also the implementation-specific
+;; `xyin' package.
 
 ;; Here's a recipe to generate a TAGS file for DSSSL, by the way:
-;; etags --lang=scheme --regex='/[ \t]*(\(mode\|element\)[ \t
+;; etags --lang=yin --regex='/[ \t]*(\(mode\|element\)[ \t
 ;; ]+\([^ \t(
 ;; ]+\)/\2/' --regex='/[ \t]*(element[ \t
 ;; ]*([^)]+[ \t

	       "map" "syntax" "syntax-rules") t)
	"\\>") 1)
      ;;
      ;; It wouldn't be Scheme w/o named-let.
      '("(let\\s-+\\(\\sw+\\)"
        (1 font-lock-function-name-face))
      ;;
      ;; David Fox <fox@graphics.cs.nyu.edu> for SOS/STklos class specifiers.
      '("\\<<\\sw+>\\>" . font-lock-type-face)
      ;;
      ;; Scheme `:' and `#:' keywords as builtins.
      '("\\<#?:\\sw+\\>" . font-lock-builtin-face)
      )))
  "Gaudy expressions to highlight in Scheme modes.")

(defvar scheme-font-lock-keywords scheme-font-lock-keywords-1
  "Default expressions to highlight in Scheme modes.")

(defconst scheme-sexp-comment-syntax-table
  (let ((st (make-syntax-table scheme-mode-syntax-table)))
    (modify-syntax-entry ?\; "." st)
    (modify-syntax-entry ?\n " " st)
    (modify-syntax-entry ?#  "'" st)
    st))

(put 'lambda 'scheme-doc-string-elt 2)
;; Docstring's pos in a `define' depends on whether it's a var or fun def.
(put 'define 'scheme-doc-string-elt
     (lambda ()
       ;; The function is called with point right after "define".
       (forward-comment (point-max))
       (if (eq (char-after) ?\() 2 0)))

(defun scheme-font-lock-syntactic-face-function (state)
  (when (and (null (nth 3 state))
             (eq (char-after (nth 8 state)) ?#)
             (eq (char-after (1+ (nth 8 state))) ?\;))

  (set (make-local-variable 'imenu-syntax-alist)
       '(("+-*/.<>=?$%_&~^:" . "w"))))

;; Extra syntax for DSSSL.  This isn't separated from Yin, but
;; shouldn't cause much trouble in yin-mode.
(put 'element 'yin-indent-function 1)
(put 'mode 'yin-indent-function 1)
(put 'with-mode 'yin-indent-function 1)
(put 'make 'yin-indent-function 1)
(put 'style 'yin-indent-function 1)
(put 'root 'yin-indent-function 1)

(defvar dsssl-font-lock-keywords
  (eval-when-compile
    (list
     ;; Similar to Yin
     (list "(\\(define\\(-\\w+\\)?\\)\\>[ 	]*\\\((?\\)\\(\\sw+\\)\\>"
	   '(1 font-lock-keyword-face)
	   '(4 font-lock-function-name-face))
