Hi, While writing tests for the Emacs editing mode in ksh I discovered some potential errors in the manual:
- Sync the order of key bindings in emacs.c with the manual - ^W is bound to delete-word-backward and not kill-region which is mentioned in emacs.c. I don't know the full history here... - Add missing '^' in backward-char binding - The WERASE control character is also bound to delete-word-backward, see x_emacs_keys(). - Rephrase delete-word-forward to match the other bindings - Move kill-region to a separate list of commands without default bindings Comments? OK? Index: emacs.c =================================================================== RCS file: /cvs/src/bin/ksh/emacs.c,v retrieving revision 1.73 diff -u -p -r1.73 emacs.c --- emacs.c 30 Aug 2017 17:02:53 -0000 1.73 +++ emacs.c 21 Nov 2017 19:28:44 -0000 @@ -1472,6 +1472,7 @@ x_init_emacs(void) kb_add(x_del_back, NULL, CTRL('?'), 0); kb_add(x_del_back, NULL, CTRL('H'), 0); kb_add(x_del_char, NULL, CTRL('['), '[', '3', '~', 0); /* delete */ + kb_add(x_del_bword, NULL, CTRL('W'), 0); kb_add(x_del_bword, NULL, CTRL('['), CTRL('?'), 0); kb_add(x_del_bword, NULL, CTRL('['), CTRL('H'), 0); kb_add(x_del_bword, NULL, CTRL('['), 'h', 0); @@ -1493,7 +1494,6 @@ x_init_emacs(void) kb_add(x_mv_fword, NULL, CTRL('['), 'f', 0); kb_add(x_goto_hist, NULL, CTRL('['), 'g', 0); /* kill-line */ - kb_add(x_del_bword, NULL, CTRL('W'), 0); /* not what man says */ kb_add(x_kill, NULL, CTRL('K'), 0); kb_add(x_enumerate, NULL, CTRL('['), '?', 0); kb_add(x_list_comm, NULL, CTRL('X'), '?', 0); @@ -1505,6 +1505,7 @@ x_init_emacs(void) kb_add(x_prev_histword, NULL, CTRL('['), '.', 0); kb_add(x_prev_histword, NULL, CTRL('['), '_', 0); /* how to handle: quote: ^^ */ + kb_add(x_literal, NULL, CTRL('^'), 0); kb_add(x_draw_line, NULL, CTRL('L'), 0); kb_add(x_search_char_back, NULL, CTRL('['), CTRL(']'), 0); kb_add(x_search_char_forw, NULL, CTRL(']'), 0); @@ -1516,7 +1517,6 @@ x_init_emacs(void) kb_add(x_fold_upper, NULL, CTRL('['), 'U', 0); kb_add(x_fold_upper, NULL, CTRL('['), 'u', 0); kb_add(x_literal, NULL, CTRL('V'), 0); - kb_add(x_literal, NULL, CTRL('^'), 0); kb_add(x_yank, NULL, CTRL('Y'), 0); kb_add(x_meta_yank, NULL, CTRL('['), 'y', 0); /* man page ends here */ Index: ksh.1 =================================================================== RCS file: /cvs/src/bin/ksh/ksh.1,v retrieving revision 1.195 diff -u -p -r1.195 ksh.1 --- ksh.1 30 Aug 2017 17:08:45 -0000 1.195 +++ ksh.1 21 Nov 2017 19:28:45 -0000 @@ -4656,7 +4656,7 @@ Simply causes the character to appear as Most ordinary characters are bound to this. .It Xo backward-char: .Op Ar n -.No ^B , ^XD +.No ^B , ^X^D .Xc Moves the cursor backward .Ar n @@ -4749,7 +4749,7 @@ Deletes characters after the cursor. .It Xo delete-word-backward: .Op Ar n -.No ERASE , ^[^? , ^[^H , ^[h +.No WERASE , ^[ERASE , ^W, ^[^? , ^[^H , ^[h .Xc Deletes .Ar n @@ -4758,9 +4758,9 @@ words before the cursor. .Op Ar n .No ^[d .Xc -Deletes characters after the cursor up to the end of +Deletes .Ar n -words. +words after the cursor. .It Xo down-history: .Op Ar n .No ^N , ^XB @@ -4830,8 +4830,6 @@ Goes to history number .Ar n . .It kill-line: KILL Deletes the entire input line. -.It kill-region: ^W -Deletes the input between the cursor and the mark. .It Xo kill-to-eol: .Op Ar n .No ^K @@ -4937,6 +4935,14 @@ Inserts the most recently killed text st Immediately after a .Ic yank , replaces the inserted text string with the next previously killed text string. +.El +.Pp +The following editing commands lack default bindings but can be used with the +.Ic bind +command: +.Bl -tag -width Ds +.It kill-region +Deletes the input between the cursor and the mark. .El .Ss Vi editing mode The vi command-line editor in