help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Newbie Help with creating a major-mode for syntax hilighting


From: address@hidden
Subject: Newbie Help with creating a major-mode for syntax hilighting
Date: Wed, 29 Apr 2009 11:55:05 -0700 (PDT)

I am following the Xah Lee's example bellow to create my own major mode for 
syntax coloring.

http://xahlee.org/emacs/elisp_syntax_coloring.html

My goal is to highlight all lines that begin with "E | ...."

so following the example I add the following to my .emacs file


'(("Sin\\|Cos\\|Sum" . font-lock-function-name-face)
   ("Pi\\|Infinity" . font-lock-constant-face)
  )

;; I tested the following regular expression using search-forward-regex
(setq nlDataKeywords 
 '(("^E +| +*$" )) . font-lock-warning-face)
   )
)

(define-derived-mode nl-data-mode fundamental-mode 
  (setq font-lock-defautls '(nlDataKeywords)
 )
)

The .emacs file loads without errors, but when I set the mode to nl-data-mode I 
get the following error in the mini-buffer:

Only strings should be stored in the buffer-local variable mode-name.

I tried moving the changes to my ~/.emacs.el fiel and loading that with the 
same result. I tried using regexp-quote function, all with the same errors


(setq nlDataKeywords 
 '(
   ( ,(regexp-quote '("^E +| +*$" )) . font-lock-warning-face)
   )
)

(define-derived-mode nl-data-mode fundamental-mode 
  (setq font-lock-defautls '(nlDataKeywords)
 )
)

Can someone knowledgeable on the mail list help me out?

Thanks and best regards,

Carlos



      




reply via email to

[Prev in Thread] Current Thread [Next in Thread]