changeset 351:d5148178a7be

Customized font faces
author Adam Chlipala <adamc@hcoop.net>
date Sun, 12 Oct 2008 10:22:50 -0400
parents 3a1e36b14105
children 2205d5cb416a
files src/elisp/urweb-defs.el src/elisp/urweb-mode.el
diffstat 2 files changed, 26 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/elisp/urweb-defs.el	Sun Oct 12 10:04:17 2008 -0400
+++ b/src/elisp/urweb-defs.el	Sun Oct 12 10:22:50 2008 -0400
@@ -64,9 +64,9 @@
 
 
 (easy-menu-define urweb-mode-menu urweb-mode-map "Menu used in `urweb-mode'."
-  '("URWEB"
-    ["URWEB mode help (brief)"       describe-mode t]
-    ["URWEB mode *info*"             urweb-mode-info t]
+  '("Ur/Web"
+    ["Ur/Web mode help (brief)"       describe-mode t]
+    ["Ur/Web mode *info*"             urweb-mode-info t]
     ))
 
 ;; Make's sure they appear in the menu bar when urweb-mode-map is active.
--- a/src/elisp/urweb-mode.el	Sun Oct 12 10:04:17 2008 -0400
+++ b/src/elisp/urweb-mode.el	Sun Oct 12 10:22:50 2008 -0400
@@ -150,6 +150,12 @@
                  "ASC" "DESC" "INSERT" "INTO" "VALUES" "UPDATE" "SET" "DELETE")
   "A regexp that matches SQL keywords.")
 
+(defconst urweb-lident-regexp "\\<[a-z_][A-Za-z0-9_']*\\>"
+  "A regexp that matches lowercase Ur/Web identifiers.")
+
+(defconst urweb-cident-regexp "\\<[A-Z][A-Za-z0-9_']*\\>"
+  "A regexp that matches uppercase Ur/Web identifiers.")
+
 ;;; Font-lock settings ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
 ;; The font lock regular expressions.
@@ -173,7 +179,9 @@
      (2 font-lock-interface-def-face))
     
     (,urweb-keywords-regexp . font-lock-keyword-face)
-    (,urweb-sql-keywords-regexp . font-lock-sql-face))
+    (,urweb-sql-keywords-regexp . font-lock-sql-face)
+;   (,urweb-lident-regexp . font-lock-variable-face)
+    (,urweb-cident-regexp . font-lock-cvariable-face))
   "Regexps matching standard Ur/Web keywords.")
 
 (defface font-lock-type-def-face
@@ -204,6 +212,20 @@
 (defvar font-lock-sql-face 'font-lock-sql-face
   "Face name to use for SQL keywords.")
 
+;(defface font-lock-variable-face
+;  '((t (:foreground "green")))
+;  "Font Lock mode face used to highlight lowercase identifiers."
+;  :group 'font-lock-highlighting-faces)
+;(defvar font-lock-variable-face 'font-lock-variable-face
+;  "Face name to use for lowercase identifiers.")
+
+(defface font-lock-cvariable-face
+  '((t (:foreground "dark blue")))
+  "Font Lock mode face used to highlight capitalized identifiers."
+  :group 'font-lock-highlighting-faces)
+(defvar font-lock-cvariable-face 'font-lock-cvariable-face
+  "Face name to use for capitalized identifiers.")
+
 ;;
 ;; Code to handle nested comments and unusual string escape sequences
 ;;