Subject: bug#6865: 24.0.50; Font lock error in sql mode

From: Tim Cross <[email-masked]>
Date: Mon, 16 Aug 2010 10:18:31 +1000

There is an error in the font-lock settings for SQL mode. At a guess,
the problem is that one of the regexp definitions is too aggressive. 

Essentially, any line which starts with the letters rem will result in
that line being font-locked as a comment. This is with using SQL mode to
edit SQL with the Oracle settings. 

Simple recipie to reproduce 

1. Open a buffer in sql mode
2. Ensure you have the product settings set to Oracle
3. Enter the following SQL statement 

UPDATE mytable
SET fld1 = val1,
   remote_user = val2,
   fld3 = val3
WHERE fld4 = val4;

The line remote_user = val2, will be font locked as a comment. 

Note that Oracle supports the REMARK or REM statement for comments. At a
guess, the regexp needs to be updated to only consider lines starting
with REM and a space or REMARK (either upper or lower case) as being a
comment, but not anything else.

regards,

Tim

In GNU Emacs 24.0.50.1 (i686-pc-linux-gnu, GTK+ Version 2.20.1)
 of 2010-08-16 on blind-mole
Windowing system distributor `The X.Org Foundation', version 11.0.10706000
configured using `configure  '--prefix=/usr/local''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: en_AU.utf8
  value of $XMODIFIERS: nil
  locale-coding-system: utf-8-unix
  default enable-multibyte-characters: t

Major mode: SQL[Oracle]

Minor modes in effect:
  show-paren-mode: t
  w3m-fb-mode: t
  display-time-mode: t
  shell-dirtrack-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  size-indication-mode: t
  transient-mark-mode: t
  abbrev-mode: t

Recent input:
l e c t SPC * SPC f r o SPC e n t i t l e m e n t _ 
d e f SPC w h e r e SPC e n t i t l e m e n t _ n a 
m e = ' E - M a i l ' ; <return> <up> <up> <up> <up> 
<up> <up> <up> <up> <up> <up> <up> <home> <up> <down> 
<down> <down> <down> <down> <switch-frame> <prior> 
<prior> <prior> <prior> <up> <up> <up> <up> <up> <up> 
<up> <up> <up> <up> <up> <up> <up> <up> <up> <up> <up> 
<up> <up> <up> <up> <up> <up> <up> <up> <down> <down> 
<down> <up> <up> <up> <up> <up> <up> <up> <up> <up> 
<up> <up> <up> <up> <up> <up> <up> <up> <up> <up> <up> 
<up> <up> <up> <up> <up> <up> <up> <up> <up> <up> <up> 
<up> <up> <up> <up> <up> <up> <up> <up> <up> <up> <up> 
<up> <up> <up> <up> <up> <up> <up> <up> <up> <up> <up> 
<up> <up> <up> <up> <up> <up> <up> <down> <up> <up> 
<up> <up> <up> <up> <up> <up> <up> <up> <up> <up> <up> 
<up> <up> <up> <up> <up> <up> <up> <up> <up> <up> <up> 
<up> <up> <up> <up> <up> <up> <up> <up> <up> <up> <up> 
<up> <up> <up> <up> <up> <up> <up> <up> C-x 5 2 <switch-frame> 
C-x C-f m y t e s t . s q l <return> <return> U P D 
A T E SPC m y t a b l e <return> S E T SPC a <backspace> 
v a l <backspace> <backspace> <backspace> f l d 1 SPC 
= SPC v a l 1 <return> SPC SPC SPC SPC r e m o t e 
_ u s e r SPC = SPC M-x r e p o r <tab> b <tab> <r
eturn>

Recent messages:
Wrote /home/tcross/Mail-VM/.INBOX.idx
Writing index file... done
/usr/bin/aplay<2>
Invalid timer
Emacspeak pronunciations have been re-activated in this buffer
Deleting...done
Emacspeak pronunciations have been re-activated in this buffer
Login...done
signal: End of buffer [2 times]
(New file)

