From a548fed7bdd8d2a896e1f280173d0b68d869c752 Mon Sep 17 00:00:00 2001 From: bostic Date: Wed, 22 Dec 1993 16:13:58 +0000 Subject: [PATCH] move the abbreviation flag to the global structure --- common/gs.h | 29 +++++++++++++++-------------- common/screen.h | 39 +++++++++++++++++++-------------------- ex/ex_abbrev.c | 6 +++--- 3 files changed, 37 insertions(+), 37 deletions(-) diff --git a/common/gs.h b/common/gs.h index 19ab53bb..933c337d 100644 --- a/common/gs.h +++ b/common/gs.h @@ -4,7 +4,7 @@ * * %sccs.include.redist.c% * - * $Id: gs.h,v 8.24 1993/11/29 20:02:01 bostic Exp $ (Berkeley) $Date: 1993/11/29 20:02:01 $ + * $Id: gs.h,v 8.25 1993/12/22 16:13:58 bostic Exp $ (Berkeley) $Date: 1993/12/22 16:13:58 $ */ struct _gs { @@ -43,19 +43,20 @@ struct _gs { u_char *special_key; /* Fast lookup table. */ CHNAME const *cname; /* Display names of ASCII characters. */ -#define G_BELLSCHED 0x00001 /* Bell scheduled. */ -#define G_CURSES_INIT 0x00002 /* Curses: initialized. */ -#define G_CURSES_S5CB 0x00004 /* Curses: s5_curses_botch set. */ -#define G_ISFROMTTY 0x00008 /* Reading from a tty. */ -#define G_RECOVER_SET 0x00010 /* Recover system initialized. */ -#define G_SETMODE 0x00020 /* Tty mode changed. */ -#define G_SIGALRM 0x00040 /* SIGALRM arrived. */ -#define G_SIGHUP 0x00080 /* SIGHUP arrived. */ -#define G_SIGTERM 0x00100 /* SIGTERM arrived. */ -#define G_SIGWINCH 0x00200 /* SIGWINCH arrived. */ -#define G_SLEEPING 0x00400 /* Asleep (die on signal). */ -#define G_SNAPSHOT 0x00800 /* Always snapshot files. */ -#define G_TMP_INUSE 0x01000 /* Temporary buffer in use. */ +#define G_ABBREV 0x00001 /* If have abbreviations. */ +#define G_BELLSCHED 0x00002 /* Bell scheduled. */ +#define G_CURSES_INIT 0x00004 /* Curses: initialized. */ +#define G_CURSES_S5CB 0x00008 /* Curses: s5_curses_botch set. */ +#define G_ISFROMTTY 0x00010 /* Reading from a tty. */ +#define G_RECOVER_SET 0x00020 /* Recover system initialized. */ +#define G_SETMODE 0x00040 /* Tty mode changed. */ +#define G_SIGALRM 0x00080 /* SIGALRM arrived. */ +#define G_SIGHUP 0x00100 /* SIGHUP arrived. */ +#define G_SIGTERM 0x00200 /* SIGTERM arrived. */ +#define G_SIGWINCH 0x00400 /* SIGWINCH arrived. */ +#define G_SLEEPING 0x00800 /* Asleep (die on signal). */ +#define G_SNAPSHOT 0x01000 /* Always snapshot files. */ +#define G_TMP_INUSE 0x02000 /* Temporary buffer in use. */ u_int flags; }; diff --git a/common/screen.h b/common/screen.h index e33e3bce..936ed894 100644 --- a/common/screen.h +++ b/common/screen.h @@ -4,7 +4,7 @@ * * %sccs.include.redist.c% * - * $Id: screen.h,v 8.79 1993/12/22 15:10:25 bostic Exp $ (Berkeley) $Date: 1993/12/22 15:10:25 $ + * $Id: screen.h,v 8.80 1993/12/22 16:14:30 bostic Exp $ (Berkeley) $Date: 1993/12/22 16:14:30 $ */ /* @@ -246,25 +246,24 @@ struct _scr { #define S_MAJOR_CHANGE /* Screen or file changes. */ \ (S_EXIT | S_EXIT_FORCE | S_FSWITCH | S_SSWITCH) -#define S_ABBREV 0x0000080 /* If have abbreviations. */ -#define S_AUTOPRINT 0x0000100 /* Autoprint flag. */ -#define S_BELLSCHED 0x0000200 /* Bell scheduled. */ -#define S_CONTINUE 0x0000400 /* Need to ask the user to continue. */ -#define S_EXSILENT 0x0000800 /* Ex batch script. */ -#define S_GLOBAL 0x0001000 /* Doing a global command. */ -#define S_INPUT 0x0002000 /* Doing text input. */ -#define S_INTERRUPTED 0x0004000 /* If have been interrupted. */ -#define S_INTERRUPTIBLE 0x0008000 /* If can be interrupted. */ -#define S_REDRAW 0x0010000 /* Redraw the screen. */ -#define S_REFORMAT 0x0020000 /* Reformat the screen. */ -#define S_REFRESH 0x0040000 /* Refresh the screen. */ -#define S_RENUMBER 0x0080000 /* Renumber the screen. */ -#define S_RESIZE 0x0100000 /* Resize the screen. */ -#define S_SCRIPT 0x0200000 /* Window is a shell script. */ -#define S_SRE_SET 0x0400000 /* The search RE has been set. */ -#define S_SUBRE_SET 0x0800000 /* The substitute RE has been set. */ -#define S_TIMER_SET 0x1000000 /* If a busy timer is running. */ -#define S_UPDATE_MODE 0x2000000 /* Don't repaint modeline. */ +#define S_AUTOPRINT 0x0000080 /* Autoprint flag. */ +#define S_BELLSCHED 0x0000100 /* Bell scheduled. */ +#define S_CONTINUE 0x0000200 /* Need to ask the user to continue. */ +#define S_EXSILENT 0x0000400 /* Ex batch script. */ +#define S_GLOBAL 0x0000800 /* Doing a global command. */ +#define S_INPUT 0x0001000 /* Doing text input. */ +#define S_INTERRUPTED 0x0002000 /* If have been interrupted. */ +#define S_INTERRUPTIBLE 0x0004000 /* If can be interrupted. */ +#define S_REDRAW 0x0008000 /* Redraw the screen. */ +#define S_REFORMAT 0x0010000 /* Reformat the screen. */ +#define S_REFRESH 0x0020000 /* Refresh the screen. */ +#define S_RENUMBER 0x0040000 /* Renumber the screen. */ +#define S_RESIZE 0x0080000 /* Resize the screen. */ +#define S_SCRIPT 0x0100000 /* Window is a shell script. */ +#define S_SRE_SET 0x0200000 /* The search RE has been set. */ +#define S_SUBRE_SET 0x0400000 /* The substitute RE has been set. */ +#define S_TIMER_SET 0x0800000 /* If a busy timer is running. */ +#define S_UPDATE_MODE 0x1000000 /* Don't repaint modeline. */ u_int flags; }; diff --git a/ex/ex_abbrev.c b/ex/ex_abbrev.c index e3f5b29f..7184dc44 100644 --- a/ex/ex_abbrev.c +++ b/ex/ex_abbrev.c @@ -6,7 +6,7 @@ */ #ifndef lint -static char sccsid[] = "$Id: ex_abbrev.c,v 8.5 1993/12/02 10:48:42 bostic Exp $ (Berkeley) $Date: 1993/12/02 10:48:42 $"; +static char sccsid[] = "$Id: ex_abbrev.c,v 8.6 1993/12/22 16:15:15 bostic Exp $ (Berkeley) $Date: 1993/12/22 16:15:15 $"; #endif /* not lint */ #include @@ -41,7 +41,7 @@ ex_abbr(sp, ep, cmdp) if (seq_set(sp, NULL, 0, cmdp->argv[0]->bp, cmdp->argv[0]->len, cmdp->argv[1]->bp, cmdp->argv[1]->len, SEQ_ABBREV, 1)) return (1); - F_SET(sp, S_ABBREV); + F_SET(sp->gp, G_ABBREV); return (0); } @@ -58,7 +58,7 @@ ex_unabbr(sp, ep, cmdp) ARGS *ap; ap = cmdp->argv[0]; - if (!F_ISSET(sp, S_ABBREV) || + if (!F_ISSET(sp->gp, G_ABBREV) || seq_delete(sp, ap->bp, ap->len, SEQ_ABBREV)) { msgq(sp, M_ERR, "\"%s\" is not an abbreviation.", ap->bp); return (1); -- 2.11.4.GIT