help-gnu-emacs
[Top][All Lists]

sql-mode and LaTeX

 From: Roger Mason Subject: sql-mode and LaTeX Date: Wed, 25 Feb 2004 10:58:48 -0330 User-agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.1 (gnu/linux)

Hello,

I have written some lisp functions that allow the output from an SQL buffer
to be redirected to another buffer.  It is designed to work with Alex
Schroeder's sql-mode and Postgres.  The original intent was to be able to
formulate
queries in, say, a LaTeX-mode buffer and have the results returned
there for subsequent formatting with latex.  If it ever works reliably
I intend to make it available to the Emacs community.

The problem I am having is that when the output appears in the latex
(AucTeX) buffer the column headings are lost.  For example, this query,
executed in an sql-mode buffer and returning the output to that buffer
produces this output:

--  This outputs the preamble
select'\\documentclass{article}
\\title{GAC Budget 2004}
\\author{Roger Mason \\\\ (with help from Karen Johnston \\& Karen Dawe)}
\\usepackage{float}
\\begin{document}
\\maketitle\n';

?column?

---------------------------------------------------------------------------------------------------------------------------------------------------------------------
\documentclass{article}
\title{GAC Budget 2004}
\author{Roger Mason \\ (with help from Karen Johnston \& Karen Dawe)}
\usepackage{float}
\begin{document}
\maketitle

(1 row)

Apart from the ^M (which is easy to clean up), this is the normal, expected
output.

The same query, with output redirected to a LaTeX buffer produces
this:

...
---------------------------------------------------------------------------------------------------------------------------------------------------------------------
\documentclass{article}
\title{GAC Budget 2004}
\author{Roger Mason \\ (with help from Karen Johnston \& Karen Dawe)}
\usepackage{float}
\begin{document}
\maketitle

(1 row)

'C-x =' on the ... and ^M characters yields: RET.  Only in the LaTeX
buffer does this character suppress the rest of the line.

I have looked at the coding systems for the LaTeX and sql-mode
buffers with describe-current-coding-system: they are identical.

If anyone has any idea how to fix this problem I'd be most grateful.

Thanks,

Roger Mason