From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: David C Sterratt Newsgroups: gmane.emacs.help Subject: Re: Font-lock with newcomment.el Date: 30 May 2003 12:12:57 +0100 Organization: School of Informatics, The University of Edinburgh Sender: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: <5lhe7dpslh.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 1054293346 7321 80.91.224.249 (30 May 2003 11:15:46 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Fri, 30 May 2003 11:15:46 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Fri May 30 13:15:45 2003 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 19LhrN-0001tx-00 for ; Fri, 30 May 2003 13:15:45 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.20) id 19Lhrw-0001N8-AD for gnu-help-gnu-emacs@m.gmane.org; Fri, 30 May 2003 07:16:20 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!colt.net!diablo.theplanet.net!news.indigo.ie!feeder.news.heanet.ie!server5.netnews.ja.net!server6.netnews.ja.net!newsfeed.ed.ac.uk!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 49 Original-NNTP-Posting-Host: canonmills.inf.ed.ac.uk Original-X-Trace: scotsman.ed.ac.uk 1054293119 8972 129.215.29.137 (30 May 2003 11:11:59 GMT) Original-X-Complaints-To: usenet@scotsman.ed.ac.uk Original-NNTP-Posting-Date: Fri, 30 May 2003 11:11:59 +0000 (UTC) User-Agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Portable Code) Original-Xref: shelby.stanford.edu gnu.emacs.help:113877 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:10370 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:10370 >>>>> Stefan Monnier writes: >>>>> "David" == David C Sterratt writes: >> in gnu emacs as opposed to simple.el in xemacs. But it's not >> clear from these files how the variables comment-start &c set up >> the font-locking. > It's not clear simply because it's not the case. Font-lock uses > syntax-tables rather than comment-start and comment-end. > Your problem is that XEmacs uses different settings for "two-char > comment-markers of style b": >> (?\n . "> b") (?/ . ". 1456") (?* . ". 23") > The `56' above is XEmacs specific. In Emacs, you'd do use (?/ > . ". 124b") instead. I think the Emacs syntax is accepted by > XEmacs as well. Thanks very much to you and Lawrence for your speedy assistance. The above syntax does work for emacs, but not for XEmacs 21.4. The slightly ugly construct below does the trick for both. (cond ( (string-match "XEmacs" (emacs-version)) (setq font-lock-defaults '((nrnhoc-font-lock-keywords) nil ; do not do string/comment highlighting nil ; keywords are case sensitive. ;; This puts _ as a word constituent, ;; simplifying our keywords significantly ((?_ . "w") (?\n . "> b") (?/ . ". 1456") (?* . ". 23") (?\^m . "> b"))))) (t (setq font-lock-defaults '((nrnhoc-font-lock-keywords) nil ; do not do string/comment highlighting nil ; keywords are case sensitive. ;; This puts _ as a word constituent, ;; simplifying our keywords significantly ((?_ . "w") (?\n . "> b") (?/ . ". 124b") (?* . ". 23") (?\^m . "> b")))))) David.