-/* $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
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);
{ 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 },
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)
{
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);
-.\" $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
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