diff options
author | Jeremie Courreges-Anglas <jca@cvs.openbsd.org> | 2017-08-30 17:02:54 +0000 |
---|---|---|
committer | Jeremie Courreges-Anglas <jca@cvs.openbsd.org> | 2017-08-30 17:02:54 +0000 |
commit | dcae3930991f3cb19b6e03690681199c924ff8b2 (patch) | |
tree | a6be4a2bc9360c36130c5b8aac4389d877766bef | |
parent | eb6008d114557e9b5cbe1179679c7225ba68cd17 (diff) |
Stop exposing the emacs-usemeta option, and warn when trying to set it.
Unused since 2012, to be removed after 6.2. Input from anton@,
ok anton@ millert@
-rw-r--r-- | bin/ksh/emacs.c | 5 | ||||
-rw-r--r-- | bin/ksh/ksh.1 | 7 | ||||
-rw-r--r-- | bin/ksh/misc.c | 19 | ||||
-rw-r--r-- | bin/ksh/sh.h | 4 |
4 files changed, 19 insertions, 16 deletions
diff --git a/bin/ksh/emacs.c b/bin/ksh/emacs.c index a62bf819fa1..4da667bc6be 100644 --- a/bin/ksh/emacs.c +++ b/bin/ksh/emacs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: emacs.c,v 1.72 2017/08/30 16:59:23 jca Exp $ */ +/* $OpenBSD: emacs.c,v 1.73 2017/08/30 17:02:53 jca Exp $ */ /* * Emacs-like command line editing and history @@ -1452,9 +1452,6 @@ x_init_emacs(void) ainit(AEDIT); x_nextcmd = -1; - /* XXX unused */ - Flag(FEMACSUSEMETA) = 1; - TAILQ_INIT(&kblist); /* man page order */ diff --git a/bin/ksh/ksh.1 b/bin/ksh/ksh.1 index 654884c383f..23b9654bc67 100644 --- a/bin/ksh/ksh.1 +++ b/bin/ksh/ksh.1 @@ -1,8 +1,8 @@ -.\" $OpenBSD: ksh.1,v 1.193 2017/08/19 06:19:42 jmc Exp $ +.\" $OpenBSD: ksh.1,v 1.194 2017/08/30 17:02:53 jca Exp $ .\" .\" Public Domain .\" -.Dd $Mdocdate: August 19 2017 $ +.Dd $Mdocdate: August 30 2017 $ .Dt KSH 1 .Os .Sh NAME @@ -3587,9 +3587,6 @@ character. .It Ic emacs Enable BRL emacs-like command-line editing (interactive shells only); see .Sx Emacs editing mode . -.It Ic emacs-usemeta -In emacs command-line editing, use the 8th bit as meta (^[) prefix. -This is the default. .It Ic gmacs Enable gmacs-like command-line editing (interactive shells only). Currently identical to emacs editing except that transpose (^T) acts slightly diff --git a/bin/ksh/misc.c b/bin/ksh/misc.c index d4384c584c3..29f2bd1e10d 100644 --- a/bin/ksh/misc.c +++ b/bin/ksh/misc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: misc.c,v 1.57 2017/07/04 11:46:15 anton Exp $ */ +/* $OpenBSD: misc.c,v 1.58 2017/08/30 17:02:53 jca Exp $ */ /* * Miscellaneous functions @@ -129,7 +129,7 @@ const struct option options[] = { { "csh-history", 0, OF_ANY }, /* non-standard */ #ifdef EMACS { "emacs", 0, OF_ANY }, - { "emacs-usemeta", 0, OF_ANY }, /* non-standard */ + { "emacs-usemeta", 0, OF_ANY }, /* XXX delete after 6.2 */ #endif { "errexit", 'e', OF_ANY }, #ifdef EMACS @@ -185,8 +185,11 @@ option(const char *n) int i; for (i = 0; i < NELEM(options); i++) - if (options[i].name && strcmp(options[i].name, n) == 0) + if (options[i].name && strcmp(options[i].name, n) == 0) { + if (i == FEMACSUSEMETA) + warningf(true, "%s: deprecated option", n); return i; + } return -1; } @@ -226,7 +229,9 @@ printoptions(int verbose) /* verbose version */ shprintf("Current option settings\n"); - for (i = n = oi.opt_width = 0; i < NELEM(options); i++) + for (i = n = oi.opt_width = 0; i < NELEM(options); i++) { + if (i == FEMACSUSEMETA) + continue; if (options[i].name) { len = strlen(options[i].name); oi.opts[n].name = options[i].name; @@ -234,16 +239,20 @@ printoptions(int verbose) if (len > oi.opt_width) oi.opt_width = len; } + } print_columns(shl_stdout, n, options_fmt_entry, &oi, oi.opt_width + 5, 1); } else { /* short version ala ksh93 */ shprintf("set"); - for (i = 0; i < NELEM(options); i++) + for (i = 0; i < NELEM(options); i++) { + if (i == FEMACSUSEMETA) + continue; if (options[i].name) shprintf(" %co %s", Flag(i) ? '-' : '+', options[i].name); + } shprintf("\n"); } } diff --git a/bin/ksh/sh.h b/bin/ksh/sh.h index 51923961cff..b2b5164b887 100644 --- a/bin/ksh/sh.h +++ b/bin/ksh/sh.h @@ -1,4 +1,4 @@ -/* $OpenBSD: sh.h,v 1.61 2017/07/04 11:46:15 anton Exp $ */ +/* $OpenBSD: sh.h,v 1.62 2017/08/30 17:02:53 jca Exp $ */ /* * Public Domain Bourne/Korn shell @@ -139,7 +139,7 @@ enum sh_flag { FCSHHISTORY, /* csh-style history enabled */ #ifdef EMACS FEMACS, /* emacs command editing */ - FEMACSUSEMETA, /* use 8th bit as meta */ + FEMACSUSEMETA, /* XXX delete after 6.2 */ #endif FERREXIT, /* -e: quit on error */ #ifdef EMACS |