all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Phil Sainty <psainty@orcon.net.nz>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: Michael Mauger <mmauger@protonmail.com>, 22016@debbugs.gnu.org
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	[thread overview]
Message-ID: <081bc900b7f282502ae971114b82b868@webmail.orcon.net.nz> (raw)
In-Reply-To: <87r23msdak.fsf@gnus.org>

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






      reply	other threads:[~2019-10-09 21:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-26  9:51 bug#22016: 25.0.50; sql-interactive-mode prompts and header alignment in query output Phil Sainty
2019-10-09  5:22 ` Lars Ingebrigtsen
2019-10-09 21:50   ` Phil Sainty [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=081bc900b7f282502ae971114b82b868@webmail.orcon.net.nz \
    --to=psainty@orcon.net.nz \
    --cc=22016@debbugs.gnu.org \
    --cc=larsi@gnus.org \
    --cc=mmauger@protonmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.