@@ -1440,25 +1440,21 @@ testdb=>
1440
1440
<literal>\r</> to cancel.
1441
1441
</para>
1442
1442
1443
- <tip>
1444
1443
<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 .
1450
1449
</para>
1451
- </tip>
1452
1450
1451
+ <tip>
1453
1452
<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.
1461
1456
</para>
1457
+ </tip>
1462
1458
</listitem>
1463
1459
</varlistentry>
1464
1460
@@ -1514,13 +1510,18 @@ Tue Oct 26 21:40:57 CEST 1999
1514
1510
1515
1511
<para>
1516
1512
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.
1523
1523
</para>
1524
+ </tip>
1524
1525
</listitem>
1525
1526
</varlistentry>
1526
1527
@@ -2598,27 +2599,6 @@ bar
2598
2599
</listitem>
2599
2600
</varlistentry>
2600
2601
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
-
2622
2602
<varlistentry>
2623
2603
<term><varname>ENCODING</varname></term>
2624
2604
<listitem>
@@ -3167,8 +3147,8 @@ $endif
3167
3147
</refsect1>
3168
3148
3169
3149
3170
- <refsect1>
3171
- <title>Environment</title>
3150
+ <refsect1 id="app-psql-environment" >
3151
+ <title id="app-psql-environment-title" >Environment</title>
3172
3152
3173
3153
<variablelist>
3174
3154
@@ -3218,8 +3198,41 @@ $endif
3218
3198
3219
3199
<listitem>
3220
3200
<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.
3223
3236
</para>
3224
3237
</listitem>
3225
3238
</varlistentry>
0 commit comments