comparison src/elisp/urweb-mode.el @ 357:368d9411ae67

Highlighting HTML tags
author Adam Chlipala <adamc@hcoop.net>
date Sun, 12 Oct 2008 12:53:45 -0400
parents 9390c55b9f1f
children 583ca86a55a0
comparison
equal deleted inserted replaced
356:383c72d11db8 357:368d9411ae67
160 160
161 ;; The font lock regular expressions. 161 ;; The font lock regular expressions.
162 162
163 (defconst urweb-font-lock-keywords 163 (defconst urweb-font-lock-keywords
164 `(;;(urweb-font-comments-and-strings) 164 `(;;(urweb-font-comments-and-strings)
165 (,(concat "\\<\\(fun\\|and\\)\\s-+\\(\\sw+\\)\\s-+[^ \t\n=]") 165 ("\\<\\(fun\\|and\\)\\s-+\\(\\sw+\\)\\s-+[^ \t\n=]"
166 (1 font-lock-keyword-face) 166 (1 font-lock-keyword-face)
167 (2 font-lock-function-name-face)) 167 (2 font-lock-function-name-face))
168 (,(concat "\\<\\(\\(data\\)?type\\|con\\|class\\)\\s-+\\(\\sw+\\)") 168 ("\\<\\(\\(data\\)?type\\|con\\|class\\)\\s-+\\(\\sw+\\)"
169 (1 font-lock-keyword-face) 169 (1 font-lock-keyword-face)
170 (3 font-lock-type-def-face)) 170 (3 font-lock-type-def-face))
171 ("\\<\\(val\\|table\\|sequence\\)\\s-+\\(\\sw+\\>\\s-*\\)?\\(\\sw+\\)\\s-*[=:]" 171 ("\\<\\(val\\|table\\|sequence\\)\\s-+\\(\\sw+\\>\\s-*\\)?\\(\\sw+\\)\\s-*[=:]"
172 (1 font-lock-keyword-face) 172 (1 font-lock-keyword-face)
173 (3 font-lock-variable-name-face)) 173 (3 font-lock-variable-name-face))
175 (1 font-lock-keyword-face) 175 (1 font-lock-keyword-face)
176 (2 font-lock-module-def-face)) 176 (2 font-lock-module-def-face))
177 ("\\<\\(signature\\)\\s-+\\(\\sw+\\)" 177 ("\\<\\(signature\\)\\s-+\\(\\sw+\\)"
178 (1 font-lock-keyword-face) 178 (1 font-lock-keyword-face)
179 (2 font-lock-interface-def-face)) 179 (2 font-lock-interface-def-face))
180
181 ("<\\(\\sw+\\)[^>]*>"
182 (1 font-lock-tag-face))
183 ("</\\(\\sw+\\)[^>]*>"
184 (1 font-lock-tag-face))
180 185
181 (,urweb-keywords-regexp . font-lock-keyword-face) 186 (,urweb-keywords-regexp . font-lock-keyword-face)
182 (,urweb-sql-keywords-regexp . font-lock-sql-face) 187 (,urweb-sql-keywords-regexp . font-lock-sql-face)
183 ; (,urweb-lident-regexp . font-lock-variable-face) 188 ; (,urweb-lident-regexp . font-lock-variable-face)
184 (,urweb-cident-regexp . font-lock-cvariable-face)) 189 (,urweb-cident-regexp . font-lock-cvariable-face))
210 "Font Lock mode face used to highlight SQL keywords." 215 "Font Lock mode face used to highlight SQL keywords."
211 :group 'font-lock-highlighting-faces) 216 :group 'font-lock-highlighting-faces)
212 (defvar font-lock-sql-face 'font-lock-sql-face 217 (defvar font-lock-sql-face 'font-lock-sql-face
213 "Face name to use for SQL keywords.") 218 "Face name to use for SQL keywords.")
214 219
215 ;(defface font-lock-variable-face
216 ; '((t (:foreground "green")))
217 ; "Font Lock mode face used to highlight lowercase identifiers."
218 ; :group 'font-lock-highlighting-faces)
219 ;(defvar font-lock-variable-face 'font-lock-variable-face
220 ; "Face name to use for lowercase identifiers.")
221
222 (defface font-lock-cvariable-face 220 (defface font-lock-cvariable-face
223 '((t (:foreground "dark blue"))) 221 '((t (:foreground "dark blue")))
224 "Font Lock mode face used to highlight capitalized identifiers." 222 "Font Lock mode face used to highlight capitalized identifiers."
225 :group 'font-lock-highlighting-faces) 223 :group 'font-lock-highlighting-faces)
226 (defvar font-lock-cvariable-face 'font-lock-cvariable-face 224 (defvar font-lock-cvariable-face 'font-lock-cvariable-face
227 "Face name to use for capitalized identifiers.") 225 "Face name to use for capitalized identifiers.")
226
227 (defface font-lock-tag-face
228 '((t (:bold t)))
229 "Font Lock mode face used to highlight XML tags."
230 :group 'font-lock-highlighting-faces)
231 (defvar font-lock-tag-face 'font-lock-tag-face
232 "Face name to use for XML tags.")
228 233
229 ;; 234 ;;
230 ;; Code to handle nested comments and unusual string escape sequences 235 ;; Code to handle nested comments and unusual string escape sequences
231 ;; 236 ;;
232 237