summaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorKevin McCarthy <kevin@8t8.us>2021-07-22 15:44:42 -0700
committerKevin McCarthy <kevin@8t8.us>2021-07-24 17:36:21 -0700
commitf4ff768c2764502a974042e1fe9d861a7a92fbcf (patch)
treed94b884f09266a5281337deeef611c37a8f30908 /doc
parente0232be752902950e379b8bb4bd84699d3781bb5 (diff)
Enable nonl() mode for ncurses. closes #362.
This patch is based on the patch from Mike Frysinger, archived from the old trac system at: https://gitlab.com/muttmua/trac-tickets/-/blob/master/attachments/3494/mutt-enter-return-hg-6658.patch This version creates a new key symbol, <KeypadEnter> for the KEY_ENTER value returned by getch(). According to Vincent Lefèvre's research, that corresponds to the "key pad" Enter key. If KEY_ENTER is not defined, it binds the symbol to "\n". It does this after the KeyNames[] definitions of <Enter> and <Return> so they remain the default shown by <what-key>. Since Mutt already accepts KEY_ENTER at the y/n prompt, add it for all the built-in operations too. Bindings with "\r" and "\n" in the binding_t structures don't need "<enter>" and "<return>" to be re-specified in km_init(), so remove those. Instead add the "<KeypadEnter>" bindings there. Remove unnecessary Alias menu bindings for OP_GENERIC_SELECT_ENTRY in km_init(). As a note: I don't believe non-extended key symbol bindings need to be bound inside km_init(). I'm not clear why this was done, or what purpose it serves. I'll do a bit more research, but if I can't uncover any issues, will move them inside the binding_t structures in another commit.
Diffstat (limited to 'doc')
-rw-r--r--doc/gen-map-doc3
-rw-r--r--doc/manual.xml.head27
2 files changed, 29 insertions, 1 deletions
diff --git a/doc/gen-map-doc b/doc/gen-map-doc
index 4f58f13f..a58961b4 100644
--- a/doc/gen-map-doc
+++ b/doc/gen-map-doc
@@ -35,7 +35,8 @@ while (<STDIN>) {
$binding =~ s/^\\(0\d+)$/'^'.chr(64+oct($1))/e;
$binding =~ s/^\\(0\d+)(.)/'^'.chr(64+oct($1)) ." $2"/e;
$binding =~ s/\\t/&lt;Tab&gt;/;
- $binding =~ s/M_ENTER_S/&lt;Return&gt;/;
+ $binding =~ s/\\r/&lt;Return&gt;/;
+ $binding =~ s/\\n/&lt;Enter&gt;/;
$binding =~ s/NULL//;
die "unknown key $binding" if $binding =~ /\\[^\\]|<|>/;
die "unknown OP $op" unless $OPS{$op};
diff --git a/doc/manual.xml.head b/doc/manual.xml.head
index c4e7427e..f2d7760d 100644
--- a/doc/manual.xml.head
+++ b/doc/manual.xml.head
@@ -2767,6 +2767,7 @@ addition, <emphasis>key</emphasis> may be a symbolic name as shown in
<row><entry>&lt;insert&gt;</entry><entry>Insert</entry></row>
<row><entry>&lt;enter&gt;</entry><entry>Enter</entry></row>
<row><entry>&lt;return&gt;</entry><entry>Return</entry></row>
+<row><entry>&lt;keypadenter&gt;</entry><entry>Enter key on numeric keypad</entry></row>
<row><entry>&lt;home&gt;</entry><entry>Home</entry></row>
<row><entry>&lt;end&gt;</entry><entry>End</entry></row>
<row><entry>&lt;space&gt;</entry><entry>Space bar</entry></row>
@@ -2834,6 +2835,32 @@ specified key sequence.
</para>
</sect2>
+<sect2 id="crlf">
+ <title>Enter versus Return</title>
+
+ <para>
+ Prior to version 2.2, Mutt used a default ncurses mode
+ (<quote><literal>nl()</literal></quote>). This mode maps keyboard
+ input of either <literal>&lt;Enter&gt;</literal> or
+ <literal>&lt;Return&gt;</literal> to the same value, which Mutt
+ interpreted as <literal>&lt;Return&gt;</literal> internally.
+ </para>
+ <para>
+ However, starting in version 2.2, this mode is turned off,
+ allowing <literal>&lt;Return&gt;</literal> and
+ <literal>&lt;Enter&gt;</literal> to be mapped separately, if
+ desired. The default keyboard mappings set both, but you can
+ override this or create new bindings with one or the other (or
+ both).
+ </para>
+ <para>
+ Note that in terminal application, such as Mutt,
+ <literal>&lt;Enter&gt;</literal> is the same as <quote>\n</quote>
+ and <literal>^J</literal>; while <literal>&lt;Return&gt;</literal>
+ is the same as <quote>\r</quote> and <literal>^M</literal>.
+ </para>
+</sect2>
+
</sect1>
<sect1 id="cd">