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: Trouble with quotes in comments for mode derived from sql-mode Date: Tue, 24 Jan 2006 23:53:43 -0500 Organization: Bell Sympatico Message-ID: <87mzhkud0u.fsf-monnier+gnu.emacs.help@gnu.org> References: <1137680440.990855.5430@f14g2000cwb.googlegroups.com> <1138115023.499061.187840@g14g2000cwa.googlegroups.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1138165954 11456 80.91.229.2 (25 Jan 2006 05:12:34 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 25 Jan 2006 05:12:34 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jan 25 06:12:33 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 1F1cxM-0007nb-KZ for geh-help-gnu-emacs@m.gmane.org; Wed, 25 Jan 2006 06:12:33 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1F1d05-0006xU-L5 for geh-help-gnu-emacs@m.gmane.org; Wed, 25 Jan 2006 00:15:21 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!headwall.stanford.edu!newshub.sdsu.edu!msrtrans!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:wEgGfIswhc/c2ioYK3YR23MqjiU= Original-Lines: 20 Original-NNTP-Posting-Host: 70.49.80.203 Original-X-Complaints-To: abuse@sympatico.ca Original-X-Trace: news20.bellglobal.com 1138164823 70.49.80.203 (Tue, 24 Jan 2006 23:53:43 EST) Original-NNTP-Posting-Date: Tue, 24 Jan 2006 23:53:43 EST Original-Xref: shelby.stanford.edu gnu.emacs.help:137219 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:32840 Archived-At: > The file format I'm using supports both sql "--" and c++ "//" comments. > sql-mode provides the "--" comment, and handles quotes in this comment > style correctly. > I added the "//" comment style through the derived mode, but the c++ > comment style does not handle the quotes correctly. I will try the > latest newcomment.el, but I suspect I'll need to modify the syntax > table as suggested by David Hansen below. Of course, you'll have to create a new syntax-table (probably inheriting from the other one). But you'll probably also discover at some point that Emacs's syntax-tables can't correctly handle -- and // at the same time. I.e. if you tell it that -- and // both start comments, then Emacs will then mistakenly also consider -/ and /- to be comment starters :-( One way out is to use font-lock-syntactic-keywords, but it's not as robust. Stefan