diff options
author | Kevin McCarthy <kevin@8t8.us> | 2021-07-22 15:44:42 -0700 |
---|---|---|
committer | Kevin McCarthy <kevin@8t8.us> | 2021-07-24 17:36:21 -0700 |
commit | f4ff768c2764502a974042e1fe9d861a7a92fbcf (patch) | |
tree | d94b884f09266a5281337deeef611c37a8f30908 /doc | |
parent | e0232be752902950e379b8bb4bd84699d3781bb5 (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-doc | 3 | ||||
-rw-r--r-- | doc/manual.xml.head | 27 |
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/<Tab>/; - $binding =~ s/M_ENTER_S/<Return>/; + $binding =~ s/\\r/<Return>/; + $binding =~ s/\\n/<Enter>/; $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><insert></entry><entry>Insert</entry></row> <row><entry><enter></entry><entry>Enter</entry></row> <row><entry><return></entry><entry>Return</entry></row> +<row><entry><keypadenter></entry><entry>Enter key on numeric keypad</entry></row> <row><entry><home></entry><entry>Home</entry></row> <row><entry><end></entry><entry>End</entry></row> <row><entry><space></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><Enter></literal> or + <literal><Return></literal> to the same value, which Mutt + interpreted as <literal><Return></literal> internally. + </para> + <para> + However, starting in version 2.2, this mode is turned off, + allowing <literal><Return></literal> and + <literal><Enter></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><Enter></literal> is the same as <quote>\n</quote> + and <literal>^J</literal>; while <literal><Return></literal> + is the same as <quote>\r</quote> and <literal>^M</literal>. + </para> +</sect2> + </sect1> <sect1 id="cd"> |