From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Stefan Monnier " Newsgroups: gmane.emacs.help Subject: Re: JFlex mode for FSF-Emacs ? Date: 22 Jan 2003 15:25:36 -0500 Organization: Yale University Sender: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <5l4r81aq4f.fsf@rum.cs.yale.edu> References: <5ld6mpb1dg.fsf@rum.cs.yale.edu> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1043267609 15955 80.91.224.249 (22 Jan 2003 20:33:29 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 22 Jan 2003 20:33:29 +0000 (UTC) Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18bRYr-00048u-00 for ; Wed, 22 Jan 2003 21:33:25 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18bRWV-0006kS-07 for gnu-help-gnu-emacs@m.gmane.org; Wed, 22 Jan 2003 15:30:59 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!logbridge.uoregon.edu!news.ycc.yale.edu!rum.cs.yale.edu!rum.cs.yale.edu Original-Newsgroups: gnu.emacs.help Original-Lines: 37 Original-NNTP-Posting-Host: rum.cs.yale.edu User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 X-Original-NNTP-Posting-Host: rum.cs.yale.edu X-Original-Trace: 22 Jan 2003 15:25:36 -0500, rum.cs.yale.edu Original-Xref: shelby.stanford.edu gnu.emacs.help:109360 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:5883 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:5883 >>>>> "Andreas" == Andreas Wieweg writes: > However there is almost no syntax-highligting when using FSF-Emacs, only > comments and strings are highlighted. Now you're talking. > I thought that maybe some function/variable was used in the code, > and that it was obvious for experienced emacs-lisp users that the > function/variable was a XEmacs function/variable. But maybe it > isn't that easy and takes more time and effort. It's generally easier to find a bug when you know what you're looking for. Given the lack of info, I didn't even bother to look. Here's the problem: XEmacs recommends to set up the font-lock info of a mode by adding a `font-lock-defaults' property to the symbol of the major mode, as in: (put 'jflex-mode 'font-lock-defaults '(jflex-font-lock-keywords nil nil ((?_ . "w")) beginning-of-defun)) Instead, in Emacs, the recommended way is to set the `font-lock-defaults' variable (buffer-locally). So add to the definition of `jflex-mode' (for example right after the call to `use-local-map' which you can remove while you're at it since it's redundant): (set (make-local-variable 'font-lock-defaults) '(jflex-font-lock-keywords nil nil ((?_ . "w")) beginning-of-defun)) Note that XEmacs understands Emacs' way of doing things, so you can remove the (put 'jflex-mode ...) stuff. Stefan