;;; A simple Lx mode ;;; ;;; In fact, the inclusion of "template" and "stylesheet" indicates ;;; that this is most often used for Lx as XSLT. That could be ;;; handled in a further derived mode, of course. (define-derived-mode lx-mode scheme-mode "Lx" "Major mode for Lx" (put 'lx:let 'scheme-indent-function 1) (put 'lx:namespace 'scheme-indent-function 1) (put 'lx:dtd 'scheme-indent-function 1) (put 'lx:features 'scheme-indent-function 1) (put 'template 'scheme-indent-function 1) ;;(put 'when 'scheme-indent-function 1) ; is this one useful? (put 'stylesheet 'scheme-indent-function 2) (defvar lx-font-lock-keywords '(("(\\(lx:[a-z]*\\)" 1 font-lock-function-name-face) ("(\\(template\\)\\>[ ]*\\(\\\"?\\sw+\\\"?\\)" (1 font-lock-keyword-face) (2 font-lock-type-face)) ("\\<\\sw+:\\>" . font-lock-constant-face) ; trailing : ) "Default expressions to highlight in Lx mode.") (setq font-lock-defaults '(lx-font-lock-keywords nil t (("+-*/.<>=?$%_&~^:" . "w")) beginning-of-defun (font-lock-mark-block-function . mark-defun)))) ;; Following is not necessary, I think ;; (defcustom lx-mode-hook nil ;; "Normal hook run when entering `lx-mode'." ;; :type 'hook ;; :group 'lisp)