[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Trouble with quotes in comments for mode derived from sql-mode
From: |
Stefan Monnier |
Subject: |
Re: Trouble with quotes in comments for mode derived from sql-mode |
Date: |
Tue, 24 Jan 2006 23:53:43 -0500 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) |
> 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