[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Adding sql-mode hook
From: |
Sam Peterson |
Subject: |
Re: Adding sql-mode hook |
Date: |
16 Oct 2006 09:40:37 -0700 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.4 |
"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