all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Evaluating a 'variable' in a nested list
@ 2010-04-21  1:44 Tim Johnson
  2010-04-21 19:16 ` Dmitry Dzhus
  0 siblings, 1 reply; 3+ messages in thread
From: Tim Johnson @ 2010-04-21  1:44 UTC (permalink / raw)
  To: help-gnu-emacs

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-04-21 21:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-21  1:44 Evaluating a 'variable' in a nested list Tim Johnson
2010-04-21 19:16 ` Dmitry Dzhus
2010-04-21 21:44   ` Tim Johnson

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.