From: David Hansen <david.hansen@gmx.net>
Subject: Re: Trouble with quotes in comments for mode derived from sql-mode
Date: Fri, 20 Jan 2006 16:05:34 +0100 [thread overview]
Message-ID: <87slrjhrcx.fsf@robotron.kosmorama> (raw)
In-Reply-To: 1137680440.990855.5430@f14g2000cwb.googlegroups.com
On 19 Jan 2006 06:20:41 -0800 colin wrote:
> Hello,
>
> I've written a very simple derived mode 'isq' mode which
> adds c++ style comments to sql-mode. The problem am having
> is unbalanced quotes in comments mess up string
> highlighting. I've seen similar problems in this group but
> haven't found a solution.
>
> Here's my derived mode:
>
> (define-derived-mode isq-mode sql-mode "ISQ" "Major mode to edit Sybase
> ISQ files."
> (setq indent-tabs-mode nil)
> (setq comment-start "// ")
> )
You have to modify the syntax table otherwise the syntax
parser will treat quotes within "comments" as the start of a
string.
> (font-lock-add-keywords 'isq-mode '(("\\(--.*\\|//.*\\)$" (0
> 'font-lock-comment-face t))))
And then you don't need this anymore as the syntax pass of
font-lock already highlights strings and comments.
David
prev parent reply other threads:[~2006-01-20 15:05 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-01-19 14:20 Trouble with quotes in comments for mode derived from sql-mode colin.florendo
2006-01-19 21:21 ` albrns
2006-01-20 9:55 ` Andreas Röhler
2006-01-24 15:03 ` colin.florendo
2006-01-25 4:53 ` Stefan Monnier
2006-01-20 10:42 ` Tim X
2006-01-20 15:05 ` David Hansen [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87slrjhrcx.fsf@robotron.kosmorama \
--to=david.hansen@gmx.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.