un-OS/2 (sorry)
no binary change
This commit is contained in:
52
emacs.c
52
emacs.c
@ -1,4 +1,4 @@
|
||||
/** $MirBSD: src/bin/ksh/emacs.c,v 2.1 2004/12/10 18:09:41 tg Exp $ */
|
||||
/** $MirBSD: src/bin/ksh/emacs.c,v 2.2 2004/12/13 19:05:09 tg Exp $ */
|
||||
/* $OpenBSD: emacs.c,v 1.28 2003/10/22 07:40:38 jmc Exp $ */
|
||||
|
||||
/*
|
||||
@ -19,7 +19,7 @@
|
||||
#include <locale.h>
|
||||
#include "edit.h"
|
||||
|
||||
__RCSID("$MirBSD: src/bin/ksh/emacs.c,v 2.1 2004/12/10 18:09:41 tg Exp $");
|
||||
__RCSID("$MirBSD: src/bin/ksh/emacs.c,v 2.2 2004/12/13 19:05:09 tg Exp $");
|
||||
|
||||
static Area aedit;
|
||||
#define AEDIT &aedit /* area for kill ring and macro defns */
|
||||
@ -59,17 +59,8 @@ struct x_defbindings {
|
||||
#define is_cfs(c) (c == ' ' || c == '\t' || c == '"' || c == '\'')
|
||||
#define is_mfs(c) (!(isalnum(c) || c == '_' || c == '$')) /* Separator for motion */
|
||||
|
||||
#ifdef OS2
|
||||
/* Deal with 8 bit chars & an extra prefix for function key (these two
|
||||
* changes increase memory usage from 9,216 bytes to 24,416 bytes...)
|
||||
*/
|
||||
# define CHARMASK 0xFF /* 8-bit ASCII character mask */
|
||||
# define X_NTABS 4 /* normal, meta1, meta2, meta3 */
|
||||
static int x_prefix3 = 0xE0;
|
||||
#else /* OS2 */
|
||||
# define CHARMASK 0xFF /* 8-bit character mask */
|
||||
# define X_NTABS 3 /* normal, meta1, meta2 */
|
||||
#endif /* OS2 */
|
||||
#define CHARMASK 0xFF /* 8-bit character mask */
|
||||
#define X_NTABS 3 /* normal, meta1, meta2 */
|
||||
#define X_TABSZ (CHARMASK+1) /* size of keydef tables etc */
|
||||
|
||||
/* Arguments for do_complete()
|
||||
@ -307,13 +298,6 @@ static struct x_defbindings const x_defbindings[] = {
|
||||
{ XFUNC_fold_lower, 1, 'l' },
|
||||
{ XFUNC_fold_capitalize, 1, 'C' },
|
||||
{ XFUNC_fold_capitalize, 1, 'c' },
|
||||
#ifdef OS2
|
||||
{ XFUNC_meta3, 0, 0xE0 },
|
||||
{ XFUNC_mv_back, 3, 'K' },
|
||||
{ XFUNC_mv_forw, 3, 'M' },
|
||||
{ XFUNC_next_com, 3, 'P' },
|
||||
{ XFUNC_prev_com, 3, 'H' },
|
||||
#endif /* OS2 */
|
||||
/* These for ansi arrow keys: arguablely shouldn't be here by
|
||||
* default, but its simpler/faster/smaller than using termcap
|
||||
* entries.
|
||||
@ -1168,15 +1152,6 @@ x_meta2(int c GCC_FUNC_ATTR(unused))
|
||||
return KSTD;
|
||||
}
|
||||
|
||||
#ifdef OS2
|
||||
static int
|
||||
x_meta3(int c GCC_FUNC_ATTR(unused))
|
||||
{
|
||||
x_curprefix = 3;
|
||||
return KSTD;
|
||||
}
|
||||
#endif /* OS2 */
|
||||
|
||||
static int
|
||||
x_kill(int c GCC_FUNC_ATTR(unused))
|
||||
{
|
||||
@ -1306,11 +1281,6 @@ x_mapin(const char *cp)
|
||||
/* XXX -- should handle \^ escape? */
|
||||
if (*cp == '^') {
|
||||
cp++;
|
||||
#ifdef OS2
|
||||
if (*cp == '0') /* To define function keys */
|
||||
*op++ = 0xE0;
|
||||
else
|
||||
#endif /* OS2 */
|
||||
if (*cp >= '?') /* includes '?'; ASCII */
|
||||
*op++ = CTRL(*cp);
|
||||
else {
|
||||
@ -1332,12 +1302,6 @@ x_mapout(int c GCC_FUNC_ATTR(unused))
|
||||
static char buf[8];
|
||||
char *p = buf;
|
||||
|
||||
#ifdef OS2
|
||||
if (c == 0xE0) {
|
||||
*p++ = '^';
|
||||
*p++ = '0';
|
||||
} else
|
||||
#endif /* OS2 */
|
||||
if (iscntrl(c)) {
|
||||
*p++ = '^';
|
||||
*p++ = UNCTRL(c);
|
||||
@ -1354,10 +1318,6 @@ x_print(int prefix, int key)
|
||||
shprintf("%s", x_mapout(x_prefix1));
|
||||
if (prefix == 2)
|
||||
shprintf("%s", x_mapout(x_prefix2));
|
||||
#ifdef OS2
|
||||
if (prefix == 3)
|
||||
shprintf("%s", x_mapout(x_prefix3));
|
||||
#endif /* OS2 */
|
||||
shprintf("%s = ", x_mapout(key));
|
||||
if (x_tab[prefix][key] != XFUNC_ins_string)
|
||||
shprintf("%s\n", x_ftab[x_tab[prefix][key]].xf_name);
|
||||
@ -1410,10 +1370,6 @@ x_bind(const char *a1, const char *a2, int macro, int list)
|
||||
prefix = 1;
|
||||
else if (x_tab[prefix][key] == XFUNC_meta2)
|
||||
prefix = 2;
|
||||
#ifdef OS2
|
||||
else if (x_tab[prefix][key] == XFUNC_meta3)
|
||||
prefix = 3;
|
||||
#endif /* OS2 */
|
||||
else
|
||||
break;
|
||||
}
|
||||
|
Reference in New Issue
Block a user