[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: |
Andreas Röhler |
Subject: |
Re: Trouble with quotes in comments for mode derived from sql-mode |
Date: |
Fri, 20 Jan 2006 10:55:21 +0100 |
User-agent: |
KNode/0.9.2 |
colin.florendo@sybase.com 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 "// ")
> )
>
> (font-lock-add-keywords 'isq-mode '(("\\(--.*\\|//.*\\)$" (0
> 'font-lock-comment-face t))))
> (add-to-list 'auto-mode-alist '(".isq\\'" . isq-mode))
>
> I'm not sure if this is a shortcoming of sql-mode itself or if I'm
> missing something.
> Any help would be appreciated.
>
> I'm using gnu emacs 21.1.1 on solaris 2.8
>
> -Colin
Please load the latest newcomment.el and tell, if the problem persists.
I just digged a little bit into, to adapt some things: not to depend
on transient-mark-mode, continuation if some key is pressed, fix evolving
spaces and so on.
As I didn't work with sql-mode, some questions:
Your comment-start seems the same as in c++-mode. Is the problem also there?
Are you sure you need "// " instead of "--" or other - not so special - chars?
Maybe send some examples with email, so I may look at it.
Andreas Roehler