From: Sam Peterson <skpeterson@nospam.please.ucdavis.edu>
Subject: Re: Adding sql-mode hook
Date: 16 Oct 2006 09:40:37 -0700 [thread overview]
Message-ID: <o36ac3wnri2.fsf@pc9.cs.ucdavis.edu> (raw)
In-Reply-To: 1161011418.329258.176420@b28g2000cwb.googlegroups.com
"Krishna" <calvinkrishy@gmail.com> writes:
> Sam Peterson wrote:
> > "calvinkrishy@gmail.com" <calvinkrishy@gmail.com> writes:
> >
> > > Am trying to add a sql-mode hook with
> > >
> > > (add-hook 'sql-mode-hook 'sql-highlight-oracle-keywords)
> > >
> > > in my .emacs but none of the oracle keywords are highlighted when I
> > > enter SQL mode. Only invoking the sql-highlight-oracle-keywords
> > > function seems to highlight them. What is it that I am missing? Why
> > > don't the keywords get highlighted as soon as I open a SQL file?
> > >
> > > Emacs version 21.3.1 on Windows 2000.
> >
> > Out of curiosity, does sql-highlight-oracle-keywords toggle the
> > feature? From the help:
> >
> > ---------------------------------------------------------------------
> > |sql-highlight-oracle-keywords is an interactive compiled Lisp
> > |function in `sql'. (sql-highlight-oracle-keywords)
> > |
> > |Highlight Oracle keywords.
> > |Basically, this just sets `font-lock-keywords' appropriately.
> > ---------------------------------------------------------------------
> >
> > It doesn't look like it does. There doesn't appear to be an autoload
> > for the function however. Try putting (require 'sql) before the
> > add-hook line. Not sure if that'll help, just a thought.
>
> Thanks. but that still doesn't highlight the keywords.
> But as I said doing a 'M-x sql-highlight-oracle-keywords' has the
> desired effect of highlighting the key words. Would be nice if I could
> get that as soon as I open a sql file.
>
> Krishna
>
Sound like the only other possibility is that there's a bug in how
sql-mode sets font-lock-keywords. In otherwords, it sets it after the
sql-mode-hook, which clobbers what sql-highlight-oracle-keywords does.
Might be something worth investigating.
--
Sam Peterson
skpeterson At nospam ucdavis.edu
"if programmers were paid to remove code instead of adding it,
software would be much better" -- unknown
prev parent reply other threads:[~2006-10-16 16:40 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-10-16 10:59 Adding sql-mode hook calvinkrishy
2006-10-16 13:51 ` Sam Peterson
2006-10-16 15:10 ` Krishna
2006-10-16 16:40 ` Sam Peterson [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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=o36ac3wnri2.fsf@pc9.cs.ucdavis.edu \
--to=skpeterson@nospam.please.ucdavis.edu \
/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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).