aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1997-04-27 17:50:39 +0000
committerRichard M. Stallman1997-04-27 17:50:39 +0000
commit26d05e22407346371e569adcdcc00ff9796ede1f (patch)
treeb7d5a5b0de700b6e9afb1b4a74e00e78d2293bb6
parent058c1767a02167d69fb6b010ffc39cc5eb46d3f7 (diff)
downloademacs-26d05e22407346371e569adcdcc00ff9796ede1f.tar.gz
emacs-26d05e22407346371e569adcdcc00ff9796ede1f.zip
(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.
-rw-r--r--lisp/progmodes/scheme.el50
1 files changed, 33 insertions, 17 deletions
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.")
216 "<!DOCTYPE style-sheet PUBLIC \"-//James Clark//DTD DSSSL Style Sheet//EN\"> 216 "<!DOCTYPE style-sheet PUBLIC \"-//James Clark//DTD DSSSL Style Sheet//EN\">
217" 217"
218 "*An SGML declaration (typically using James Clark's style-sheet 218 "*An SGML declaration (typically using James Clark's style-sheet
219doctype, as required for Jade) which will be inserted into an empty 219doctype, as required for Jade). This will be inserted into an empty
220buffer in dsssl-mode.") 220buffer in dsssl-mode if it is defined as a string.")
221 221
222(defvar dsssl-imenu-generic-expression 222(defvar dsssl-imenu-generic-expression
223 ;; Perhaps this should also look for the style-sheet DTD tags. I'm 223 ;; Perhaps this should also look for the style-sheet DTD tags. I'm
@@ -230,6 +230,7 @@ buffer in dsssl-mode.")
230 "^\\s-*(mode\\s-+\\(\\(\\sw\\|\\s-\\|\\s_\\)+\\)" 1) 230 "^\\s-*(mode\\s-+\\(\\(\\sw\\|\\s-\\|\\s_\\)+\\)" 1)
231 (" Elements" 231 (" Elements"
232 ;; (element foo ...) or (element (foo bar ...) ...) 232 ;; (element foo ...) or (element (foo bar ...) ...)
233 ;; Fixme: Perhaps it should do `root'.
233 "^\\s-*(element\\s-+(?\\(\\(\\sw\\|\\s-\\|\\s_\\)+\\))?" 1) 234 "^\\s-*(element\\s-+(?\\(\\(\\sw\\|\\s-\\|\\s_\\)+\\))?" 1)
234 (" Declarations" 235 (" Declarations"
235 "^(declare\\(-\\sw+\\)+\\>\\s-+\\(\\(\\sw\\|\\s_\\)+\\)" 2)) 236 "^(declare\\(-\\sw+\\)+\\>\\s-+\\(\\(\\sw\\|\\s_\\)+\\)" 2))
@@ -245,7 +246,8 @@ Delete converts tabs to spaces as it moves back.
245Blank lines separate paragraphs. Semicolons start comments. 246Blank lines separate paragraphs. Semicolons start comments.
246\\{scheme-mode-map} 247\\{scheme-mode-map}
247Entry to this mode calls the value of dsssl-mode-hook 248Entry to this mode calls the value of dsssl-mode-hook
248if that value is non-nil." 249if that value is non-nil and inserts the value of
250`dsssl-sgml-declaration' if that variable's value is a string."
249 (interactive) 251 (interactive)
250 (kill-all-local-variables) 252 (kill-all-local-variables)
251 (use-local-map scheme-mode-map) 253 (use-local-map scheme-mode-map)
@@ -262,7 +264,7 @@ if that value is non-nil."
262 mode-name "DSSSL") 264 mode-name "DSSSL")
263 ;; Insert a suitable SGML declaration into an empty buffer. 265 ;; Insert a suitable SGML declaration into an empty buffer.
264 (and (zerop (buffer-size)) 266 (and (zerop (buffer-size))
265 dsssl-sgml-declaration 267 (stringp dsssl-sgml-declaration)
266 (not buffer-read-only) 268 (not buffer-read-only)
267 (insert dsssl-sgml-declaration)) 269 (insert dsssl-sgml-declaration))
268 (run-hooks 'scheme-mode-hook) 270 (run-hooks 'scheme-mode-hook)
@@ -276,21 +278,35 @@ if that value is non-nil."
276(put 'mode 'scheme-indent-function 1) 278(put 'mode 'scheme-indent-function 1)
277(put 'with-mode 'scheme-indent-function 1) 279(put 'with-mode 'scheme-indent-function 1)
278(put 'make 'scheme-indent-function 1) 280(put 'make 'scheme-indent-function 1)
281(put 'style 'scheme-indent-function 1)
282(put 'root 'scheme-indent-function 1)
279 283
280(defvar dsssl-font-lock-keywords 284(defvar dsssl-font-lock-keywords
281 '(("(\\(define\\(-\\w+\\)?\\)\\>[ ]*\\\((?\\)\\(\\sw+\\)\\>" 285 (eval-when-compile
282 (1 font-lock-keyword-face) 286 (list
283 (4 font-lock-function-name-face)) 287 ;; Similar to Scheme
284 ("(\\(case\\|cond\\|else\\|if\\|lambda\\|let\\*?\\|letrec\\|and\\|or\\|map\\|with-mode\\)\\>" . 1) 288 (list "(\\(define\\(-\\w+\\)?\\)\\>[ ]*\\\((?\\)\\(\\sw+\\)\\>"
285 ("(\\(element\\|mode\\|declare-\\w+\\)\\>[ ]*\\(\\sw+\\)" 289 '(1 font-lock-keyword-face)
286 (1 font-lock-keyword-face) 290 '(4 font-lock-function-name-face))
287 (2 font-lock-type-face)) 291 (cons
288 ("(\\(element\\)\\>[ ]*(\\(\\S)+\\))" 292 (concat "(\\("
289 (1 font-lock-keyword-face) 293 ;; (make-regexp '("case" "cond" "else" "if" "lambda"
290 (2 font-lock-type-face)) 294 ;; "let" "let*" "letrec" "and" "or" "map" "with-mode"))
291 ("\\<\\sw+:\\>" . font-lock-reference-face) 295 "and\\|c\\(ase\\|ond\\)\\|else\\|if\\|"
292 ("<\\([!?][-a-z0-9]+\\)" 1 font-lock-keyword-face) 296 "l\\(ambda\\|et\\(\\|*\\|rec\\)\\)\\|map\\|or\\|with-mode"
293 ("<\\(/?[-a-z0-9]+\\)" 1 font-lock-function-name-face)) 297 "\\)\\>")
298 1)
299 ;; DSSSL syntax
300 '("(\\(element\\|mode\\|declare-\\w+\\)\\>[ ]*\\(\\sw+\\)"
301 (1 font-lock-keyword-face)
302 (2 font-lock-type-face))
303 '("(\\(element\\)\\>[ ]*(\\(\\S)+\\))"
304 (1 font-lock-keyword-face)
305 (2 font-lock-type-face))
306 '("\\<\\sw+:\\>" . font-lock-reference-face) ; trailing `:' c.f. scheme
307 ;; SGML markup (from sgml-mode) :
308 '("<\\([!?][-a-z0-9]+\\)" 1 font-lock-keyword-face)
309 '("<\\(/?[-a-z0-9]+\\)" 1 font-lock-function-name-face)))
294 "Default expressions to highlight in DSSSL mode.") 310 "Default expressions to highlight in DSSSL mode.")
295 311
296 312