elisp - Simplest Emacs syntax highlighting tutorial? -
i create syntax highlighting minor mode emacs. have "writing gnu emacs extensions" o'reilly, not go depth of detail. there simple tutorial real or fake programming language highlighting mode?
thank you
defining custom generic mode best place start. can define basic syntax highlighting language following snippet.
(require 'generic-x) (define-generic-mode 'my-mode ;; name of mode '("//") ;; comments delimiter '("function" "var" "return") ;; keywords '(("=" . 'font-lock-operator) ("+" . 'font-lock-operator) ;; operators (";" . 'font-lock-builtin)) ;; built-in '("\\.myext$") ;; files trigger mode nil ;; other functions call "my custom highlighting mode" ;; doc string )
it's great defining basic syntax highlighting obscure languages. use log files in cases.
Comments
Post a Comment