I am very new to Emacs and I am discovering the functionality of "generic-mode" for the first time. I am trying to add a generic-mode to create basic syntax highlighting for an obscure programming language that I use. It's very simple:
;; BEGIN mtl-mode
(define-generic-mode
;; name of mode
'mtl-mode
;; comments
;; '("(*" . "\*)") Opening comment is (* closing is *) but not sure how to do it!
nil
;; keyword list
'("ACV" "CONTACT" "DISCHARGE" "FOR" "MODULE" "REPEAT" "TESTMACRO"
"TRANSF" "WITH" "BITS" "CONTINUE" "ELSE" "IF" "OPTO" "RES"
"TESTPINS" "TYPEOF" "ZENER" "BREAK" "DCI" "IND" "PATGEN"
"RETURN" "TESTMODULE" "UNTIL" "CAP" "DCV" "EXIT" "LED" "PIN"
"TRACK" "CASE" "DIODE" "FET" "LINK" "PULSE" "TESTBLOCK" "TRAN"
"WHILE" "PRINTF" "FFLUSH" "STDOUT"
)
;; font-lock list
'()
;; auto-mode list
'(".*mtl")
;; function list
nil
;; documentation
"Mode for editing Aeroflex ICT MTL files")
;; END mtl-mode
This works fine for a start, but the keywords are not actually case sensitive in MTL. Is there a way to specify that they should not be treated as such? Or do I have to add separate keyword cases to the list for each common possibility (e.g. "WHILE" "while")
'(("(*" . "*)"))
– npostavs Jun 27 '16 at 14:26(list (cons "(*" "*)"))
, your original attempt is equivalent to(cons "(*" "*)")
. See also Dotted Pair Notation – npostavs Jun 27 '16 at 15:00(list (cons "(*" "*)"))
– Q'' Jun 28 '16 at 8:20