[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Emacspeak and emacs sql mode and possible bug

Hi All,

I'm currently working on a re-write of emacspeak-sql.el, a support
mode for sql mode. The current one which comes with emacspeak supports
an sql mode which is no longer maintained and is not as "generic" as
the sql mode which now comes with emacs. 

I originally started doing this because I was having some problems
with running sql mode, mainly with font-lock screwing up and setting
the face for all text to font-lock-comment-face. I originally thought
the problem might have been due to some conflicts between
emacspeak-sql.el and emacs sql.el. However, this does not seem to be
the case, though the problem does seem to be related to emacspeak, but
in a much more subtle way I have not been able to fully determine yet.

The Problem:

The sql mode which comes with emacs 21 (and I think 20), has two
modes, sql-mode for editing sql scripts and sql-interactive-mode which
provides an interface to an external program such as sqlplus for
oracle or mysql for the mysql database (plus a few others like sybase,
postgres, etc). Once you have opened an interactive sql buffer, you
can send parts/all of your sql script to the interactive buffer with
commands like C-c C-b etc. 

The problem is that once you have started an interactive sql buffer,
font-lock does not work correctly on any files you open in sql mode
from that point onwards. Whenever you open a new file, the text
property for all text in the buffer is set to font-lock-comment-face
and voice-lock is set to voice-lock-comment-personality once a comment
of a particular style 
is encountered in the file. I'm only using Oracle and cannot confirm
if similar problems happen with non-oracle databases. While comments
don't appear to be highlighted correctly once the sql interactive
buffer is opened, the "bleeding" of comments into surrounding text
appears to be worst when you have a '--' (double minus) comment marker
- these sort of comment markers are only supposed to mark text as
being a comment until the end of line. 

This behavior only occurs if you are running emacspeak and it occurs
in both X windows with emacs in its own frame and under console
mode. When I run emacs without emacspeak, everything works correctly
and others I know who are using emacs with sql.el have had no problems
with font-lock. 

I have used describe-char-after and list-text-properties to check
things such as C-j being classified as an end-of-comment marker and
what the text properties of the characters are at various points
within the buffer. According to the syntax table, C-j is an end of
comment marker, so the comments should end after a newline, but
don't. I've checked values like font-lock-defaults before and after
setting the sql interactive buffer and cannot observe any changes. I
have re-compiled emacspeak-sql.el so that everything is commented out
and loaded it (so that it does not advise any sql-* functions, does
not add any voice lock keywords - does nothing, and still get the
problem. this makes me think it is not a problem with
emacspeak-sql.el, but a deeper problem within some other part of

As the problem only occurs once you start an interactive sql buffer
and as this is done using the comint modes of emacs, I suspect it may
be something wierd happening at that level, but at this stage I am
only guessing.

It would be good if anyone else using sql.el can let me know if they
have observed any problems. I'd really like to know if anyone else
using an oracle database can reproduce the problems I am observing and
I'd really appreciate any pointers anyone may have as to what part of
emacspeak may be causing this. Even if you are not using Oracle but
some other database and you use sql.el, I would be interested in
hearing from you. There are a couple of simple scripts I can provide
and basic steps you can follow which may reproduce the problem (or may
not). The more info I can gather, the more likely I can track down
this problem. Once that is solved, I can get back to re-doing
emacspeak-sql.el, which hopefully will add to the functionality of
emacspeak for us all.

Tim Cross					E-Mail: tcross@pobox.une.edu.au
Analyst/Programmer                               Phone: 6773 3210
Applications Group			        Mobile: 0412 969193
University of New England
find / -iname microsoft -exec rm -rf {} \;

To unsubscribe from the emacspeak list or change your address on the
emacspeak list send mail to "emacspeak-request@cs.vassar.edu" with a
subject of "unsubscribe" or "help"