Re: review: psql: edit function, show function commands patch - Mailing list pgsql-hackers

From Tom Lane
Subject Re: review: psql: edit function, show function commands patch
Date
Msg-id 7020.1280803778@sss.pgh.pa.us
Whole thread Raw
In response to Re: review: psql: edit function, show function commands patch  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: review: psql: edit function, show function commands patch  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> This is actually my biggest concern about this patch - that it may be
> just too much of a hassle to actually make it work for people.  I just
> tried setting $EDITOR to MacOS's TextEdit program, and it turns out
> that TextEdit doesn't understand +.  I'm afraid that we're going to
> end up with a situation where it only works for people using emacs or
> vi, and everyone else ends up with a broken install (and, possibly, no
> clear idea how to fix it).

[ disclaimer: I've not looked at the proposed patch yet ]

It seems like this ought to be fairly easily surmountable as long as
the patch is designed for failure.  The fallback position is just that
the line number does nothing, ie \ef foo just opens the editor and
doesn't try to position the cursor anywhere special; nobody can complain
about that because it's no worse than before.  What we need is to not
try to force positioning if we don't recognize the editor.  I'm tempted
to suggest forgetting about any user-configurable parameter and just
provide code that strcmp's the $EDITOR value to see if it recognizes the
editor name, otherwise do nothing.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: review: psql: edit function, show function commands patch
Next
From: Robert Haas
Date:
Subject: Re: review: psql: edit function, show function commands patch