From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tim Johnson Newsgroups: gmane.emacs.help Subject: Re: Derived Mode 101 HOWTO Date: Wed, 08 Mar 2006 02:58:45 -0000 Organization: Alaska Internet Solutions Message-ID: References: <87mzg2jgdy.fsf-monnier+gnu.emacs.help@gnu.org> Reply-To: tim@johnsons-web.com NNTP-Posting-Host: main.gmane.org X-Trace: sea.gmane.org 1141786832 7403 80.91.229.2 (8 Mar 2006 03:00:32 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 8 Mar 2006 03:00:32 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Mar 08 04:00:25 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FGouT-0000CL-56 for geh-help-gnu-emacs@m.gmane.org; Wed, 08 Mar 2006 04:00:22 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FGouS-0006uJ-Kd for geh-help-gnu-emacs@m.gmane.org; Tue, 07 Mar 2006 22:00:20 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!feed118.news.tele.dk!postnews.google.com!news3.google.com!sn-xt-sjc-04!sn-xt-sjc-06!sn-post-01!supernews.com!news.supernews.com!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: slrn/0.9.8.0 (Linux) Original-X-Complaints-To: abuse@supernews.com Original-Lines: 61 Original-Xref: shelby.stanford.edu gnu.emacs.help:138019 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:33642 Archived-At: I have written a file called newlisp-mode.el, based on Stefan's instructions, as best as I can follow. Results are as follows: When loading a .lsp file with GNU emacs, newlisp-mode is loaded without complaint. eval->major-mode gives me "newlisp-mode". However syntax highlighting for 'newlisp-font-lock-keywords fails. eval->font-lock-defaults shows that the dotted list composed from newlisp-keywords and font-lock-newlisp-keywords-face is present. The scheme font-lock-keywords-face and font-lock-function-name-face are successfully implemented. As for Xemacs, loading the file and the mode fails with the following error message: (may be wrapped and obfuscated by mailer) Wrong type argument: symbolp, ("\\<\\(a\\(?:cos\\|dd\\|nd\\|pp\\(?:end\\(?:\\)?\\| ly\\)\\|r\\(?:gs\\|ray\\)\\)\\)\\>" . font-lock-newlisp-keywords-face) NOTE: This refers to the same dotted list constructed as a component of newlisp-font-lock-keywords ;; Code follows: (require 'scheme) ;; ========================================================================== (defface font-lock-newlisp-keywords-face '((((class color) (background dark)) (:foreground "yellow")) (((class color) (background light)) (:foreground "green4")) (((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 keywords for Newlisp programming language." :group 'font-lock-faces) ;; ========================================================================== (defconst newlisp-keywords ;; just a few (regexp-opt '( "acos" "add" "and" "append" "append" "apply" "args" "array" ))) ;; ========================================================================== (defvar newlisp-font-lock-keywords `(,@scheme-font-lock-keywords (,(concat "\\<\\(" newlisp-keywords "\\)\\>") . font-lock-newlisp-keywords-face)) "List of newlisp keywords and faces") ;; ========================================================================== (define-derived-mode newlisp-mode scheme-mode "newlisp" "A major mode for Newlisp." (set (make-local-variable 'font-lock-defaults) (cons newlisp-font-lock-keywords ;; Copy the rest of font-lock-defaults from ;; scheme-mode if available. (or (cdr font-lock-defaults) '(nil t (("+-*/.<>=!?$%_&~^:" . "w"))))))) -- Tim Johnson http://www.alaska-internet-solutions.com