Project

General

Profile

Syntax highlighting for emacs » History » Version 1

Version 1/18 - Next ยป - Current version
Christopher Backhouse, 04/28/2011 12:32 PM
First version of syntax


Syntax highlighting for emacs

(setq fclKeywords
'(
;; Unfortunately, the comment syntax takes precedence, so this doesn't work
("#include" . font-lock-keyword-face)
("@local" . font-lock-keyword-face)
;; All these names are magic, I think
("process_name:\\|services:\\|source:\\|outputs:\\|physics\\|producers:\\|filters:\\|analyzers:" . font-lock-builtin-face)
("true\\|false" . font-lock-builtin-face)
;; Variable definitions are followed by colons
("[a-zA-Z0-9_]*:" . font-lock-variable-name-face)
)
)

;; Python mode gets us comment handling and indentation at colons
(define-derived-mode fcl-mode python-mode
(setq mode-name "FHICL")
(setq font-lock-defaults '(fclKeywords))
;; (setq tab-width 2) ;; Doesn't seem to work
)

(add-to-list 'auto-mode-alist '("\\.fcl\\'" . fcl-mode))