From: brynet Date: Tue, 20 Jun 2017 17:32:20 +0000 (+0000) Subject: '^T' is documented to be bounded to transpose-chars while in emacs X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=ceb1b38682f692d1ac9a398a1677c6d1e85279e7;p=openbsd '^T' is documented to be bounded to transpose-chars while in emacs mode, not "stuff". While here, remove the poorly described "stuff" and "stuff" bind functions as well.. In the unlikely event anyone has those in .kshrc, they'll need to be removed. ok anton@ --- diff --git a/bin/ksh/emacs.c b/bin/ksh/emacs.c index 3c728ad8f68..77be6651839 100644 --- a/bin/ksh/emacs.c +++ b/bin/ksh/emacs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: emacs.c,v 1.67 2017/05/12 14:37:52 schwarze Exp $ */ +/* $OpenBSD: emacs.c,v 1.68 2017/06/20 17:32:20 brynet Exp $ */ /* * Emacs-like command line editing and history @@ -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); diff --git a/bin/ksh/ksh.1 b/bin/ksh/ksh.1 index 77954a5dd32..bf260d1bc83 100644 --- a/bin/ksh/ksh.1 +++ b/bin/ksh/ksh.1 @@ -1,8 +1,8 @@ -.\" $OpenBSD: ksh.1,v 1.187 2017/02/19 22:09:18 schwarze Exp $ +.\" $OpenBSD: ksh.1,v 1.188 2017/06/20 17:32:20 brynet Exp $ .\" .\" Public Domain .\" -.Dd $Mdocdate: February 19 2017 $ +.Dd $Mdocdate: June 20 2017 $ .Dt KSH 1 .Os .Sh NAME @@ -4912,14 +4912,6 @@ The history buffer retains only a finite number of lines; the oldest 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