Re: about EDITOR_LINENUMBER_SWITCH

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: about EDITOR_LINENUMBER_SWITCH
Date: 2011-05-24 20:36:52
Message-ID: 1306269412.14693.7.camel@vanquo.pezone.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On lör, 2011-05-21 at 20:39 -0400, Robert Haas wrote:
> On Sat, May 21, 2011 at 5:47 PM, Peter Eisentraut <peter_e(at)gmx(dot)net> wrote:
> > I noticed the 9.1 release notes claim that the new
> > EDITOR_LINENUMBER_SWITCH thing is an environment variable, whereas it is
> > actually a psql variable.

> It's probably the result of drift between the original patch and what
> was eventually committed. IIRC, Pavel had it as an environment
> variable originally, but Tom and I didn't feel the feature was
> important enough to merit that treatment.

I think it's not really a matter of "importance", it's a matter of
making things work correctly. I have a shell configuration that sets
different environment variables, including editor, depending on what
directory I'm in. Now I think that all the editors in question use the
+ syntax, but anyone else with something like that slightly out of the
ordinary would be stuck. The other problem is if I change the editor
here, I have to change this other piece there. Note that you cannot
even specify the editor itself in psqlrc.

> > Another thought is that this whole thing could be done away with if we
> > just allowed people to pass through arbitrary options to the editor,
> > like
> >
> > \edit file.sql +50 -a -b -c
> >
> > For powerusers, this could have interesting possibilities.
>
> That's an intriguing possibility. But part of the point of the
> original feature was to be able to say:
>
> \ef somefunc 10
>
> ...and end up on line 10 of somefunc, perhaps in response to an error
> message complaining about that line. I don't think your proposal
> would address that.

Well, you'd write

\ef somefunc +10

instead. Or something else, depending on the editor, but then you'd
know what to write, since under the current theory you'd have to have
configured it previously. Using the "+10" syntax also looks a bit
clearer, in my mind.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2011-05-24 20:38:31 Re: about EDITOR_LINENUMBER_SWITCH
Previous Message Robert Haas 2011-05-24 20:34:29 tackling full page writes