Hi hackers,
Attached is a small patch for adding "edit-and-execute-command" readline
support to psql. Bash has this concept and I miss it when using psql. It
allows you to amend the current line in an editor by pressing "v" (when
in vi mode) or "C-x C-e" (when in emacs mode). Those are the default
bindings from bash although of course they can be amended in inputrc.
Most of the patch is actually shifting "do_edit" from "command.c" to
"common.c". There is a small amendment to that function to allow vi to
launch at the correct column offset.
I noticed that there is some logic in configure for detecting certain
readline functions. I assume this is for compatibility sake with
libedit/editline? Rather than testing for each rl_* function I hid the
functionality behind HAVE_READLINE_READLINE_H .. don't know if this is
acceptable?
-Joe