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: Mon, 13 Mar 2006 01:48:37 -0000 Organization: Alaska Internet Solutions Message-ID: References: <87mzg2jgdy.fsf-monnier+gnu.emacs.help@gnu.org> <87oe0hijb7.fsf-monnier+gnu.emacs.help@gnu.org> <87wtf0dhv8.fsf-monnier+gnu.emacs.help@gnu.org> <87zmjvbwp6.fsf-monnier+gnu.emacs.help@gnu.org> Reply-To: tim@johnsons-web.com NNTP-Posting-Host: main.gmane.org X-Trace: sea.gmane.org 1142283338 23961 80.91.229.2 (13 Mar 2006 20:55:38 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 13 Mar 2006 20:55:38 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Mar 13 21:55:26 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 1FIu3L-0001UI-4B for geh-help-gnu-emacs@m.gmane.org; Mon, 13 Mar 2006 21:54:07 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FIu3K-0006iz-G6 for geh-help-gnu-emacs@m.gmane.org; Mon, 13 Mar 2006 15:54:06 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!headwall.stanford.edu!newshub.sdsu.edu!router2.astraweb.com!news.astraweb.com!router1.astraweb.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: 53 Original-Xref: shelby.stanford.edu gnu.emacs.help:138117 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:33746 Archived-At: On 2006-03-12, Stefan Monnier wrote: >> Perhaps time for >> (defvar running-xemacs (string-match "XEmacs\\|Lucid" emacs-version)) I thought that I had already posted the following, but since I see no sign of it, one more time (and thanks to Johan's suggestion) the derived-mode form now looks like this: ;; code (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")) ((?+ . "w") (?- . "w") (?* . "w") (?/ . "w") (?. . "w") (?< . "w") (?> . "w") (?= . "w") (?? . "w") (?$ . "w") (?% . "w") (?_ . "w") (?& . "w") (?~ . "w") (?^ . "w") (?: . "w")) )))) (message "Newlisp Derived Mode Loaded!")) The good news: The words for the face now appear as highlighted properly in XEmacs, but The bad news is: there is no fontifaction in GNU Emacs. list-text-properties-at returns Text property at 2326: fontified t And emacs shows the following message: Error during redisplay: (void-variable font-lock-newlisp-keywords-face) [2 times] Even with debug on, I see no stack trace, this is stored in *Messages* evaluating font-lock-keywords returns the following: (t ("(\\(define\\*?\\(\\(\\|-public\\|-method\\|-generic\\(-procedure\\)?\\)\\ |\\(-syntax\\|-macro\\)\\|-class\\|-module\\)\\)\\>[ ]*(?\\(\\sw+\\)?" (1 font-lock-keyword-face) (6 (cond ... ... ...) nil t)) ("\\<\\(a\\(?:cos\\|dd\\|nd\\|pp\\(?:end\\(?:\\)?\\|ly\\)\\|r\\(?:gs\\ |ray\\)\\)\\)\\>" (0 font-lock-newlisp-keywords-face))) wrapped to accomodate mailer... -- Tim Johnson http://www.alaska-internet-solutions.com