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

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

Re: configuring emacs as a programmer's editor


From: Tim X
Subject: Re: configuring emacs as a programmer's editor
Date: Tue, 04 Jul 2006 18:34:00 +1000
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.50 (gnu/linux)

"Ted" <r.ted.byers@rogers.com> writes:

> Ted wrote:
>> [snip]
>> Compiling file c:/emacs-21.3/mode-compile.el at Fri Jun 30 11:54:37
>> 2006
>>   !! End of file during parsing
>>
>> This looks like an error message, but it doesn't make sense given that
>> the last line in the file is:
>>
>> ;;; mode-compile.el ends here
>>
>> This tells me that the file I'm working with has not been truncated.
>>
>> Why does byte-compiling this file fail?  Is the file on the above site
>> defective?  Is the file available elsewhere?
>>
> I found out why.  When I go to the website and save the file directly
> from within Internet Explorer, I invariably get the end of file
> nonsense.  I also have to delete some HTML tags both at the beginning
> and end of the file, along with the ^L characters.  If, instead, I
> right-click the web page and select "view source", I get a window in
> which there are no HTML tags, but I still have to delete the ^L
> characters.  But in doing this, the file compiles properly, with only
> the warnings you mentioned.  Now emacs behaves as I wish, at least for
> Perl programming.
>
> Now, all I need is to find out how to slightly alter how SQL is
> handled.  I'd like to be able to use Emacs as a client for MySQL and
> for PostgreSQL.  Can Emacs be set up to ease submitting SQL statements
> to either MySQL or PostgreSQL as I wish?  If so, how?  I have done a
> number of searches on this, but the signal to noise ratio is extremely
> low.
>

Emacs comes with sql.el - an sql mode which will allow you to send sql
statements to various database backends including postgres, mysql,
oracle, ms sql server etc. 

,----[ C-h f sql-mode RET ]
| sql-mode is an interactive autoloaded Lisp function in `sql'.
| (sql-mode)
| 
| Major mode to edit SQL.
| 
| You can send SQL statements to the SQLi buffer using
| M-x sql-send-region.  Such a buffer must exist before you can do this.
| See `sql-help' on how to create SQLi buffers.
| 
| 
| Uses keymap "sql-mode-map", which is not currently defined.
| 
| Customization: Entry to this mode runs the `sql-mode-hook'.
| 
| When you put a buffer in SQL mode, the buffer stores the last SQLi
| buffer created as its destination in the variable `sql-buffer'.  This
| will be the buffer M-x sql-send-region sends the region to.  If this
| SQLi buffer is killed, M-x sql-send-region is no longer able to
| determine where the strings should be sent to.  You can set the
| value of `sql-buffer' using M-x sql-set-sqli-buffer.
| 
| For information on how to create multiple SQLi buffers, see
| `sql-interactive-mode'.
| 
| Note that SQL doesn't have an escape character unless you specify
| one.  If you specify backslash as escape character in SQL,
| you must tell Emacs.  Here's how to do that in your `~/.emacs' file:
| 
| (add-hook 'sql-mode-hook
|           (lambda ()
|           (modify-syntax-entry ?\\ "." sql-mode-syntax-table)))
`----

Tim

-- 
tcross (at) rapttech dot com dot au


reply via email to

[Prev in Thread] Current Thread [Next in Thread]