[ this is a digression from the main point of the thread, but ... ]

Alvaro Herrera <alvhe...@alvh.no-ip.org> writes:
> I am particularly bothered by the uselessness
> that M-# results in -- namely, inserting a # at the start of the buffer.

Fixing that might be as simple as the attached.  I've not beat on
it hard though.

                        regards, tom lane

diff --git a/src/bin/psql/input.c b/src/bin/psql/input.c
index f926bc98dc..1dcd95a7b9 100644
--- a/src/bin/psql/input.c
+++ b/src/bin/psql/input.c
@@ -353,8 +353,13 @@ initializeInput(int flags)
 
 		useReadline = true;
 
-		/* these two things must be done in this order: */
+		/* set appropriate values for Readline's global variables */
 		initialize_readline();
+
+		/* set comment-begin to a useful value for SQL */
+		(void) rl_variable_bind("comment-begin", "-- ");
+
+		/* this reads ~/.inputrc, so do it after rl_variable_bind */
 		rl_initialize();
 
 		useHistory = true;

Reply via email to