From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Phil Sainty Newsgroups: gmane.emacs.bugs Subject: bug#22016: 25.0.50; sql-interactive-mode prompts and header alignment in query output Date: Thu, 10 Oct 2019 10:50:39 +1300 Message-ID: <081bc900b7f282502ae971114b82b868@webmail.orcon.net.nz> References: <5656D63C.5090402@orcon.net.nz> <87r23msdak.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="160133"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Orcon Webmail Cc: Michael Mauger , 22016@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Oct 09 23:59:06 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iIJz5-000fTz-Pk for geb-bug-gnu-emacs@m.gmane.org; Wed, 09 Oct 2019 23:59:03 +0200 Original-Received: from localhost ([::1]:60354 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIJz4-0001hT-LU for geb-bug-gnu-emacs@m.gmane.org; Wed, 09 Oct 2019 17:59:02 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53837) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIJrO-0003lD-BV for bug-gnu-emacs@gnu.org; Wed, 09 Oct 2019 17:51:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iIJrM-00004v-NG for bug-gnu-emacs@gnu.org; Wed, 09 Oct 2019 17:51:06 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:45486) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iIJrK-0008WF-K8 for bug-gnu-emacs@gnu.org; Wed, 09 Oct 2019 17:51:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iIJrK-0003Dd-CS for bug-gnu-emacs@gnu.org; Wed, 09 Oct 2019 17:51:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Phil Sainty Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 09 Oct 2019 21:51:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22016 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo unreproducible Original-Received: via spool by 22016-submit@debbugs.gnu.org id=B22016.157065785012352 (code B ref 22016); Wed, 09 Oct 2019 21:51:02 +0000 Original-Received: (at 22016) by debbugs.gnu.org; 9 Oct 2019 21:50:50 +0000 Original-Received: from localhost ([127.0.0.1]:54307 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iIJr8-0003DA-83 for submit@debbugs.gnu.org; Wed, 09 Oct 2019 17:50:50 -0400 Original-Received: from smtp-3.orcon.net.nz ([60.234.4.44]:60081) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iIJr6-0003D1-MG for 22016@debbugs.gnu.org; Wed, 09 Oct 2019 17:50:49 -0400 Original-Received: from [10.253.37.70] (port=41538 helo=webmail.orcon.net.nz) by smtp-3.orcon.net.nz with esmtpa (Exim 4.90_1) (envelope-from ) id 1iIJqx-0002F7-9k; Thu, 10 Oct 2019 10:50:40 +1300 Original-Received: from wlgwil-nat-office.catalyst.net.nz ([202.78.240.7]) via [10.253.37.253] by webmail.orcon.net.nz with HTTP (HTTP/1.1 POST); Thu, 10 Oct 2019 10:50:39 +1300 In-Reply-To: <87r23msdak.fsf@gnus.org> X-Sender: psainty@orcon.net.nz X-GeoIP: -- X-Spam_score: -2.9 X-Spam_score_int: -28 X-Spam_bar: -- X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:168806 Archived-At: Hi Lars, Michael, On 2019-10-09 18:22, Lars Ingebrigtsen wrote: > Michael sent a control message marking this bug as > unreproducible/moreinfo under the subject "Close bugs", but didn't > actually close the bug reports. I'm not quite sure what Michael's > intentions were -- Michael, did you want the bug reporter to supply > more information, or did you mean that this bug had been fixed? Looking at this again... `sql-interactive-remove-continuation-prompt' used in `comint-preoutput-filter-functions' is presumably intended to take care of this very problem; and that pre-dates this bug report. So there may well have been some other contributing factor responsible for it not working in my case. The first thing that springs to mind is that the default postgres prompt regexps do not recognise hyphens, so I was also modifying those patterns to recognise my hyphenated database names. The current sql.el postgres defaults are: :prompt-regexp "^[[:alnum:]_]*=[#>] " :prompt-cont-regexp "^[[:alnum:]_]*[-(][#>] " My config has: ;; Default postgres pattern was: "^\\w*=[#>] " (see `sql-product-alist'). (setq sql-prompt-regexp "^\\(?:\\sw\\|\\s_\\|-\\)*=[#>] ") ;; Ditto for continuation prompt: "^\\w*[-(][#>] " (setq sql-prompt-cont-regexp "^\\(?:\\sw\\|\\s_\\|-\\)*[-(][#>] ")) I then have the following notes: ;; Allow symbol chars and hyphens in database names in prompt. ;; TODO: Try to make this *strictly* accurate, in accordance with: ;; http://www.postgresql.org/docs/current/interactive/sql-syntax-lexical.html#SQL-SYNTAX-IDENTIFIERS ;; (and then submit the fix upstream). (hmm... hyphens are not ;; actually mentioned in that documentation :/ ) ;; ;; SQL identifiers and key words must begin with a letter (a-z, ;; but also letters with diacritical marks and non-Latin letters) ;; or an underscore (_). Subsequent characters in an identifier or ;; key word can be letters, underscores, digits (0-9), or dollar ;; signs ($). Note that dollar signs are not allowed in ;; identifiers according to the letter of the SQL standard, so ;; their use might render applications less portable. The SQL ;; standard will not define a key word that contains digits or ;; starts or ends with an underscore, so identifiers of this form ;; are safe against possible conflict with future extensions of ;; the standard. ;; ;; The system uses no more than NAMEDATALEN-1 bytes of an ;; identifier; longer names can be written in commands, but they ;; will be truncated. By default, NAMEDATALEN is 64 so the maximum ;; identifier length is 63 bytes. If this limit is problematic, it ;; can be raised by changing the NAMEDATALEN constant in ;; src/include/pg_config_manual.h. Tracing my own config changes, I can see that I supported symbol chars in `sql-prompt-regexp' before other changes, however I seemingly didn't fix this in `sql-prompt-cont-regexp' until the same commit in which I added my filter. Potentially that means all I'd ever really needed was for both prompt regexps to be compatible, but I would need to do some more testing to figure this out. It looks like the postgres prompt regexps are still a going concern for sql.el itself, so that could be up for discussion in the meantime. -Phil