;;;; Customization for nXML mode (setq rng-schema-locating-files (append '("~/emacs/nxml-schema/schemas.xml") rng-schema-locating-files-default)) (defface nxml-template '((t (:bold t :foreground "blue" :background "#ddddff"))) "Face used to highlight embedded template constructs" :group 'nxml-highlighting-faces) (defun qtmstr-nxml-hook () (when (string-match "\\.html$" buffer-file-name) (let ((py-prefix-re (regexp-opt '( "py:if" "py:choose" "py:when" "py:otherwise" "py:for" "py:def" "py:match" "py:with" "py:attrs" "py:content" "py:replace" "py:strip")))) (font-lock-add-keywords nil `(("\\$\\([a-zA-Z_][a-zA-Z0-9_]*\\)" 1 'nxml-template prepend) ("\\${\\([^}\"]+\\)}" 1 'nxml-template prepend) (,(concat py-prefix-re "=\"\\([^\"]*\\)\"") 1 'nxml-template prepend)))))) (add-hook 'nxml-mode-hook #'qtmstr-nxml-hook)