@@ -1440,25 +1440,21 @@ testdb=>
14401440 <literal>\r</> to cancel.
14411441 </para>
14421442
1443- <tip>
14441443 <para>
1445- <application>psql</application> checks the environment
1446- variables <envar>PSQL_EDITOR</envar>, <envar>EDITOR</envar>, and
1447- <envar>VISUAL</envar> (in that order) for an editor to use. If
1448- all of them are unset, <filename>vi</filename> is used on Unix
1449- systems, <filename>notepad.exe</filename> on Windows systems .
1444+ If a line number is specified, <application>psql</application> will
1445+ position the cursor on the specified line of the file or query buffer.
1446+ Note that if a single all-digits argument is given,
1447+ <application>psql</application> assumes it is a line number,
1448+ not a file name .
14501449 </para>
1451- </tip>
14521450
1451+ <tip>
14531452 <para>
1454- If a line number is specified, <application>psql</application> will
1455- position the cursor on the specified line of the file or query buffer.
1456- This feature requires the <varname>EDITOR_LINENUMBER_SWITCH</varname>
1457- variable to be set, so that <application>psql</application> knows how
1458- to specify the line number to the editor. Note that if a single
1459- all-digits argument is given, <application>psql</application> assumes
1460- it is a line number not a file name.
1453+ See under <xref linkend="app-psql-environment"
1454+ endterm="app-psql-environment-title"> for how to configure and
1455+ customize your editor.
14611456 </para>
1457+ </tip>
14621458 </listitem>
14631459 </varlistentry>
14641460
@@ -1514,13 +1510,18 @@ Tue Oct 26 21:40:57 CEST 1999
15141510
15151511 <para>
15161512 If a line number is specified, <application>psql</application> will
1517- position the cursor on the specified line of the function body
1518- (note that the function body typically does not begin on the
1519- first line of the file).
1520- This feature requires the <varname>EDITOR_LINENUMBER_SWITCH</varname>
1521- variable to be set, so that <application>psql</application> knows how
1522- to specify the line number to the editor.
1513+ position the cursor on the specified line of the function body.
1514+ (Note that the function body typically does not begin on the first
1515+ line of the file.)
1516+ </para>
1517+
1518+ <tip>
1519+ <para>
1520+ See under <xref linkend="app-psql-environment"
1521+ endterm="app-psql-environment-title"> for how to configure and
1522+ customize your editor.
15231523 </para>
1524+ </tip>
15241525 </listitem>
15251526 </varlistentry>
15261527
@@ -2598,27 +2599,6 @@ bar
25982599 </listitem>
25992600 </varlistentry>
26002601
2601- <varlistentry>
2602- <term><varname>EDITOR_LINENUMBER_SWITCH</varname></term>
2603- <listitem>
2604- <para>
2605- When <command>\edit</command> or <command>\ef</command> is used with a
2606- line number argument, this variable specifies the command-line switch
2607- used to pass the line number to the user's editor. For editors such
2608- as <productname>emacs</> or <productname>vi</>, you can simply set
2609- this variable to a plus sign. Include a trailing space in the value
2610- of the variable if there needs to be space between the switch name and
2611- the line number.
2612- Examples:
2613-
2614- <programlisting>
2615- \set EDITOR_LINENUMBER_SWITCH +
2616- \set EDITOR_LINENUMBER_SWITCH '--line '
2617- </programlisting>
2618- </para>
2619- </listitem>
2620- </varlistentry>
2621-
26222602 <varlistentry>
26232603 <term><varname>ENCODING</varname></term>
26242604 <listitem>
@@ -3167,8 +3147,8 @@ $endif
31673147 </refsect1>
31683148
31693149
3170- <refsect1>
3171- <title>Environment</title>
3150+ <refsect1 id="app-psql-environment" >
3151+ <title id="app-psql-environment-title" >Environment</title>
31723152
31733153 <variablelist>
31743154
@@ -3218,8 +3198,41 @@ $endif
32183198
32193199 <listitem>
32203200 <para>
3221- Editor used by the <command>\e</command> command. The variables
3222- are examined in the order listed; the first that is set is used.
3201+ Editor used by the <command>\e</command> and
3202+ <command>\ef</command> commands. The variables are examined in
3203+ the order listed; the first that is set is used.
3204+ </para>
3205+
3206+ <para>
3207+ The built-in default editors are <filename>vi</filename> on Unix
3208+ systems and <filename>notepad.exe</filename> on Windows systems.
3209+ </para>
3210+ </listitem>
3211+ </varlistentry>
3212+
3213+ <varlistentry>
3214+ <term><envar>PSQL_EDITOR_LINENUMBER_ARG</envar></term>
3215+
3216+ <listitem>
3217+ <para>
3218+ When <command>\e</command> or <command>\ef</command> is used
3219+ with a line number argument, this variable specifies the
3220+ command-line argument used to pass the starting line number to
3221+ the user's editor. For editors such as <productname>Emacs</> or
3222+ <productname>vi</>, this is a plus sign. Include a trailing
3223+ space in the value of the variable if there needs to be space
3224+ between the option name and the line number. Examples:
3225+ <programlisting>
3226+ PSQL_EDITOR_LINENUMBER_ARG='+'
3227+ PSQL_EDITOR_LINENUMBER_ARG='--line '
3228+ </programlisting>
3229+ </para>
3230+
3231+ <para>
3232+ The default is <literal>+</literal> on Unix systems
3233+ (corresponding to the default editor <filename>vi</filename>,
3234+ and useful for many other common editors); but there is no
3235+ default on Windows systems.
32233236 </para>
32243237 </listitem>
32253238 </varlistentry>
0 commit comments