syntax highlighting in emacs after \e in psql

Started by MikeWover 14 years ago3 messagesgeneral
Jump to latest
#1MikeW
wlasenek@gmail.com

Hi All,

I'm sure somebody has already solved this problem on Unix.

When I open *.sql files in my emacs it highlights the SQL and Postgres
syntax correctly. But does anybody know how to make it behave like
that also after invoking \e command in psql (so that I don't need to
say: M-x sql-mode each time). My .profile contains: PSQL_EDITOR=emacs;
export PSQL_EDITOR.

Thanks!
MikeW

#2Peter Eisentraut
peter_e@gmx.net
In reply to: MikeW (#1)
Re: syntax highlighting in emacs after \e in psql

On mån, 2011-11-14 at 08:08 -0800, MikeW wrote:

When I open *.sql files in my emacs it highlights the SQL and Postgres
syntax correctly. But does anybody know how to make it behave like
that also after invoking \e command in psql (so that I don't need to
say: M-x sql-mode each time). My .profile contains: PSQL_EDITOR=emacs;
export PSQL_EDITOR.

(add-to-list 'auto-mode-alist
'("/psql.edit.[0-9]+\\'" . sql-mode))

#3MikeW
wlasenek@gmail.com
In reply to: MikeW (#1)
Re: syntax highlighting in emacs after \e in psql

(add-to-list 'auto-mode-alist
             '("/psql.edit.[0-9]+\\'" . sql-mode))

Thanks, Peter!
That's exactly what I was looking for.