From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Arjan Bos Newsgroups: gmane.emacs.help Subject: Re: syntax table entries for comments Date: Thu, 11 Sep 2003 07:48:00 +0200 Organization: Wanadoo Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <3F600C90.7020506@icu.nl> References: <3f5db647$0$35674$1b62eedf@news.wanadoo.nl> <3F5F28BA.3020704@icu.nl> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1063309403 4278 80.91.224.253 (11 Sep 2003 19:43:23 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 11 Sep 2003 19:43:23 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Sep 11 21:43:21 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19xXLd-0001WU-00 for ; Thu, 11 Sep 2003 21:43:21 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.22) id 19xXDn-0001cO-J9 for geh-help-gnu-emacs@m.gmane.org; Thu, 11 Sep 2003 15:35:15 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!logbridge.uoregon.edu!kibo.news.demon.net!demon!news2.euro.net!postnews1.euro.net!news.wanadoo.nl!not-for-mail User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.4) Gecko/20030624 X-Accept-Language: en-us, en Original-Newsgroups: gnu.emacs.help In-Reply-To: Original-Lines: 49 Original-NNTP-Posting-Date: 11 Sep 2003 19:16:56 GMT Original-NNTP-Posting-Host: p4464.vwr.wanadoo.nl Original-X-Trace: 1063307816 willi.euronet.nl 34881 212.129.235.120:28687 Original-X-Complaints-To: abuse@wanadoo.nl Original-Xref: shelby.stanford.edu gnu.emacs.help:116546 X-Originally-To: "Stefan Monnier" Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:12468 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:12468 Stefan Monnier wrote: code snippet >>Could you please enlighten me as to why your way is better? I'm no (e)lisp >>expert, but I'm doing allright with a bit of voodoo programming[1]. > > > Advantages are: > - shorter. > - less memory used since the code that sets up the table can be discarded > after the table is setup, whereas in your case, the function > nrx-create-syntax-table needs to be kept around in case someone wants > to call it. > - no temporary stage where nrx-mode-syntax-table holds a value that is > not a syntax-table (or that is a syntax-table but that is not yet > properly initialized): either it's there and initialized or it's not > there at all. Sounds good to me, thanks! > > >> >>I tried the latter, but then strings within the `--' comment will undo the >>comment highlighting. > > > I suspect you used font-lock-keywords rather than > font-lock-syntactic-keywords. You're right, I'll look up the docs for that then. > > >>So I'll try to voodoo hack src/syntax.c > > > That would be wonderful. > Don't get your hopes up to high yet. The amount of constants in syntax.c and my lack of c knowlegde will make this hard. (Were it COBOL though... :-). I do happen to have a fairly recent CVS snapshot though, so I'll try it. Arjan