From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.help Subject: Re: Syntax highlighting keywords starting with # Date: Tue, 22 Nov 2005 14:53:42 -0500 Organization: Bell Sympatico Message-ID: <8764qkfomd.fsf-monnier+gnu.emacs.help@gnu.org> References: <1131019860.252451.281450@g44g2000cwa.googlegroups.com> <87hdatyale.fsf-monnier+gnu.emacs.help@gnu.org> <1131047712.437935.238430@g47g2000cwa.googlegroups.com> <1131103675.851947.176620@z14g2000cwz.googlegroups.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1132690279 16667 80.91.229.2 (22 Nov 2005 20:11:19 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 22 Nov 2005 20:11:19 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Nov 22 21:11:10 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EeeTe-00037E-Ex for geh-help-gnu-emacs@m.gmane.org; Tue, 22 Nov 2005 21:10:54 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EeeTc-0004sO-Q0 for geh-help-gnu-emacs@m.gmane.org; Tue, 22 Nov 2005 15:10:52 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news.ems.psu.edu!news.cse.psu.edu!elk.ncren.net!newsflash.concordia.ca!News.Dal.Ca!ursa-nb00s0.nbnet.nb.ca!nf3.bellglobal.com!nf1.bellglobal.com!nf2.bellglobal.com!news20.bellglobal.com.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) Cancel-Lock: sha1:hgzxLFPh+6lKANFsR+Li4+FCm/A= Original-Lines: 20 Original-NNTP-Posting-Host: 67.71.33.38 Original-X-Complaints-To: abuse@sympatico.ca Original-X-Trace: news20.bellglobal.com 1132689222 67.71.33.38 (Tue, 22 Nov 2005 14:53:42 EST) Original-NNTP-Posting-Date: Tue, 22 Nov 2005 14:53:42 EST Original-Xref: shelby.stanford.edu gnu.emacs.help:135662 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:31264 Archived-At: > (defvar psc-mode-syntax-table > (let ((psc-mode-syntax-table (make-syntax-table))) > (modify-syntax-entry ?# "w" psc-mode-syntax-table) > psc-mode-syntax-table) > "Syntax table for PSC mode") Better not do that. Similarly, better not set font-lock-keywords (where did this idea come from? I'd like to know so I can fix the source of the problem). Instead, set font-lock-defaults: (set (make-local-variable 'font-lock-defaults) '(psc-font-lock-keywords nil nil ((?# . "w")))) Note how it tells font-lock to (temporarily) treat # as a word component. As for your main syntax-table, it should probably use something like "'" rather than "w" for #. Stefan