;; roq-mode.el --add generic syntax highlighting for a .roq file ;; Copyright (C) 2005 roqet ;; Author: roqetman ;; Keywords: roq, generic, font-lock ;; ;; This script is distributable under the terms of the GNU General Public ;; License. The GPL is available at: www.gnu.org. ;; ;; Don't forget to check for the latest version and other scripts ;; and software at: http://www.roqet.org/software.html ;; ~~~ ;; 'l' ;; - ;; Mode d'emploi: ;; m-x roq-mode ;; --or put this in your .emacs file: (load "roq-mode") (require 'generic) (require 'font-lock) (defface roq-email-name-face '((t (:inherit font-lock-constant-face))) "Face for highlighting first part of email address.") (defface roq-email-face '((t (:inherit font-lock-variable-name-face))) "Face for highlighting second part of email address.") (define-generic-mode 'roq-mode ;;comments (list ?* ?; (cons "/*" "*/") (cons "-=" "=-") ) ;;keywords (list "author" "specification" "zork" ) ;; other fontifications '( ;; colorize stuff in square brackets ("\\[.+\\]" 0 font-lock-function-name-face nil) ;; colorize name and email; some people put email in parens, not angles. ("\\([^<(]+?\\)[ \t]*[(<]\\([A-Za-z0-9_.-]+@[A-Za-z0-9_.-]+\\)[>)]" nil nil (1 'roq-email-name-face) (2 'roq-email-face)) ;; colorize numbers followed by a character ("^\\([0-9]+.\\)" 1 font-lock-variable-name-face nil) ) ;; set file file extension (list "\\.ROQ\\'") nil ;; description "Mode for highlighting a .roq file")