From: Richard M. Stallman Date: Sun, 27 Apr 1997 17:50:39 +0000 (+0000) Subject: (dsssl-sgml-declaration): Doc fix. X-Git-Tag: emacs-20.1~2367 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=26d05e22407346371e569adcdcc00ff9796ede1f;p=emacs.git (dsssl-sgml-declaration): Doc fix. (dsssl-mode): Use stringp to check dsssl-sgml-declaration. (style, root): Put scheme-indent-function 1. (dsssl-font-lock-keywords): Use make-regexp version. --- diff --git a/lisp/progmodes/scheme.el b/lisp/progmodes/scheme.el index c0351e31e1b..7c9ae6fa868 100644 --- a/lisp/progmodes/scheme.el +++ b/lisp/progmodes/scheme.el @@ -216,8 +216,8 @@ Set this to nil if you normally use another dialect.") " " "*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 @@ -230,6 +230,7 @@ buffer in dsssl-mode.") "^\\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)) @@ -245,7 +246,8 @@ Delete converts tabs to spaces as it moves back. 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) @@ -262,7 +264,7 @@ if that value is non-nil." 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) @@ -276,21 +278,35 @@ if that value is non-nil." (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.")