"<!DOCTYPE style-sheet PUBLIC \"-//James Clark//DTD DSSSL Style Sheet//EN\">
"
"*An SGML declaration (typically using James Clark's style-sheet
-doctype, as required for Jade) which will be inserted into an empty
-buffer in dsssl-mode.")
+doctype, as required for Jade). This will be inserted into an empty
+buffer in dsssl-mode if it is defined as a string.")
(defvar dsssl-imenu-generic-expression
;; Perhaps this should also look for the style-sheet DTD tags. I'm
"^\\s-*(mode\\s-+\\(\\(\\sw\\|\\s-\\|\\s_\\)+\\)" 1)
(" Elements"
;; (element foo ...) or (element (foo bar ...) ...)
+ ;; Fixme: Perhaps it should do `root'.
"^\\s-*(element\\s-+(?\\(\\(\\sw\\|\\s-\\|\\s_\\)+\\))?" 1)
(" Declarations"
"^(declare\\(-\\sw+\\)+\\>\\s-+\\(\\(\\sw\\|\\s_\\)+\\)" 2))
Blank lines separate paragraphs. Semicolons start comments.
\\{scheme-mode-map}
Entry to this mode calls the value of dsssl-mode-hook
-if that value is non-nil."
+if that value is non-nil and inserts the value of
+`dsssl-sgml-declaration' if that variable's value is a string."
(interactive)
(kill-all-local-variables)
(use-local-map scheme-mode-map)
mode-name "DSSSL")
;; Insert a suitable SGML declaration into an empty buffer.
(and (zerop (buffer-size))
- dsssl-sgml-declaration
+ (stringp dsssl-sgml-declaration)
(not buffer-read-only)
(insert dsssl-sgml-declaration))
(run-hooks 'scheme-mode-hook)
(put 'mode 'scheme-indent-function 1)
(put 'with-mode 'scheme-indent-function 1)
(put 'make 'scheme-indent-function 1)
+(put 'style 'scheme-indent-function 1)
+(put 'root 'scheme-indent-function 1)
(defvar dsssl-font-lock-keywords
- '(("(\\(define\\(-\\w+\\)?\\)\\>[ ]*\\\((?\\)\\(\\sw+\\)\\>"
- (1 font-lock-keyword-face)
- (4 font-lock-function-name-face))
- ("(\\(case\\|cond\\|else\\|if\\|lambda\\|let\\*?\\|letrec\\|and\\|or\\|map\\|with-mode\\)\\>" . 1)
- ("(\\(element\\|mode\\|declare-\\w+\\)\\>[ ]*\\(\\sw+\\)"
- (1 font-lock-keyword-face)
- (2 font-lock-type-face))
- ("(\\(element\\)\\>[ ]*(\\(\\S)+\\))"
- (1 font-lock-keyword-face)
- (2 font-lock-type-face))
- ("\\<\\sw+:\\>" . font-lock-reference-face)
- ("<\\([!?][-a-z0-9]+\\)" 1 font-lock-keyword-face)
- ("<\\(/?[-a-z0-9]+\\)" 1 font-lock-function-name-face))
+ (eval-when-compile
+ (list
+ ;; Similar to Scheme
+ (list "(\\(define\\(-\\w+\\)?\\)\\>[ ]*\\\((?\\)\\(\\sw+\\)\\>"
+ '(1 font-lock-keyword-face)
+ '(4 font-lock-function-name-face))
+ (cons
+ (concat "(\\("
+ ;; (make-regexp '("case" "cond" "else" "if" "lambda"
+ ;; "let" "let*" "letrec" "and" "or" "map" "with-mode"))
+ "and\\|c\\(ase\\|ond\\)\\|else\\|if\\|"
+ "l\\(ambda\\|et\\(\\|*\\|rec\\)\\)\\|map\\|or\\|with-mode"
+ "\\)\\>")
+ 1)
+ ;; DSSSL syntax
+ '("(\\(element\\|mode\\|declare-\\w+\\)\\>[ ]*\\(\\sw+\\)"
+ (1 font-lock-keyword-face)
+ (2 font-lock-type-face))
+ '("(\\(element\\)\\>[ ]*(\\(\\S)+\\))"
+ (1 font-lock-keyword-face)
+ (2 font-lock-type-face))
+ '("\\<\\sw+:\\>" . font-lock-reference-face) ; trailing `:' c.f. scheme
+ ;; SGML markup (from sgml-mode) :
+ '("<\\([!?][-a-z0-9]+\\)" 1 font-lock-keyword-face)
+ '("<\\(/?[-a-z0-9]+\\)" 1 font-lock-function-name-face)))
"Default expressions to highlight in DSSSL mode.")
\f