Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gnBfp-0007FC-JH for pgsql-bugs@arkaria.postgresql.org; Sat, 26 Jan 2019 00:18:13 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gnBfn-0000bQ-VQ for pgsql-bugs@arkaria.postgresql.org; Sat, 26 Jan 2019 00:18:11 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gnBfn-0000XD-HA for pgsql-bugs@lists.postgresql.org; Sat, 26 Jan 2019 00:18:11 +0000 Received: from momjian.us ([72.94.173.45]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gnBfg-0008Dz-5Q for pgsql-bugs@postgresql.org; Sat, 26 Jan 2019 00:18:10 +0000 Received: from bruce by momjian.us with local (Exim 4.84_2) (envelope-from ) id 1gnBfd-0003kC-Av; Fri, 25 Jan 2019 19:18:01 -0500 Date: Fri, 25 Jan 2019 19:18:01 -0500 From: Bruce Momjian To: Peter Eisentraut Cc: Alvaro Herrera , =?utf-8?B?0JTQuNC70Y/QvSDQn9Cw0LvQsNGD0LfQvtCy?= , Tom Lane , pgsql-bugs@postgresql.org Subject: Re: psql and readline comments Message-ID: <20190126001801.GL13803@momjian.us> References: <201901141559.ne4yhv2nwsl5@alvherre.pgsql> <82eab8ea-5d9d-efab-dcc8-d7713d2b0645@2ndquadrant.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <82eab8ea-5d9d-efab-dcc8-d7713d2b0645@2ndquadrant.com> User-Agent: Mutt/1.5.23 (2014-03-12) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Fri, Jan 18, 2019 at 09:18:09AM +0100, Peter Eisentraut wrote: > On 14/01/2019 16:59, Alvaro Herrera wrote: > > I agree -- it doesn't make sense to treat the insert-comment command as > > inserting a #, which is not a comment for psql. I use meta-# often in > > bash and I'm never happy to have to resort to manually prepending "--" > > in psql in order to make the current line a comment instead. > > I have found > > rl_variable_bind("comment-begin",";"); > > in the clisp code, so it seems it's not unheard of to do this sort of thing. Agreed. I am not sure how someone would conditionally bind M-# to -- _only_ in psql, so it seems doing it in psql might be the logical, and only choice. I see rl_variable_bind() referenced in libedit: https://android.googlesource.com/platform/external/libedit/+/refs/heads/master/src/readline.c so I think we are good in applying this to master. -- Bruce Momjian http://momjian.us EnterpriseDB http://enterprisedb.com + As you are, so once was I. As I am, so you will be. + + Ancient Roman grave inscription +