bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: apparent inconsistencies in readline documentation


From: Daniel Molina
Subject: Re: apparent inconsistencies in readline documentation
Date: Tue, 28 Jul 2020 10:21:45 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0

On 27/7/20 22:09, Chet Ramey wrote:
> On 7/25/20 12:21 PM, Daniel Molina wrote:
>> Hi,
>>
>> I found some aspects of readline documentation that seem inconsistent to
>> me and I wanted to share them.
>>
>> 1. The difference between backward-kill-line and unix-line-discard
>> readline commands.
>>
>> Documentation states:
>>
>>        backward-kill-line (C-x Rubout)
>>               Kill backward to the beginning of the line.
>>
>>        unix-line-discard (C-u)
>>               Kill backward from point to the  beginning  of  the 
>> line.   The
>>               killed text is saved on the kill-ring.
>>
>> In both cases they kill from the point and killed text is saved in the
>> kill-ring.
> The difference is what happens with numeric arguments.


I see.


>  Maybe that is what
> should be added to the backward-kill-line description.

I think that would be useful for that an similar commands. I found the
question asked on the web too.


>> 2. Default key sequences vs. emacs key bindings [the default].
>>
>> It is confusing to me that there are two defaults. Firstly, it can be read:
>>
>>     EDITING COMMANDS
>>            The  following  is  a list of the names of the commands and
>>     the default
>>            key sequences to which they are bound.  Command names without
>>     an accom‐
>>            panying key sequence are unbound by default.
>>
>> On the other hand, emacs editing command are default:
>>
>>     readline  offers  editing  capabilities  while the user is entering the
>>            line.  By default, the line editing commands are similar  to 
>>     those  of
>>            emacs.  A vi-style line editing interface is also available.
>>
>> An explicit list of emacs commands is maintained and commands do not
>> always coincide (both being valid defaults in practice). For example,
>> instead of C-x Rubout for backward-kill-line, emacs has
>>
>>              "C-XC-?"  backward-kill-line
> Rubout/DEL[ete]/C-? are the same key.

I see.


>> 3. Key-bindings in the emacs/vi list are written with capital letters
>> (C-A), but not in the section with the description (C-a).
> It's a writing convention. The behavior doesn't differ. Are there places
> where this convention is used inconsistently?
>
Convention is not followed strictly in the same document doc/readline.0,
but I suppose that it is intentional to keep a different convention in
the DEFAULT KEY BINDINGS (emacs and vi list) where uppercase is used,
and the rest of the document, where mainly lower case is used with very
few exceptions:

In SEARCHING:

    If that variable has not been assigned a value the Escape  and
    C-J characters will terminate an incremental search.  C-G will abort an
    incremental search and restore the original line.

In INITIALIZATION FILE -> Variables

       isearch-terminators (``C-[ C-J'')
              The string of characters that should  terminate  an 
incremental
              search  without  subsequently  executing the character as
a com‐
              mand.  If this variable has not been given a value, the 
charac‐
              ters ESC and C-J will terminate an incremental search.

Maybe a confusing part is Section "1.3.3 Sample Init File" of
doc/readline.info where there are lines like

         # Arrow keys in keypad mode
         #
         #"\M-OD":        backward-char


         #
         # Arrow keys in ANSI mode
         #
         "\M-[D":        backward-char

and

    "\C-xr": redraw-current-line

but in that case maybe it is not a convention but a parsing rule of
INITRC (?), I do not understand well the conventions in that section.

Regards,

Daniel



reply via email to

[Prev in Thread] Current Thread [Next in Thread]