Load-path shadows:
/home/tcross/bzr/vm/trunk/lisp/tapestry hides /home/tcross/git/emacspeak/lisp/tapestry
/usr/share/emacs23/site-lisp/wget-el/lpath hides /usr/share/emacs/site-lisp/auctex/lpath
/usr/local/share/emacs/24.0.50/site-lisp/auctex/tex-fptex hides /usr/share/emacs/site-lisp/auctex/tex-fptex
/usr/local/share/emacs/24.0.50/site-lisp/auctex/bib-cite hides /usr/share/emacs/site-lisp/auctex/bib-cite
/usr/local/share/emacs/24.0.50/site-lisp/auctex/context-nl hides /usr/share/emacs/site-lisp/auctex/context-nl
/usr/local/share/emacs/24.0.50/site-lisp/auctex/latex hides /usr/share/emacs/site-lisp/auctex/latex
/usr/local/share/emacs/24.0.50/site-lisp/auctex/texmathp hides /usr/share/emacs/site-lisp/auctex/texmathp
/usr/local/share/emacs/24.0.50/site-lisp/auctex/font-latex hides /usr/share/emacs/site-lisp/auctex/font-latex
/usr/local/share/emacs/24.0.50/site-lisp/auctex/tex-fold hides /usr/share/emacs/site-lisp/auctex/tex-fold
/usr/local/share/emacs/24.0.50/site-lisp/auctex/multi-prompt hides /usr/share/emacs/site-lisp/auctex/multi-prompt
/usr/local/share/emacs/24.0.50/site-lisp/auctex/context hides /usr/share/emacs/site-lisp/auctex/context
/usr/local/share/emacs/24.0.50/site-lisp/auctex/context-en hides /usr/share/emacs/site-lisp/auctex/context-en
/usr/local/share/emacs/24.0.50/site-lisp/auctex/tex-bar hides /usr/share/emacs/site-lisp/auctex/tex-bar
/usr/local/share/emacs/24.0.50/site-lisp/auctex/toolbar-x hides /usr/share/emacs/site-lisp/auctex/toolbar-x
/usr/local/share/emacs/24.0.50/site-lisp/auctex/tex-info hides /usr/share/emacs/site-lisp/auctex/tex-info
/usr/local/share/emacs/24.0.50/site-lisp/auctex/tex-jp hides /usr/share/emacs/site-lisp/auctex/tex-jp
/usr/local/share/emacs/24.0.50/site-lisp/auctex/tex-font hides /usr/share/emacs/site-lisp/auctex/tex-font
/usr/local/share/emacs/24.0.50/site-lisp/auctex/tex-buf hides /usr/share/emacs/site-lisp/auctex/tex-buf
/usr/local/share/emacs/24.0.50/site-lisp/auctex/tex-mik hides /usr/share/emacs/site-lisp/auctex/tex-mik
/usr/local/share/emacs/24.0.50/site-lisp/auctex/tex hides /usr/share/emacs/site-lisp/auctex/tex
/usr/local/share/emacs/24.0.50/site-lisp/auctex/tex-style hides /usr/share/emacs/site-lisp/auctex/tex-style
/usr/share/emacs23/site-lisp/flim/hex-util hides /usr/local/share/emacs/24.0.50/lisp/hex-util
/usr/share/emacs23/site-lisp/flim/sha1 hides /usr/local/share/emacs/24.0.50/lisp/sha1
/usr/share/emacs23/site-lisp/flim/md4 hides /usr/local/share/emacs/24.0.50/lisp/md4
/home/tcross/git/emacspeak/lisp/g-client/json hides /usr/local/share/emacs/24.0.50/lisp/json
/usr/share/emacs23/site-lisp/dictionaries-common/flyspell hides /usr/local/share/emacs/24.0.50/lisp/textmodes/flyspell
/usr/share/emacs23/site-lisp/dictionaries-common/ispell hides /usr/local/share/emacs/24.0.50/lisp/textmodes/ispell
/home/tcross/.elisp/cperl-mode hides /usr/local/share/emacs/24.0.50/lisp/progmodes/cperl-mode
/usr/share/emacs23/site-lisp/flim/ntlm hides /usr/local/share/emacs/24.0.50/lisp/net/ntlm
/usr/share/emacs23/site-lisp/flim/hmac-def hides /usr/local/share/emacs/24.0.50/lisp/net/hmac-def
/usr/share/emacs23/site-lisp/flim/sasl-ntlm hides /usr/local/share/emacs/24.0.50/lisp/net/sasl-ntlm
/usr/share/emacs23/site-lisp/flim/hmac-md5 hides /usr/local/share/emacs/24.0.50/lisp/net/hmac-md5
/usr/share/emacs23/site-lisp/flim/sasl hides /usr/local/share/emacs/24.0.50/lisp/net/sasl
/usr/share/emacs23/site-lisp/flim/sasl-digest hides /usr/local/share/emacs/24.0.50/lisp/net/sasl-digest
/usr/share/emacs23/site-lisp/flim/sasl-cram hides /usr/local/share/emacs/24.0.50/lisp/net/sasl-cram

