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

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

Evaluating a 'variable' in a nested list


From: Tim Johnson
Subject: Evaluating a 'variable' in a nested list
Date: Tue, 20 Apr 2010 20:44:55 -0500
User-agent: slrn/0.9.9p1 (Linux)

I'm using emacs 23.1.1 on slackware 13.0 32-bit.
I've created an elisp file to set highlighting patterns for extra
keywords for the scheme programming language.
The file appears thusly:
;; ================================================================
(defface scheme-font-lock-user-keywords-face
  '((((class color) (background light)) (:foreground "red4"))
    (((class color) (background dark)) (:foreground "yellow3"))
    (((class grayscale) (background light)) (:foreground "dimgray" :italic t))
    (((class grayscale) (background dark)) (:foreground "lightgray" :italic t))
    (t (:bold t)))
  "Font lock mode face used to highlight user-defined keywords for scheme mode."
  :group 'font-lock-faces)
(defvar scheme-font-lock-user-keywords-face 
  'scheme-font-lock-user-keywords-face)
;; Test a single regex for the eq? keyword
(defconst scheme-user-keywords-regexp
                  (regexp-opt 
                        '("eq?")))
(provide 'tj-scheme)
;; =================================================================
Using 
  http://www.gnu.org/software/emacs/manual/html_node/emacs/Font-Lock.html
as an example, I have added the following to my .emacs
;; ===============================================================
(require 'tj-scheme)
(add-hook 'scheme-mode-hook
                  (lambda ()
                        (font-lock-add-keywords 
                          nil 
                          '((scheme-user-keywords-regexp 1 
scheme-font-lock-user-keywords-face t)))))
;; ==================================================================
When I load a scheme file, syntax highlight fails and I get the 
following error message:
"""
Error during redisplay: (void-function scheme-user-keywords-regexp)
"""
I believe that I have coded the following form:
'((scheme-user-keywords-regexp 1 scheme-font-lock-user-keywords-face t))
Incorrectly, so that 'scheme-user-keywords-regexp is being treated 
as a function when the hook is run.

I can verify that scheme-user-keywords-regexp is being displayed correctly when
I invoke C-h v
Can someone advise me of the appropriate syntax for the form?
thanks
-- 
Tim 
tim@ johnsons-web.com||akwebsoft.com
http://www.akwebsoft.com


reply via email to

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