In ksh(1), ^T is documented to be bounded to transpose-chars while
in emacs mode, not "x_stuff". While here, remove these poorly
described functions as well..

-Bryan.

Index: emacs.c
===================================================================
RCS file: /cvs/src/bin/ksh/emacs.c,v
retrieving revision 1.67
diff -u -p -u -r1.67 emacs.c
--- emacs.c     12 May 2017 14:37:52 -0000      1.67
+++ emacs.c     20 Jun 2017 16:50:11 -0000
@@ -185,8 +185,6 @@ static int  x_search_char_forw(int);
 static int     x_search_char_back(int);
 static int     x_search_hist(int);
 static int     x_set_mark(int);
-static int     x_stuff(int);
-static int     x_stuffreset(int);
 static int     x_transpose(int);
 static int     x_version(int);
 static int     x_xchg_point_mark(int);
@@ -244,8 +242,6 @@ static const struct x_ftab x_ftab[] = {
        { x_search_char_back,   "search-character-backward",    XF_ARG },
        { x_search_hist,        "search-history",               0 },
        { x_set_mark,           "set-mark-command",             0 },
-       { x_stuff,              "stuff",                        0 },
-       { x_stuffreset,         "stuff-reset",                  0 },
        { x_transpose,          "transpose-chars",              0 },
        { x_version,            "version",                      0 },
        { x_xchg_point_mark,    "exchange-point-and-mark",      0 },
@@ -1227,36 +1223,6 @@ x_error(int c)
        return KSTD;
 }
 
-static int
-x_stuffreset(int c)
-{
-#ifdef TIOCSTI
-       (void)x_stuff(c);
-       return KINTR;
-#else
-       x_zotc(c);
-       xlp = xcp = xep = xbp = xbuf;
-       xlp_valid = true;
-       *xcp = 0;
-       x_redraw(-1);
-       return KSTD;
-#endif
-}
-
-static int
-x_stuff(int c)
-{
-#ifdef TIOCSTI
-       char    ch = c;
-       bool    savmode = x_mode(false);
-
-       (void)ioctl(TTY, TIOCSTI, &ch);
-       (void)x_mode(savmode);
-       x_redraw(-1);
-#endif
-       return KSTD;
-}
-
 static char *
 kb_encode(const char *s)
 {
@@ -1555,12 +1521,7 @@ x_init_emacs(void)
        kb_add(x_search_char_forw,      NULL, CTRL(']'), 0);
        kb_add(x_search_hist,           NULL, CTRL('R'), 0);
        kb_add(x_set_mark,              NULL, CTRL('['), ' ', 0);
-#if defined(TIOCSTI)
-       kb_add(x_stuff,                 NULL, CTRL('T'), 0);
-       /* stuff-reset */
-#else
        kb_add(x_transpose,             NULL, CTRL('T'), 0);
-#endif
        kb_add(x_prev_com,              NULL, CTRL('P'), 0);
        kb_add(x_prev_com,              NULL, CTRL('X'), 'A', 0);
        kb_add(x_fold_upper,            NULL, CTRL('['), 'U', 0);
Index: ksh.1
===================================================================
RCS file: /cvs/src/bin/ksh/ksh.1,v
retrieving revision 1.187
diff -u -p -u -r1.187 ksh.1
--- ksh.1       19 Feb 2017 22:09:18 -0000      1.187
+++ ksh.1       20 Jun 2017 16:50:11 -0000
@@ -4912,14 +4912,6 @@ The history buffer retains only a finite
 are discarded as necessary.
 .It set-mark-command: ^[ Ns Aq space
 Set the mark at the cursor position.
-.It stuff:
-On systems supporting it, pushes the bound character back onto the terminal
-input where it may receive special processing by the terminal handler.
-This is useful for the BRL ^T mini-systat feature, for example.
-.It stuff-reset:
-Acts like
-.Ic stuff ,
-then aborts input the same as an interrupt.
 .It transpose-chars: ^T
 If at the end of line, or if the
 .Ic gmacs

Reply via email to