Features:
(shadow sort emacspeak-message message mml mml-sec mm-decode mm-bodies
mm-encode mail-parse rfc2231 rfc2047 rfc2045 ietf-drums gmm-utils
mailheader emacsbug emacspeak-ansi-color ansi-color vm-sort time-stamp
netrc smtpmail newcomment mail-utils emacspeak-flyspell flyspell
emacspeak-ispell ispell vm-delete bbdb-gui longlines w3m-symbol vm-save
tapestry bbdb-vm vm-autoload bbdb-snarf mail-extr rfc822 bbdb-com
mailabbrev vm-pgg vm-reply pgg pgg-parse pgg-def vm-w3m vcard vm-vcard
emacspeak-bbdb bbdb icalendar sendmail vm-rfaddons vm-menu vm-window
vm-toolbar vm-folder vm-mime vm-undo vm-virtual vm-summary-faces
vm-summary vm-mouse vm-page vm-motion vm-minibuf vm-message vm-misc
vm-macro emacspeak-vm vm cal-iso pp mew-varsx mew-w3m emacspeak-mew
mew-auth mew-config mew-imap2 mew-imap mew-nntp2 mew-nntp mew-pop
mew-smtp mew-ssl mew-ssh mew-net mew-highlight mew-sort mew-fib mew-ext
mew-refile mew-demo mew-attach mew-draft mew-message mew-thread
mew-virtual mew-summary4 mew-summary3 mew-summary2 mew-summary
mew-search mew-pick mew-passwd mew-scan mew-syntax mew-bq mew-smime
mew-pgp mew-header mew-exec mew-mark mew-mime mew-edit mew-decode
mew-encode mew-cache mew-minibuf mew-complete mew-addrbook mew-local
mew-unix mew-vars3 mew-vars2 mew-vars mew-env mew-mule3 mew-mule
mew-gemacs mew-key mew-func mew-blvs mew-const mew tabify org-table
confluence-autoloads wtf-autoloads xml-rpc-autoloads package saveplace
org-w3m org-wl org-vm org-rmail org-mhe org-mew org-irc org-jsinfo
org-infojs org-html org-exp ob-exp org-exp-blocks org-agenda org-info
org-gnus org-bibtex org-bbdb paren server tx-fold tx-registers edmacro
emacspeak-kmacro kmacro list-register txutils tx-eudc eudcb-ldap eudc
emacspeak-eudc emacspeak-custom cus-edit cus-start eudc-vars ldap
tx-plsql plsql align emacspeak-imenu imenu tx-sql emacspeak-sql sql
tx-org org-clock emacspeak-org org ob-emacs-lisp ob-keys ob-comint
ob-tangle ob-ref ob-lob ob-table ob org-footnote org-src org-list
org-faces org-compat org-entities org-macs tx-mode-compile tx-bmk-mgr
bmk-mgr-w3m emacspeak-w3m w3m-form emacspeak-m-player emacspeak-we w3m
doc-view jka-compr image-mode w3m-hist w3m-fb w3m-ems w3m-ccl ccl
w3m-favicon w3m-image w3m-proc w3m-util emacspeak-bmk-mgr bmk-mgr
emacspeak-outline foldout noutline outline easy-mmode tc-w3m
tc-timestamp tc-template emacspeak-tempo tempo tc-keys tx-funcs tc-diary
appt cal-china lunar solar cal-dst cal-bahai cal-islam cal-hebrew
holidays hol-loaddefs diary-lib diary-loaddefs emacspeak-calendar
cal-menu calendar cal-loaddefs time tc-browse-url tc-abbrev tx-utils
boxquote rect protocols services tld vm-autoloads vm-version vm-vars
generic-x emacspeak-generic generic dired-x dired-aux emacspeak-dired
emacspeak-desktop desktop dired ls-lisp debian-el debian-el-loaddefs
w3m-wget w3m-load path-util poe pym static apel-ver product develock
bbdb-autoloads preview-latex emacspeak-auctex tex-site auto-loads
emacspeak-setup emacspeak-aumix emacspeak-forms forms-mode forms
emacspeak-webspace gweb greader g-auth derived emacspeak-webmarks
emacspeak-xslt emacspeak-webutils browse-url gfeeds g-utils json url
url-proxy url-privacy url-expand url-methods url-history url-cookie
url-util timezone mailcap url-parse auth-source gnus-util url-vars
mm-util mail-prsvr emacspeak-alsaplayer emacspeak-amark
emacspeak-replace emacspeak-advice shell comint ring emacspeak-redefine
emacspeak-personality byte-opt warnings bytecomp byte-compile emacspeak
emacspeak-widget emacspeak-view emacspeak-facemenu
emacspeak-fix-interactive emacspeak-buff-menu g-cus-load cus-load
regexp-opt emacspeak-sounds emacspeak-preamble emacspeak-keymap
emacspeak-speak time-date emacspeak-pronounce dtk-speak flite-voices
dtk-unicode descr-text help-mode easymenu view dtk-interp voice-setup
dectalk-voices espeak-voices multispeech-voices outloud-voices
acss-structure emacspeak-load-path thingatpt wid-edit advice help-fns
advice-preload vc-git cl cl-19 tooltip ediff-hook vc-hooks
lisp-float-type mwheel x-win x-dnd tool-bar dnd fontset image fringe
lisp-mode register page menu-bar rfn-eshadow timer select scroll-bar
mldrag mouse jit-lock font-lock syntax facemenu font-core frame cham
georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese hebrew greek romanian slovak czech european ethiopic
indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple
abbrev loaddefs button minibuffer faces cus-face files text-properties
overlay md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote make-network-process dbusbind
dynamic-setting system-font-setting font-render-setting move-toolbar gtk
x-toolkit x multi-tty emacs)

-- 
Tim Cross
Information Technology 
University of New England
 Phone: +61 2 6773 3210
Mobile: 0428 212217
   Fax: +61 2 6773 3424
E-Mail: [email-masked]
   Web: http://www.une.edu.au/itd
---
Please avoid sending me Word or PowerPoint attachments.
See http://www.gnu.org/philosophy/no-word-attachments.html

"Social Engineering - because there is no patch for human stupidity."

Never provide your password via email. UNE will never request it and any
organisation that does is not one you want to do business with. Any email that
appears to be from UNE and requests your password is a fake and should never
be responded to. Delete it.