unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Michael Mauger <michael@mauger.com>
To: "Simen Heggestøyl" <simenheg@gmail.com>
Cc: "alex@gnu.org" <alex@gnu.org>,
	"24646@debbugs.gnu.org" <24646@debbugs.gnu.org>
Subject: bug#24646: [PATCH] Complete the name of PostgreSQL databases
Date: Mon, 7 Nov 2016 04:03:27 +0000 (UTC)	[thread overview]
Message-ID: <1356767530.1331843.1478491407910@mail.yahoo.com> (raw)
In-Reply-To: <1478443615.12208.0@smtp.gmail.com>

On Sunday, November 6, 2016 9:47 AM, Simen Heggestøyl <simenheg@gmail.com> wrote:
>On Sun, Oct 23, 2016 at 11:50 PM, Michael Mauger <michael@mauger.com> 
>wrote:
>> In the meantime, I'll review your patch and test further; I'll get 
>> back to you if I have any issues.
>
>Thanks, Michael. Did you get a chance to test it yet? If it saves you
>time, I can install the patch once you're happy with it.
>
>
>-- Simen


Several comments:
* Rather than hard-coding "psql", please use `sql-postgres-program' which can be customized to locate the psql executable.
* The "psql -l" command should also use the "-X,--no-psqlrc" option to avoid a configuration file overriding the field separator and changing the output format
* Rather than `(substring row (match-beginning 1) (match-end 1))' use `(match-string 1 row)'
* Return the nreverse of the result list so that the completion list is in the same order as psql lists them.
* `dolist' can specify the return value rather than having a separate expression after the loop. That is, (dolist (row (process-lines ...) (nreverse res)) ...)) is equivalent to (dolist (row (process-lines ...)) ...) (nreverse res)
* I'm concerned about the change to the `completing-read' call in `sql-get-login-ext'. Rather than `nil', I'd suggest `confirm' so that if the value isn't in the list, it must be confirmed.
* If the REQUIRE-MATCH parameter should really be something other than `t', then possibbly we should add another keyword :completion-required whose value would be used in the `completing-read' call (default to `t' to preserve current functionality).
* Thank you including the test module. I need to expand automated testing significantly and I appreciate your efforts to kickstart the effort and shame me to action :).


I greatly appreciate your submission but think we need to tighten up the code a bit before we commit it to the code base.





  reply	other threads:[~2016-11-07  4:03 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-09  9:55 bug#24646: [PATCH] Complete the name of PostgreSQL databases Simen Heggestøyl
2016-10-23 12:00 ` Simen Heggestøyl
2016-10-23 21:50   ` Michael Mauger
2016-10-24  6:32     ` Eli Zaretskii
2016-11-06 14:46     ` Simen Heggestøyl
2016-11-07  4:03       ` Michael Mauger [this message]
2016-11-12 11:11         ` Simen Heggestøyl
2016-11-14 15:51           ` Michael Mauger
2016-11-15 18:11             ` Simen Heggestøyl

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=1356767530.1331843.1478491407910@mail.yahoo.com \
    --to=michael@mauger.com \
    --cc=24646@debbugs.gnu.org \
    --cc=alex@gnu.org \
    --cc=simenheg@gmail.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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).