home *** CD-ROM | disk | FTP | other *** search
Text File | 1987-09-15 | 50.5 KB | 2,335 lines |
- diff -c ojove/Makefile jove/Makefile
- *** ojove/Makefile Thu Jul 16 09:14:01 1987
- --- jove/Makefile Fri Jun 19 16:13:05 1987
- ***************
- *** 19,44 ****
-
- DESTDIR =
- TMPDIR = /tmp
- ! LIBDIR = /u/jpayne/jovelib
- ! BINDIR = /u/jpayne/bin
- ! MANDIR = /u/jpayne/manl
- MANEXT = l
- SHELL = /bin/csh
-
- # These should all just be right if the above ones are.
- JOVE = $(DESTDIR)$(BINDIR)/jove
- - RECOVER = $(DESTDIR)$(LIBDIR)/recover
- TEACHJOVE = $(DESTDIR)$(BINDIR)/teachjove
- JOVERC = $(DESTDIR)$(LIBDIR)/.joverc
- CMDS.DOC = $(DESTDIR)$(LIBDIR)/cmds.doc
- TEACH-JOVE = $(DESTDIR)$(LIBDIR)/teach-jove
- - PORTSRV = $(DESTDIR)$(LIBDIR)/portsrv
- JOVEM = $(DESTDIR)$(MANDIR)/jove.$(MANEXT)
- - RECOVERM = $(DESTDIR)$(MANDIR)/recover.$(MANEXT)
- TEACHJOVEM = $(DESTDIR)$(MANDIR)/teachjove.$(MANEXT)
-
- # Select the right libraries for your system.
- ! # 2.9BSD: LIBS = -ltermcap -ljobs
- # v7: LIBS = -ltermcap
- # 4.1BSD: LIBS = -ltermcap -ljobs
- # 4.2BSD: LIBS = -ltermcap
- --- 19,43 ----
-
- DESTDIR =
- TMPDIR = /tmp
- ! LIBDIR = /nfs/socrates/usr/jpayne/jovelib
- ! BINDIR = /nfs/socrates/usr/jpayne/bin
- ! MANDIR = /nfs/socrates/usr/jpayne/manl
- MANEXT = l
- SHELL = /bin/csh
-
- # These should all just be right if the above ones are.
- JOVE = $(DESTDIR)$(BINDIR)/jove
- TEACHJOVE = $(DESTDIR)$(BINDIR)/teachjove
- + RECOVER = $(DESTDIR)$(LIBDIR)/recover
- + PORTSRV = $(DESTDIR)$(LIBDIR)/portsrv
- JOVERC = $(DESTDIR)$(LIBDIR)/.joverc
- CMDS.DOC = $(DESTDIR)$(LIBDIR)/cmds.doc
- TEACH-JOVE = $(DESTDIR)$(LIBDIR)/teach-jove
- JOVEM = $(DESTDIR)$(MANDIR)/jove.$(MANEXT)
- TEACHJOVEM = $(DESTDIR)$(MANDIR)/teachjove.$(MANEXT)
-
- # Select the right libraries for your system.
- ! # 2.10BSD:LIBS = -ltermcap
- # v7: LIBS = -ltermcap
- # 4.1BSD: LIBS = -ltermcap -ljobs
- # 4.2BSD: LIBS = -ltermcap
- ***************
- *** 49,71 ****
-
- # If you are not VMUNIX (vax running Berkeley Version 4), you must specify
- # the -i flags (split I/D space) and maybe the -x option (for adb to work).
- ! # 2.9BSD: LDFLAGS = -x -i
- ! # v7: LDFLAGS = -x -i
- # 4.1BSD: LDFLAGS =
- # 4.2BSD: LDFLAGS =
- # 4.3BSD: LDFLAGS =
- # SysV Rel. 2: LDFLAGS = -Ml
-
- ! LDFLAGS =
-
- ! CFLAGS = -O
-
- ! OBJECTS = keymaps.o funcdefs.o abbrev.o ask.o buf.o c.o case.o ctype.o \
- ! delete.o disp.o extend.o fp.o fmt.o insert.o io.o iproc.o jove.o macros.o \
- ! malloc.o marks.o misc.o move.o paragraph.o proc.o re.o re1.o rec.o \
- ! scandir.o screen.o table.o term.o tune.o util.o vars.o version.o wind.o
-
- ! JOVESRC = funcdefs.c abbrev.c ask.c buf.c c.c case.c ctype.c \
- delete.c disp.c extend.c fp.c fmt.c insert.c io.c iproc.c \
- jove.c macros.c malloc.c marks.c misc.c move.c paragraph.c \
- proc.c re.c re1.c rec.c scandir.c screen.c table.c term.c util.c \
- --- 48,82 ----
-
- # If you are not VMUNIX (vax running Berkeley Version 4), you must specify
- # the -i flags (split I/D space) and maybe the -x option (for adb to work).
- ! # 2.10BSD:LDFLAGS =
- ! # v7: LDFLAGS =
- # 4.1BSD: LDFLAGS =
- # 4.2BSD: LDFLAGS =
- # 4.3BSD: LDFLAGS =
- # SysV Rel. 2: LDFLAGS = -Ml
- + #
- + # SEPFLAG should be:
- + # not on a PDP-11: SEPFLAG =
- + # PDP-11 with separate I&D: SEPFLAG = -i
- + # PDP-11 without separate I&D: SEPFLAG = -n
-
- ! LDFLAGS = -g
- ! SEPFLAG =
-
- ! CFLAGS = -g
-
- ! BASESEG = funcdefs.o keymaps.o argcount.o ask.o buf.o ctype.o delete.o \
- ! disp.o fmt.o insert.o io.o jove.o malloc.o marks.o misc.o re.o \
- ! screen.o table.o tune.o util.o vars.o version.o
- ! OVLAY1 = abbrev.o rec.o paragraph.o
- ! OVLAY2 = c.o wind.o fp.o move.o
- ! OVLAY3 = extend.o macros.o
- ! OVLAY4 = iproc.o re1.o
- ! OVLAY5 = proc.o scandir.o term.o case.o
-
- ! OBJECTS = $(BASESEG) $(OVLAY1) $(OVLAY2) $(OVLAY3) $(OVLAY4) $(OVLAY5)
- !
- ! JOVESRC = funcdefs.c abbrev.c argcount.c ask.c buf.c c.c case.c ctype.c \
- delete.c disp.c extend.c fp.c fmt.c insert.c io.c iproc.c \
- jove.c macros.c malloc.c marks.c misc.c move.c paragraph.c \
- proc.c re.c re1.c rec.c scandir.c screen.c table.c term.c util.c \
- ***************
- *** 76,83 ****
- HEADERS = ctype.h io.h jove.h re.h rec.h table.h temp.h termcap.h tune.h
-
- DOCS = doc/cmds.doc.nr doc/example.rc doc/jove.1 doc/jove.2 doc/jove.3 \
- ! doc/jove.4 doc/jove.nr doc/recover.nr doc/system.rc doc/teach-jove \
- ! doc/teachjove.nr doc/README
-
- BACKUPS = $(HEADERS) $(JOVESRC) iproc-pipes.c iproc-ptys.c \
- teachjove.c recover.c setmaps.c portsrv.c tune.template \
- --- 87,94 ----
- HEADERS = ctype.h io.h jove.h re.h rec.h table.h temp.h termcap.h tune.h
-
- DOCS = doc/cmds.doc.nr doc/example.rc doc/jove.1 doc/jove.2 doc/jove.3 \
- ! doc/jove.4 doc/jove.5 doc/jove.nr doc/system.rc \
- ! doc/teach-jove doc/teachjove.nr doc/README
-
- BACKUPS = $(HEADERS) $(JOVESRC) iproc-pipes.c iproc-ptys.c \
- teachjove.c recover.c setmaps.c portsrv.c tune.template \
- ***************
- *** 87,93 ****
- all: xjove recover teachjove portsrv
-
- xjove: $(OBJECTS)
- ! $(CC) $(LDFLAGS) -o xjove $(OBJECTS) version.o $(LIBS)
- @-size xjove
- @-date
-
- --- 98,104 ----
- all: xjove recover teachjove portsrv
-
- xjove: $(OBJECTS)
- ! $(CC) $(LDFLAGS) -o xjove $(OBJECTS) $(LIBS);
- @-size xjove
- @-date
-
- ***************
- *** 131,138 ****
- $(TEACH-JOVE): doc/teach-jove
- install -c -m 644 doc/teach-jove $(TEACH-JOVE)
-
- ! doc/cmds.doc: doc/cmds.doc.nr doc/jove.4
- ! nroff doc/cmds.doc.nr doc/jove.4 > doc/cmds.doc
-
- $(CMDS.DOC): doc/cmds.doc
- install -c -m 644 doc/cmds.doc $(CMDS.DOC)
- --- 142,149 ----
- $(TEACH-JOVE): doc/teach-jove
- install -c -m 644 doc/teach-jove $(TEACH-JOVE)
-
- ! doc/cmds.doc: doc/cmds.doc.nr doc/jove.4 doc/jove.5
- ! nroff doc/cmds.doc.nr doc/jove.4 doc/jove.5 > doc/cmds.doc
-
- $(CMDS.DOC): doc/cmds.doc
- install -c -m 644 doc/cmds.doc $(CMDS.DOC)
- ***************
- *** 158,169 ****
- -e 's;SHELL;$(SHELL);' doc/jove.nr > /tmp/jove.nr
- install -m 644 /tmp/jove.nr $(JOVEM)
-
- - $(RECOVERM): doc/recover.nr
- - @sed -e 's;TMPDIR;$(TMPDIR);' \
- - -e 's;LIBDIR;$(LIBDIR);' \
- - -e 's;SHELL;$(SHELL);' doc/recover.nr > /tmp/recover.nr
- - install -m 644 /tmp/recover.nr $(RECOVERM)
- -
- $(TEACHJOVEM): doc/teachjove.nr
- @sed -e 's;TMPDIR;$(TMPDIR);' \
- -e 's;LIBDIR;$(LIBDIR);' \
- --- 169,174 ----
- ***************
- *** 178,184 ****
- @echo Done
-
- tags:
- ! ctags -w $(JOVESRC) $(HEADERS)
-
- ciall:
- ci $(BACKUPS)
- --- 183,189 ----
- @echo Done
-
- tags:
- ! ctags -w $(JOVESRC) $(HEADERS) iproc-ptys.c
-
- ciall:
- ci $(BACKUPS)
- ***************
- *** 189,195 ****
- jove.shar:
- shar $(BACKUPS) > jove.shar
-
- ! backup:
- tar cf backup $(BACKUPS)
-
- tape-backup:
- --- 194,200 ----
- jove.shar:
- shar $(BACKUPS) > jove.shar
-
- ! backup: $(BACKUPS)
- tar cf backup $(BACKUPS)
-
- tape-backup:
- diff -c ojove/Ovmakefile jove/Ovmakefile
- *** ojove/Ovmakefile Thu Jul 16 09:14:02 1987
- --- jove/Ovmakefile Fri Jun 12 11:23:45 1987
- ***************
- *** 61,71 ****
-
- COFLAGS = -rworking -q
-
- ! BASESEG = funcdefs.o keymaps.o ask.o buf.o ctype.o delete.o disp.o fmt.o fp.o \
- ! insert.o io.o jove.o malloc.o macros.o marks.o misc.o move.o re.o \
- ! screen.o table.o tune.o util.o vars.o version.o
- ! OVLAY1 = abbrev.o rec.o paragraph.o
- ! OVLAY2 = c.o wind.o
- OVLAY3 = extend.o
- OVLAY4 = iproc.o re1.o
- OVLAY5 = proc.o scandir.o term.o case.o
- --- 61,71 ----
-
- COFLAGS = -rworking -q
-
- ! BASESEG = funcdefs.o keymaps.o argcount.o ask.o buf.o ctype.o delete.o disp.o fmt.o fp.o \
- ! insert.o io.o jove.o malloc.o marks.o misc.o move.o re.o \
- ! screen.o table.o tune.o util.o version.o
- ! OVLAY1 = abbrev.o rec.o paragraph.o macros.o
- ! OVLAY2 = c.o wind.o vars.o
- OVLAY3 = extend.o
- OVLAY4 = iproc.o re1.o
- OVLAY5 = proc.o scandir.o term.o case.o
- ***************
- *** 72,78 ****
-
- OBJECTS = $(BASESEG) $(OVLAY1) $(OVLAY2) $(OVLAY3) $(OVLAY4) $(OVLAY5)
-
- ! C-FILES = funcdefs.c abbrev.c ask.c buf.c c.c case.c ctype.c delete.c disp.c \
- extend.c fmt.c fp.c insert.c io.c iproc.c iproc-pipes.c iproc-ptys.c \
- jove.c macros.c malloc.c marks.c misc.c move.c paragraph.c proc.c \
- re.c re1.c rec.c scandir.c screen.c table.c term.c util.c vars.c version.c \
- --- 72,78 ----
-
- OBJECTS = $(BASESEG) $(OVLAY1) $(OVLAY2) $(OVLAY3) $(OVLAY4) $(OVLAY5)
-
- ! C-FILES = funcdefs.c abbrev.c argcount.c ask.c buf.c c.c case.c ctype.c delete.c disp.c \
- extend.c fmt.c fp.c insert.c io.c iproc.c iproc-pipes.c iproc-ptys.c \
- jove.c macros.c malloc.c marks.c misc.c move.c paragraph.c proc.c \
- re.c re1.c rec.c scandir.c screen.c table.c term.c util.c vars.c version.c \
- Common subdirectories: ojove/RCS and jove/RCS
- diff -c ojove/README jove/README
- *** ojove/README Thu Jul 16 09:14:03 1987
- --- jove/README Fri Feb 6 11:32:32 1987
- ***************
- *** 146,152 ****
- reads an initialization file in the user's home directory, and "example.rc"
- is mine.
-
- ! The files "jove.[1234]" in DOC are the official JOVE manual. I got
- permission from Richard Stallman to use his manual for the original EMACS,
- modifying it where necessary for JOVE. Lots of work was done by Brian
- Harvey on this manual.
- --- 146,152 ----
- reads an initialization file in the user's home directory, and "example.rc"
- is mine.
-
- ! The files "jove.[12345]" in DOC are the official JOVE manual. I got
- permission from Richard Stallman to use his manual for the original EMACS,
- modifying it where necessary for JOVE. Lots of work was done by Brian
- Harvey on this manual.
- diff -c ojove/abbrev.c jove/abbrev.c
- *** ojove/abbrev.c Thu Jul 16 09:14:04 1987
- --- jove/abbrev.c Fri Jun 12 10:50:08 1987
- ***************
- *** 102,110 ****
- struct abbrev *ap;
-
- DOTsave(&point);
- - exp = 1;
- WITH_TABLE(curbuf->b_major)
- ! BackWord();
- while (curchar < point.p_char && ismword(c = linebuf[curchar])) {
- if (AutoCaseAbbrev) {
- if (isupper(c)) {
- --- 102,109 ----
- struct abbrev *ap;
-
- DOTsave(&point);
- WITH_TABLE(curbuf->b_major)
- ! b_word(1);
- while (curchar < point.p_char && ismword(c = linebuf[curchar])) {
- if (AutoCaseAbbrev) {
- if (isupper(c)) {
- ***************
- *** 112,118 ****
- c = tolower(c);
- }
- }
- -
- *wp++ = c;
- curchar++;
- }
- --- 111,116 ----
- ***************
- *** 124,141 ****
- SetDot(&point);
- return;
- }
- ! DoTimes(DelPChar(), (wp - wordbuf));
-
- for (cp = ap->a_phrase; c = *cp; ) {
- if (AutoCaseAbbrev) {
- ! Insert(islower(c) && UC_count &&
- ! (cp == ap->a_phrase || (UC_count > 1 && (*(cp - 1) == ' '))) ?
- ! toupper(c) : c);
- ! }
- ! else {
- ! Insert(c);
- ! }
- ! cp++;
- }
-
- if (ap->a_cmdhook != 0)
- --- 122,137 ----
- SetDot(&point);
- return;
- }
- ! del_char(BACKWARD, (wp - wordbuf));
-
- for (cp = ap->a_phrase; c = *cp; ) {
- if (AutoCaseAbbrev) {
- ! insert_c(islower(c) && UC_count &&
- ! (cp == ap->a_phrase || (UC_count > 1 && (cp[-1] == ' '))) ?
- ! toupper(c) : c, 1);
- ! } else
- ! insert_c(c, 1);
- ! cp += 1;
- }
-
- if (ap->a_cmdhook != 0)
- Only in jove: argcount.c
- diff -c ojove/ask.c jove/ask.c
- *** ojove/ask.c Thu Jul 16 09:14:06 1987
- --- jove/ask.c Fri Jul 10 09:25:49 1987
- ***************
- *** 15,20 ****
- --- 15,22 ----
- # include <sys/stat.h>
- #endif
-
- + int DoEVexpand = NO; /* should we expand evironment variables? */
- +
- int Asking = NO;
- char Minibuf[LBSIZE];
- private Line *CurAskPtr = 0; /* points at some line in mini-buffer */
- ***************
- *** 57,63 ****
- SetBuf(saveb);
- }
-
- ! static char *
- real_ask(delim, d_proc, def, prompt)
- char *delim,
- *def,
- --- 59,106 ----
- SetBuf(saveb);
- }
-
- ! /* look for any substrings of the form $foo in linebuf, and expand
- ! them according to their value in the environment (if possible) -
- ! this munges all over curchar and linebuf without giving it a second
- ! thought (I must be getting lazy in my old age) */
- ! private
- ! EVexpand()
- ! {
- ! register int c;
- ! register char *lp = linebuf,
- ! *ep;
- ! char varname[128],
- ! *vp,
- ! *lp_start;
- ! Mark *m = MakeMark(curline, curchar, M_FLOATER);
- !
- ! while (c = *lp++) {
- ! if (c != '$')
- ! continue;
- ! lp_start = lp - 1; /* the $ */
- ! vp = varname;
- ! while (c = *lp++) {
- ! if (!isword(c))
- ! break;
- ! *vp++ = c;
- ! }
- ! *vp = '\0';
- ! /* if we find an env. variable with the right
- ! name, we insert it in linebuf, and then delete
- ! the variable name that we're replacing - and
- ! then we continue in case there are others ... */
- ! if (ep = getenv(varname)) {
- ! curchar = lp_start - linebuf;
- ! ins_str(ep, NO);
- ! del_char(FORWARD, strlen(varname) + 1);
- ! lp = linebuf + curchar;
- ! }
- ! }
- ! ToMark(m);
- ! DelMark(m);
- ! }
- !
- ! private char *
- real_ask(delim, d_proc, def, prompt)
- char *delim,
- *def,
- ***************
- *** 72,79 ****
- int abort = 0,
- no_typed = 0;
- data_obj *push_cmd = LastCmd;
- ! int o_exp = exp,
- ! o_exp_p = exp_p;
-
- if (InAsk)
- complain((char *) 0);
- --- 115,122 ----
- int abort = 0,
- no_typed = 0;
- data_obj *push_cmd = LastCmd;
- ! int o_a_v = arg_value(),
- ! o_i_an_a = is_an_arg();
-
- if (InAsk)
- complain((char *) 0);
- ***************
- *** 95,102 ****
- }
-
- for (;;) {
- ! exp = 1;
- ! exp_p = NO;
- last_cmd = this_cmd;
- init_strokes();
- cont: s_mess("%s%s", prompt, linebuf);
- --- 138,144 ----
- }
-
- for (;;) {
- ! clr_arg_value();
- last_cmd = this_cmd;
- init_strokes();
- cont: s_mess("%s%s", prompt, linebuf);
- ***************
- *** 103,120 ****
- Asking = curchar + prompt_len;
- c = getch();
- if ((c == EOF) || index(delim, c)) {
- if (d_proc == 0 || (*d_proc)(c) == 0)
- goto cleanup;
- } else switch (c) {
- ! case CTL(G):
- message("[Aborted]");
- abort++;
- goto cleanup;
-
- ! case CTL(N):
- ! case CTL(P):
- if (CurAskPtr != 0) {
- ! int n = (c == CTL(P) ? -exp : exp);
-
- CurAskPtr = next_line(CurAskPtr, n);
- if (CurAskPtr == curbuf->b_first && CurAskPtr->l_next != 0)
- --- 145,164 ----
- Asking = curchar + prompt_len;
- c = getch();
- if ((c == EOF) || index(delim, c)) {
- + if (DoEVexpand)
- + EVexpand();
- if (d_proc == 0 || (*d_proc)(c) == 0)
- goto cleanup;
- } else switch (c) {
- ! case CTL('G'):
- message("[Aborted]");
- abort++;
- goto cleanup;
-
- ! case CTL('N'):
- ! case CTL('P'):
- if (CurAskPtr != 0) {
- ! int n = (c == CTL('P') ? -arg_value() : arg_value());
-
- CurAskPtr = next_line(CurAskPtr, n);
- if (CurAskPtr == curbuf->b_first && CurAskPtr->l_next != 0)
- ***************
- *** 127,133 ****
- }
- break;
-
- ! case CTL(R):
- if (def)
- ins_str(def, NO);
- else
- --- 171,177 ----
- }
- break;
-
- ! case CTL('R'):
- if (def)
- ins_str(def, NO);
- else
- ***************
- *** 151,158 ****
- pop_env(savejmp);
-
- LastCmd = push_cmd;
- ! exp_p = o_exp_p;
- ! exp = o_exp;
- no_typed = (linebuf[0] == '\0');
- strcpy(Minibuf, linebuf);
- SetBuf(saveb);
- --- 195,202 ----
- pop_env(savejmp);
-
- LastCmd = push_cmd;
- ! set_arg_value(o_a_v);
- ! set_is_an_arg(o_i_an_a);
- no_typed = (linebuf[0] == '\0');
- strcpy(Minibuf, linebuf);
- SetBuf(saveb);
- ***************
- *** 212,218 ****
- return real_ask(delim, d_proc, def, prompt);
- }
-
- ! /* VARARGS2 */
-
- yes_or_no_p(fmt, va_alist)
- char *fmt;
- --- 256,262 ----
- return real_ask(delim, d_proc, def, prompt);
- }
-
- ! /* VARARGS1 */
-
- yes_or_no_p(fmt, va_alist)
- char *fmt;
- ***************
- *** 230,236 ****
- Asking = strlen(prompt); /* so redisplay works */
- c = getch();
- Asking = NO;
- ! switch (Upper(c)) {
- case 'Y':
- return YES;
-
- --- 274,280 ----
- Asking = strlen(prompt); /* so redisplay works */
- c = getch();
- Asking = NO;
- ! switch (CharUpcase(c)) {
- case 'Y':
- return YES;
-
- ***************
- *** 237,243 ****
- case 'N':
- return NO;
-
- ! case CTL(G):
- complain("[Aborted]");
-
- default:
- --- 281,287 ----
- case 'N':
- return NO;
-
- ! case CTL('G'):
- complain("[Aborted]");
-
- default:
- ***************
- *** 343,353 ****
- (linebuf[curchar - 1] != '/') &&
- (isdir(linebuf)));
- if (the_same && !is_ntdir) {
- ! add_mess(n == 1 ? " [Unique]" : " [Ambiguous]");
- SitFor(7);
- }
- if (is_ntdir)
- ! Insert('/');
- }
-
- extern int alphacomp();
- --- 387,397 ----
- (linebuf[curchar - 1] != '/') &&
- (isdir(linebuf)));
- if (the_same && !is_ntdir) {
- ! add_mess((n == 1) ? " [Unique]" : " [Ambiguous]");
- SitFor(7);
- }
- if (is_ntdir)
- ! insert_c('/', 1);
- }
-
- extern int alphacomp();
- ***************
- *** 438,444 ****
- {
- char *ans,
- prompt[128],
- ! *pretty_name = pr_name(def);
-
- if (prmt)
- sprintf(prompt, prmt);
- --- 482,488 ----
- {
- char *ans,
- prompt[128],
- ! *pretty_name = pr_name(def, YES);
-
- if (prmt)
- sprintf(prompt, prmt);
- diff -c ojove/buf.c jove/buf.c
- *** ojove/buf.c Thu Jul 16 09:14:07 1987
- --- jove/buf.c Tue Jun 23 13:50:25 1987
- ***************
- *** 26,33 ****
-
- TogMinor(bit)
- {
- ! if (exp_p) {
- ! if (exp == 0)
- curbuf->b_minor &= ~bit;
- else
- curbuf->b_minor |= bit;
- --- 26,33 ----
-
- TogMinor(bit)
- {
- ! if (is_an_arg()) {
- ! if (arg_value() == 0)
- curbuf->b_minor &= ~bit;
- else
- curbuf->b_minor |= bit;
- ***************
- *** 147,153 ****
- offset = complete(bnames, prompt, RET_STATE);
- if (offset == EOF)
- complain((char *) 0);
- ! if (offset == ORIGINAL)
- bname = Minibuf;
- else if (offset == NULLSTRING) {
- if (def)
- --- 147,153 ----
- offset = complete(bnames, prompt, RET_STATE);
- if (offset == EOF)
- complain((char *) 0);
- ! if (offset == ORIGINAL || offset == AMBIGUOUS)
- bname = Minibuf;
- else if (offset == NULLSTRING) {
- if (def)
- ***************
- *** 171,177 ****
- SetBuf(do_select(curwind, bname));
- }
-
- ! static
- defb_wind(b)
- register Buffer *b;
- {
- --- 171,177 ----
- SetBuf(do_select(curwind, bname));
- }
-
- ! private
- defb_wind(b)
- register Buffer *b;
- {
- ***************
- *** 186,202 ****
-
- do {
- if (w->w_bufp == b) {
- ! if (one_windp())
- (void) do_select(w, alt);
- else {
- ! register Window *save = w->w_next;
-
- del_wind(w);
- w = save->w_prev;
- }
- ! }
- w = w->w_next;
- ! } while (w != fwind);
- }
-
- Buffer *
- --- 186,202 ----
-
- do {
- if (w->w_bufp == b) {
- ! if (one_windp() || alt != Mainbuf)
- (void) do_select(w, alt);
- else {
- ! Window *save = w->w_next;
-
- del_wind(w);
- w = save->w_prev;
- }
- ! }
- w = w->w_next;
- ! } while (w != fwind || w->w_bufp == b);
- }
-
- Buffer *
- ***************
- *** 275,281 ****
- continue;
- if (IsModified(b)) {
- y_or_n = ask("No", "%s modified; should I save it? ", b->b_name);
- ! if (Upper(*y_or_n) == 'Y') {
- oldb = curbuf;
- SetBuf(b);
- SaveFile();
- --- 275,281 ----
- continue;
- if (IsModified(b)) {
- y_or_n = ask("No", "%s modified; should I save it? ", b->b_name);
- ! if (CharUpcase(*y_or_n) == 'Y') {
- oldb = curbuf;
- SetBuf(b);
- SaveFile();
- ***************
- *** 499,505 ****
- {
- struct stat stbuf;
-
- ! if (b->b_fname == 0 || stat(b->b_fname, &stbuf) == -1) {
- b->b_ino = 0;
- b->b_mtime = 0;
- } else {
- --- 499,505 ----
- {
- struct stat stbuf;
-
- ! if (b->b_fname == 0 || stat(pr_name(b->b_fname, NO), &stbuf) == -1) {
- b->b_ino = 0;
- b->b_mtime = 0;
- } else {
- ***************
- *** 524,537 ****
- bufname(b);
- set_ino(b);
- b->b_ntbf = 1;
- - if (force) {
- - Buffer *oldb = curbuf;
- -
- - SetBuf(b); /* this'll read the file */
- - SetBuf(oldb);
- - }
- }
-
- if (w)
- tiewind(w, b);
- return b;
- --- 524,536 ----
- bufname(b);
- set_ino(b);
- b->b_ntbf = 1;
- }
- + if (force) {
- + Buffer *oldb = curbuf;
-
- + SetBuf(b); /* this'll read the file */
- + SetBuf(oldb);
- + }
- if (w)
- tiewind(w, b);
- return b;
- ***************
- *** 549,563 ****
- SetBuf(newbuf)
- register Buffer *newbuf;
- {
- ! register Buffer *oldb = curbuf;
-
- if (newbuf == curbuf || newbuf == 0)
- return;
-
- lsave();
- curbuf = newbuf;
- ! curline = newbuf->b_dot;
- ! curchar = newbuf->b_char;
- getDOT();
- /* Do the read now ... */
- if (curbuf->b_ntbf)
- --- 548,570 ----
- SetBuf(newbuf)
- register Buffer *newbuf;
- {
- ! register Buffer *oldb = curbuf,
- ! *b;
-
- if (newbuf == curbuf || newbuf == 0)
- return;
-
- + /* check to see that we're selecting a valid buffer */
- + for (b = world; b != 0; b = b->b_next)
- + if (b == newbuf)
- + break;
- + if (b == 0)
- + complain("Internal error: (%x) is not a valid buffer pointer!", newbuf);
- +
- lsave();
- curbuf = newbuf;
- ! /* curline = newbuf->b_dot;
- ! curchar = newbuf->b_char; STUPID!! */
- getDOT();
- /* Do the read now ... */
- if (curbuf->b_ntbf)
- diff -c ojove/c.c jove/c.c
- *** ojove/c.c Thu Jul 16 09:14:09 1987
- --- jove/c.c Wed Jun 24 12:43:21 1987
- ***************
- *** 167,180 ****
- register char c,
- syntax = (dir == FORWARD) ? _Op : _Cl;
-
- - exp = 1;
- if (dir == BACKWARD)
- ! BackChar();
- c = linebuf[curchar];
- for (;;) {
- if (!skip_words && ismword(c)) {
- WITH_TABLE(curbuf->b_major)
- ! (dir == FORWARD) ? ForWord() : BackWord();
- END_TABLE();
- break;
- } else if (has_syntax(c, syntax)) {
- --- 167,179 ----
- register char c,
- syntax = (dir == FORWARD) ? _Op : _Cl;
-
- if (dir == BACKWARD)
- ! b_char(1);
- c = linebuf[curchar];
- for (;;) {
- if (!skip_words && ismword(c)) {
- WITH_TABLE(curbuf->b_major)
- ! (dir == FORWARD) ? f_word(1) : b_word(1);
- END_TABLE();
- break;
- } else if (has_syntax(c, syntax)) {
- ***************
- *** 181,187 ****
- FindMatch(dir);
- break;
- }
- ! DoTimes(ForChar(), dir);
- if (eobp() || bobp())
- return;
- c = linebuf[curchar];
- --- 180,186 ----
- FindMatch(dir);
- break;
- }
- ! f_char(dir);
- if (eobp() || bobp())
- return;
- c = linebuf[curchar];
- ***************
- *** 190,199 ****
-
- FSexpr()
- {
- ! register int num = exp;
-
- ! if (exp < 0) {
- ! exp = -exp;
- BSexpr();
- }
- while (--num >= 0)
- --- 189,198 ----
-
- FSexpr()
- {
- ! register int num = arg_value();
-
- ! if (num < 0) {
- ! set_arg_value(-num);
- BSexpr();
- }
- while (--num >= 0)
- ***************
- *** 202,211 ****
-
- FList()
- {
- ! register int num = exp;
-
- ! if (exp < 0) {
- ! exp = -exp;
- BList();
- }
- while (--num >= 0)
- --- 201,210 ----
-
- FList()
- {
- ! register int num = arg_value();
-
- ! if (num < 0) {
- ! set_arg_value(-num);
- BList();
- }
- while (--num >= 0)
- ***************
- *** 214,223 ****
-
- BSexpr()
- {
- ! register int num = exp;
-
- ! if (exp < 0) {
- ! exp = -exp;
- FSexpr();
- }
- while (--num >= 0)
- --- 213,222 ----
-
- BSexpr()
- {
- ! register int num = arg_value();
-
- ! if (num < 0) {
- ! negate_arg_value();
- FSexpr();
- }
- while (--num >= 0)
- ***************
- *** 226,235 ****
-
- BList()
- {
- ! register int num = exp;
-
- ! if (exp < 0) {
- ! exp = -exp;
- FList();
- }
- while (--num >= 0)
- --- 225,234 ----
-
- BList()
- {
- ! register int num = arg_value();
-
- ! if (num < 0) {
- ! negate_arg_value();
- FList();
- }
- while (--num >= 0)
- ***************
- *** 275,284 ****
- (backslashed(linebuf, curchar)))
- complain((char *) 0);
- if (dir == FORWARD)
- ! ForChar();
- bp = m_paren(c, dir, YES, NO);
- if (dir == FORWARD)
- ! BackChar();
- if (bp != 0)
- SetDot(bp);
- mp_error(); /* if there is an error the user wants to
- --- 274,283 ----
- (backslashed(linebuf, curchar)))
- complain((char *) 0);
- if (dir == FORWARD)
- ! f_char(1);
- bp = m_paren(c, dir, YES, NO);
- if (dir == FORWARD)
- ! b_char(1);
- if (bp != 0)
- SetDot(bp);
- mp_error(); /* if there is an error the user wants to
- ***************
- *** 482,488 ****
- SetDot(match_c);
- }
- SetDot(&open_c_pt);
- ! open_c_mark = MakeMark(curline, curchar, FLOATER);
- indent_pos = calc_pos(linebuf, curchar);
- /* search for a close comment; delete it if it exits */
- SetDot(&close_c_pt);
- --- 481,487 ----
- SetDot(match_c);
- }
- SetDot(&open_c_pt);
- ! open_c_mark = MakeMark(curline, curchar, M_FLOATER);
- indent_pos = calc_pos(linebuf, curchar);
- /* search for a close comment; delete it if it exits */
- SetDot(&close_c_pt);
- ***************
- *** 489,497 ****
- if (close_at_dot == 0) {
- slen = strlen(close_pat);
- while (slen--)
- ! DelPChar();
- }
- ! entry_mark = MakeMark(curline, curchar, FLOATER);
- ToMark(open_c_mark);
- /* always separate the comment body from anything preceeding it */
- LineInsert(1);
- --- 488,496 ----
- if (close_at_dot == 0) {
- slen = strlen(close_pat);
- while (slen--)
- ! del_char(BACKWARD, 1);
- }
- ! entry_mark = MakeMark(curline, curchar, M_FLOATER);
- ToMark(open_c_mark);
- /* always separate the comment body from anything preceeding it */
- LineInsert(1);
- ***************
- *** 502,511 ****
- if (!eolp())
- LineInsert(1);
- else
- ! line_move(FORWARD, NO);
- } else if (*cp == ' ' || *cp == '\t') {
- if (linebuf[curchar] != *cp)
- ! Insert(*cp);
- } else
- /* Since we matched the open comment string on this
- line, we don't need to worry about crossing line
- --- 501,510 ----
- if (!eolp())
- LineInsert(1);
- else
- ! line_move(FORWARD, 1, NO);
- } else if (*cp == ' ' || *cp == '\t') {
- if (linebuf[curchar] != *cp)
- ! insert_c(*cp, 1);
- } else
- /* Since we matched the open comment string on this
- line, we don't need to worry about crossing line
- ***************
- *** 512,518 ****
- boundaries. */
- curchar++;
- }
- ! savedot = MakeMark(curline, curchar, FLOATER);
-
- /* We need to strip the line header pattern of leading white space
- since we need to match the line after all of its leading
- --- 511,517 ----
- boundaries. */
- curchar++;
- }
- ! savedot = MakeMark(curline, curchar, M_FLOATER);
-
- /* We need to strip the line header pattern of leading white space
- since we need to match the line after all of its leading
- ***************
- *** 529,556 ****
- Bol();
- DelWtSpace();
- if (header_len && !strncmp(linebuf, cp, header_len))
- ! DoTimes(DelNChar(), header_len);
- if (trailer_len) {
- Eol();
- if ((curchar > trailer_len) &&
- (!strncmp(&linebuf[curchar - trailer_len],
- l_trailer, trailer_len)))
- ! DoTimes(DelPChar(), trailer_len);
- }
- if (curline->l_next != 0)
- ! line_move(FORWARD, NO);
- else
- break;
- } while (curline != entry_mark->m_line->l_next);
-
- ! DoSetMark(savedot->m_line, savedot->m_char);
- ToMark(entry_mark);
- saveRMargin = RMargin;
- RMargin = saveRMargin - strlen(l_header) -
- strlen(l_trailer) - indent_pos + 2;
- ! /* do not use the left margin */
- ! exp_p = NO;
- ! do_rfill();
- RMargin = saveRMargin;
- /* get back to the start of the comment */
- PopMark();
- --- 528,553 ----
- Bol();
- DelWtSpace();
- if (header_len && !strncmp(linebuf, cp, header_len))
- ! del_char(FORWARD, header_len);
- if (trailer_len) {
- Eol();
- if ((curchar > trailer_len) &&
- (!strncmp(&linebuf[curchar - trailer_len],
- l_trailer, trailer_len)))
- ! del_char(BACKWARD, trailer_len);
- }
- if (curline->l_next != 0)
- ! line_move(FORWARD, 1, NO);
- else
- break;
- } while (curline != entry_mark->m_line->l_next);
-
- ! do_set_mark(savedot->m_line, savedot->m_char);
- ToMark(entry_mark);
- saveRMargin = RMargin;
- RMargin = saveRMargin - strlen(l_header) -
- strlen(l_trailer) - indent_pos + 2;
- ! do_rfill(NO);
- RMargin = saveRMargin;
- /* get back to the start of the comment */
- PopMark();
- ***************
- *** 567,579 ****
- else
- ins_str(l_trailer, NO);
- if (curline->l_next != 0)
- ! line_move(FORWARD, NO);
- else
- break;
- } while (curline != entry_mark->m_line->l_next);
- /* handle the close comment symbol */
- if (curline == entry_mark->m_line->l_next) {
- ! line_move(BACKWARD, NO);
- Eol();
- }
- DelWtSpace();
- --- 564,576 ----
- else
- ins_str(l_trailer, NO);
- if (curline->l_next != 0)
- ! line_move(FORWARD, 1, NO);
- else
- break;
- } while (curline != entry_mark->m_line->l_next);
- /* handle the close comment symbol */
- if (curline == entry_mark->m_line->l_next) {
- ! line_move(BACKWARD, 1, NO);
- Eol();
- }
- DelWtSpace();
- ***************
- *** 588,599 ****
- LineInsert(1);
- n_indent(indent_pos);
- } else
- ! Insert(*cp);
- }
- ToMark(open_c_mark);
- Eol();
- ! exp_p = NO;
- ! DelNChar();
- }
-
- #endif CMT_FMT
- --- 585,595 ----
- LineInsert(1);
- n_indent(indent_pos);
- } else
- ! insert_c(*cp, 1);
- }
- ToMark(open_c_mark);
- Eol();
- ! del_char(FORWARD, 1);
- }
-
- #endif CMT_FMT
- diff -c ojove/case.c jove/case.c
- *** ojove/case.c Thu Jul 16 09:14:09 1987
- --- jove/case.c Fri Jun 12 10:45:46 1987
- ***************
- *** 16,31 ****
-
- DOTsave(&b);
-
- ! if (exp < 0) {
- restore++;
- ! exp = -exp;
- ! num = exp;
- ! BackChar(); /* Cap previous EXP chars */
- ! } else
- ! num = exp;
-
- - exp = 1; /* So all the commands are done once */
- -
- while (num--) {
- if (upper(&linebuf[curchar])) {
- modify();
- --- 16,28 ----
-
- DOTsave(&b);
-
- ! num = arg_value();
- ! if (num < 0) {
- restore++;
- ! num = -num;
- ! b_char(num); /* Cap previous EXP chars */
- ! }
-
- while (num--) {
- if (upper(&linebuf[curchar])) {
- modify();
- ***************
- *** 35,42 ****
- if (curline->l_next == 0)
- break;
- SetLine(curline->l_next);
- ! }
- ! else
- curchar++;
- }
- if (restore)
- --- 32,38 ----
- if (curline->l_next == 0)
- break;
- SetLine(curline->l_next);
- ! } else
- curchar++;
- }
- if (restore)
- ***************
- *** 51,65 ****
-
- DOTsave(&b);
-
- ! if (exp < 0) {
- restore++;
- ! exp = -exp;
- ! num = exp;
- ! BackWord(); /* Cap previous EXP words */
- ! } else
- ! num = exp;
- !
- ! exp = 1; /* So all the commands are done once */
-
- while (num--) {
- to_word(1); /* Go to the beginning of the next word. */
- --- 47,58 ----
-
- DOTsave(&b);
-
- ! num = arg_value();
- ! if (num < 0) {
- restore++;
- ! num = -num;
- ! b_word(num); /* Cap previous EXP words */
- ! }
-
- while (num--) {
- to_word(1); /* Go to the beginning of the next word. */
- ***************
- *** 87,97 ****
- Bufpos before;
-
- DOTsave(&before);
- ! ForWord(); /* This'll go backward if negative argument. */
- case_reg(before.p_line, before.p_char, curline, curchar, up);
- }
-
- ! static
- upper(c)
- register char *c;
- {
- --- 80,90 ----
- Bufpos before;
-
- DOTsave(&before);
- ! ForWord(); /* this'll go backward if negative argument */
- case_reg(before.p_line, before.p_char, curline, curchar, up);
- }
-
- ! private
- upper(c)
- register char *c;
- {
- ***************
- *** 121,127 ****
- (void) fixorder(&line1, &char1, &line2, &char2);
- DotTo(line1, char1);
-
- - exp = 1;
- for (;;) {
- if (curline == line2 && curchar == char2)
- break;
- --- 114,119 ----
- ***************
- *** 130,136 ****
- makedirty(curline);
- modify();
- }
- ! ForChar();
- }
- }
-
- --- 122,128 ----
- makedirty(curline);
- modify();
- }
- ! f_char(1);
- }
- }
-
- diff -c ojove/ctype.c jove/ctype.c
- *** ojove/ctype.c Thu Jul 16 09:14:11 1987
- --- jove/ctype.c Wed Feb 4 11:37:21 1987
- ***************
- *** 89,91 ****
- --- 89,111 ----
- {
- return ((CharTable[curbuf->b_major])[c]&(_W));
- }
- +
- + char CaseEquiv[] = {
- + '\000', '\001', '\002', '\003', '\004', '\005', '\006', '\007',
- + '\010', '\011', '\012', '\013', '\014', '\015', '\016', '\017',
- + '\020', '\021', '\022', '\023', '\024', '\025', '\026', '\027',
- + '\030', '\031', '\032', '\033', '\034', '\035', '\036', '\037',
- + '\040', '!', '"', '#', '$', '%', '&', '\'',
- + '(', ')', '*', '+', ',', '-', '.', '/',
- + '0', '1', '2', '3', '4', '5', '6', '7',
- + '8', '9', ':', ';', '<', '=', '>', '?',
- + '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G',
- + 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O',
- + 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W',
- + 'X', 'Y', 'Z', '[', '\\', ']', '^', '_',
- + '`', 'A', 'B', 'C', 'D', 'E', 'F', 'G',
- + 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O',
- + 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W',
- + 'X', 'Y', 'Z', '{', '|', '}', '~', '\177'
- + };
- +
- diff -c ojove/delete.c jove/delete.c
- *** ojove/delete.c Thu Jul 16 09:14:13 1987
- --- jove/delete.c Wed Jun 24 12:43:21 1987
- ***************
- *** 99,105 ****
-
- DelNChar()
- {
- ! del_char(1);
- }
-
- /* Delete character backward */
- --- 99,105 ----
-
- DelNChar()
- {
- ! del_char(FORWARD, arg_value());
- }
-
- /* Delete character backward */
- ***************
- *** 107,134 ****
- DelPChar()
- {
- if (MinorMode(OverWrite)) {
- ! int count = min(exp, curchar);
-
- ! DoTimes(BackChar(), count);
- ! LastKeyStruck = ' '; /* can you say gross? */
- ! DoTimes(SelfInsert(), count);
- ! DoTimes(BackChar(), count);
- } else
- ! del_char(0);
- }
-
- ! /* Delete some characters. If deleting `forward' then call for_char
- to the final position otherwise call back_char. Then delete the
- region between the two with patchup(). */
-
- ! del_char(forward)
- {
- Bufpos before,
- after;
- ! int killp = (exp_p && abs(exp) > 1);
-
- DOTsave(&before);
- ! (forward) ? ForChar() : BackChar();
- if (before.p_line == curline && before.p_char == curchar)
- complain((char *) 0);
- if (killp)
- --- 107,138 ----
- DelPChar()
- {
- if (MinorMode(OverWrite)) {
- ! int count = min(arg_value(), curchar);
-
- ! b_char(count);
- !
- ! /* overwrite with spaces */
- ! set_arg_value(count);
- ! LastKeyStruck = ' ';
- ! SelfInsert();
- !
- ! b_char(count);
- } else
- ! del_char(BACKWARD, arg_value());
- }
-
- ! /* Delete some characters. If deleting forward then call for_char
- to the final position otherwise call back_char. Then delete the
- region between the two with patchup(). */
-
- ! del_char(dir, num)
- {
- Bufpos before,
- after;
- ! int killp = (abs(num) > 1);
-
- DOTsave(&before);
- ! (dir == FORWARD) ? f_char(num) : b_char(num);
- if (before.p_line == curline && before.p_char == curchar)
- complain((char *) 0);
- if (killp)
- ***************
- *** 249,258 ****
- register Mark *dot;
- int all;
-
- - exp = 1;
- if (!blnkp(&linebuf[curchar]))
- return;
- ! dot = MakeMark(curline, curchar, FLOATER);
- all = !blnkp(linebuf);
- while (blnkp(linebuf) && curline->l_prev)
- SetLine(curline->l_prev);
- --- 253,261 ----
- register Mark *dot;
- int all;
-
- if (!blnkp(&linebuf[curchar]))
- return;
- ! dot = MakeMark(curline, curchar, M_FLOATER);
- all = !blnkp(linebuf);
- while (blnkp(linebuf) && curline->l_prev)
- SetLine(curline->l_prev);
- ***************
- *** 259,271 ****
- all |= (firstp(curline));
- Eol();
- DelWtSpace();
- ! line_move(FORWARD, NO);
- while (blnkp(linebuf) && !eobp()) {
- DelWtSpace();
- ! DelNChar();
- }
- if (!all && !eobp())
- ! OpenLine();
- ToMark(dot);
- DelMark(dot);
- }
- --- 262,274 ----
- all |= (firstp(curline));
- Eol();
- DelWtSpace();
- ! line_move(FORWARD, 1, NO);
- while (blnkp(linebuf) && !eobp()) {
- DelWtSpace();
- ! del_char(FORWARD, 1);
- }
- if (!all && !eobp())
- ! open_lines(1);
- ToMark(dot);
- DelMark(dot);
- }
- diff -c ojove/disp.c jove/disp.c
- *** ojove/disp.c Thu Jul 16 09:14:15 1987
- --- jove/disp.c Fri Jul 10 09:25:49 1987
- ***************
- *** 108,118 ****
- if (VisBell && VB)
- putstr(VB);
- else
- ! #ifdef SYSV /* release 2, at least */
- ! putpad("$<20>\007", 1) ;
- ! #else
- ! putpad("20\007", 1);
- ! #endif SYSV
- }
- flusho();
- }
- --- 108,114 ----
- if (VisBell && VB)
- putstr(VB);
- else
- ! putpad(BL, 1);
- }
- flusho();
- }
- ***************
- *** 787,793 ****
- ign_some = 0;
- char line[132],
- *fmt = ModeFmt,
- - tmp[16],
- fillc,
- c;
- register Buffer *thisbuf = w->w_bufp;
- --- 783,788 ----
- ***************
- *** 889,902 ****
- mode_app("[No file]");
- else {
- if (c == 'f')
- ! mode_app(pr_name(thisbuf->b_fname));
- else
- mode_app(basename(thisbuf->b_fname));
- }
- break;
-
- -
- case 'n':
- for (bp = world, n = 1; bp != 0; bp = bp->b_next, n++)
- if (bp == thisbuf)
- break;
- --- 884,899 ----
- mode_app("[No file]");
- else {
- if (c == 'f')
- ! mode_app(pr_name(thisbuf->b_fname, YES));
- else
- mode_app(basename(thisbuf->b_fname));
- }
- break;
-
- case 'n':
- + {
- + char tmp[16];
- +
- for (bp = world, n = 1; bp != 0; bp = bp->b_next, n++)
- if (bp == thisbuf)
- break;
- ***************
- *** 904,909 ****
- --- 901,907 ----
- sprintf(tmp, "%d", n);
- mode_app(tmp);
- break;
- + }
-
- case 'm':
- if (IsModified(w->w_bufp))
- ***************
- *** 933,940 ****
- (int) theavg,
- (int)((theavg - (int) theavg) * 100));
- mode_app(minibuf);
- }
- - break;
- #endif
-
- case 'C': /* check mail here */
- --- 931,938 ----
- (int) theavg,
- (int)((theavg - (int) theavg) * 100));
- mode_app(minibuf);
- + break;
- }
- #endif
-
- case 'C': /* check mail here */
- ***************
- *** 944,950 ****
-
- #ifdef CHDIR
- case 'd': /* print working directory */
- ! mode_app(pr_name(pwd()));
- break;
- #endif
-
- --- 942,948 ----
-
- #ifdef CHDIR
- case 'd': /* print working directory */
- ! mode_app(pr_name(pwd(), YES));
- break;
- #endif
-
- ***************
- *** 958,963 ****
- --- 956,975 ----
-
- goto outahere; /* %e means we're done! */
- }
- +
- + #ifdef IPROCS
- + case 'p':
- + if (thisbuf->b_type != B_PROCESS) {
- + char tmp[40];
- +
- + sprintf(tmp, "(%s)", (thisbuf->b_process == 0) ?
- + "No process" :
- + pstate(thisbuf->b_process));
- + mode_app(tmp);
- + break;
- + }
- + #endif
- +
- }
- }
-
- ***************
- *** 980,987 ****
-
- RedrawDisplay()
- {
- ! Line *newtop = prev_line((curwind->w_line = curline), exp_p ?
- ! exp : HALF(curwind));
-
- if (newtop == curwind->w_top)
- v_clear(FLine(curwind), FLine(curwind) + SIZE(curwind));
- --- 992,999 ----
-
- RedrawDisplay()
- {
- ! Line *newtop = prev_line((curwind->w_line = curline), is_an_arg() ?
- ! arg_value() : HALF(curwind));
-
- if (newtop == curwind->w_top)
- v_clear(FLine(curwind), FLine(curwind) + SIZE(curwind));
- ***************
- *** 1016,1027 ****
-
- if (Asking)
- return;
- ! if (exp < 0) {
- ! exp = -exp;
- PrevPage();
- return;
- }
- ! if (exp_p == YES)
- UpScroll();
- else {
- if (in_window(curwind, curwind->w_bufp->b_last) != -1) {
- --- 1028,1039 ----
-
- if (Asking)
- return;
- ! if (arg_value() < 0) {
- ! negate_arg_value();
- PrevPage();
- return;
- }
- ! if (arg_type() == YES)
- UpScroll();
- else {
- if (in_window(curwind, curwind->w_bufp->b_last) != -1) {
- ***************
- *** 1041,1052 ****
-
- if (Asking)
- return;
- ! if (exp < 0) {
- ! exp = -exp;
- NextPage();
- return;
- }
- ! if (exp_p == YES)
- DownScroll();
- else {
- newline = prev_line(curwind->w_top, max(1, SIZE(curwind) - 1));
- --- 1053,1064 ----
-
- if (Asking)
- return;
- ! if (arg_value() < 0) {
- ! negate_arg_value();
- NextPage();
- return;
- }
- ! if (arg_type() == YES)
- DownScroll();
- else {
- newline = prev_line(curwind->w_top, max(1, SIZE(curwind) - 1));
- ***************
- *** 1058,1064 ****
-
- UpScroll()
- {
- ! SetTop(curwind, next_line(curwind->w_top, exp));
- if ((curwind->w_bufp == curbuf) &&
- (in_window(curwind, curline) == -1))
- SetLine(curwind->w_top);
- --- 1070,1076 ----
-
- UpScroll()
- {
- ! SetTop(curwind, next_line(curwind->w_top, arg_value()));
- if ((curwind->w_bufp == curbuf) &&
- (in_window(curwind, curline) == -1))
- SetLine(curwind->w_top);
- ***************
- *** 1066,1072 ****
-
- DownScroll()
- {
- ! SetTop(curwind, prev_line(curwind->w_top, exp));
- if ((curwind->w_bufp == curbuf) &&
- (in_window(curwind, curline) == -1))
- SetLine(curwind->w_top);
- --- 1078,1084 ----
-
- DownScroll()
- {
- ! SetTop(curwind, prev_line(curwind->w_top, arg_value()));
- if ((curwind->w_bufp == curbuf) &&
- (in_window(curwind, curline) == -1))
- SetLine(curwind->w_top);
- ***************
- *** 1101,1108 ****
- if (Asking)
- return;
- SetLine(next_line(curwind->w_top, SIZE(curwind) - 1 -
- ! min(SIZE(curwind) - 1, exp - 1)));
- ! if (exp_p == NO)
- Eol();
- }
-
- --- 1113,1120 ----
- if (Asking)
- return;
- SetLine(next_line(curwind->w_top, SIZE(curwind) - 1 -
- ! min(SIZE(curwind) - 1, arg_value() - 1)));
- ! if (!is_an_arg())
- Eol();
- }
-
- ***************
- *** 1112,1118 ****
- {
- if (Asking)
- return;
- ! SetLine(next_line(curwind->w_top, min(SIZE(curwind) - 1, exp - 1)));
- }
-
- private int LineNo,
- --- 1124,1130 ----
- {
- if (Asking)
- return;
- ! SetLine(next_line(curwind->w_top, min(SIZE(curwind) - 1, arg_value() - 1)));
- }
-
- private int LineNo,
- ***************
- *** 1158,1164 ****
- f_mess("--more--");
- if ((c = getchar()) != ' ') {
- TOabort++;
- ! if (c != CTL(G) && c != RUBOUT)
- Ungetc(c);
- return;
- }
- --- 1170,1176 ----
- f_mess("--more--");
- if ((c = getchar()) != ' ') {
- TOabort++;
- ! if (c != CTL('G') && c != RUBOUT)
- Ungetc(c);
- return;
- }
- Common subdirectories: ojove/doc and jove/doc
- diff -c ojove/extend.c jove/extend.c
- *** ojove/extend.c Thu Jul 16 09:14:18 1987
- --- jove/extend.c Tue Jun 23 13:50:18 1987
- ***************
- *** 78,86 ****
- {
- register int i;
-
- ! exp_p = YES;
- ! exp = 1; /* So minor modes don't toggle. We always want
- ! them on. */
- if (new == 0)
- return;
- for (i = 0; i < ExecIndex; i++)
- --- 78,84 ----
- {
- register int i;
-
- ! set_arg_value(1);
- if (new == 0)
- return;
- for (i = 0; i < ExecIndex; i++)
- ***************
- *** 165,171 ****
- } else if (c == '^') {
- if ((c = getch()) == '?')
- c = RUBOUT;
- ! else if (isalpha(c) || index("[\\]^_", c))
- c = c - '@';
- else
- complain("[Unknown control character]");
- --- 163,169 ----
- } else if (c == '^') {
- if ((c = getch()) == '?')
- c = RUBOUT;
- ! else if (isalpha(c) || index("@[\\]^_", c))
- c = c - '@';
- else
- complain("[Unknown control character]");
- ***************
- *** 320,326 ****
- sprintf(keydescbuf, "%s %p", pref, c1);
- else
- sprintf(keydescbuf, "%s [%p-%p]", pref, c1, c2);
- ! if (prefp = IsPrefix(map[c1]))
- DescMap(prefp, keydescbuf);
- else
- Typeout("%-14s%s", keydescbuf, map[c1]->Name);
- --- 318,324 ----
- sprintf(keydescbuf, "%s %p", pref, c1);
- else
- sprintf(keydescbuf, "%s [%p-%p]", pref, c1, c2);
- ! if ((prefp = IsPrefix(map[c1])) && (prefp != map))
- DescMap(prefp, keydescbuf);
- else
- Typeout("%-14s%s", keydescbuf, map[c1]->Name);
- ***************
- *** 377,383 ****
- break;
- }
- }
- ! if (prefp = IsPrefix(map[c1])) {
- sprintf(prefbuf, "%p", c1);
- fb_aux(cp, prefp, prefbuf, bufp);
- }
- --- 375,381 ----
- break;
- }
- }
- ! if ((prefp = IsPrefix(map[c1])) && (prefp != map)) {
- sprintf(prefbuf, "%p", c1);
- fb_aux(cp, prefp, prefbuf, bufp);
- }
- ***************
- *** 640,654 ****
- comp_value = NULLSTRING;
- return 0;
- }
- ! if (comp_flags & RET_STATE) switch (command) {
- ! case UNIQUE:
- ! case ORIGINAL:
- ! case NULLSTRING:
- ! comp_value = command;
- ! return 0;
- !
- ! default:
- ! break;
- }
- if (InJoverc)
- complain("[\"%s\" unknown]", linebuf);
- --- 638,646 ----
- comp_value = NULLSTRING;
- return 0;
- }
- ! if (comp_flags & RET_STATE) {
- ! comp_value = command;
- ! return 0;
- }
- if (InJoverc)
- complain("[\"%s\" unknown]", linebuf);
- ***************
- *** 800,812 ****
- nchars += length(lp) + (lp->l_next != 0); /* include the NL */
- }
-
- ! s_mess("[\"%s\" line %d of %d, char %D of %D (%d%%)]",
- ! filename(curbuf),
- ! dotline,
- ! i,
- ! dotchar,
- ! nchars,
- ! (int) (((long) dotchar * 100) / nchars));
- }
-
- #define IF_UNBOUND -1
- --- 792,802 ----
- nchars += length(lp) + (lp->l_next != 0); /* include the NL */
- }
-
- ! s_mess("[\"%s\" line %d/%d, char %D/%D (%d%%), cursor = %d/%d]",
- ! filename(curbuf), dotline, i, dotchar, nchars,
- ! (nchars == 0) ? 100 : (int) (((long) dotchar * 100) / nchars),
- ! calc_pos(linebuf, curchar),
- ! calc_pos(linebuf, strlen(linebuf)));
- }
-
- #define IF_UNBOUND -1
- ***************
- *** 884,890 ****
- Buffer *savebuf = curbuf;
-
- SetBuf(do_select((Window *) 0, "RC errors"));
- ! ins_str(sprint("%s:%d:%s\t%s\n", pr_name(file), lnum, lbuf, mesgbuf), NO);
- unmodify();
- SetBuf(savebuf);
- Asking = 0;
- --- 874,880 ----
- Buffer *savebuf = curbuf;
-
- SetBuf(do_select((Window *) 0, "RC errors"));
- ! ins_str(sprint("%s:%d:%s\t%s\n", pr_name(file, YES), lnum, lbuf, mesgbuf), NO);
- unmodify();
- SetBuf(savebuf);
- Asking = 0;
- diff -c ojove/fmt.c jove/fmt.c
- *** ojove/fmt.c Thu Jul 16 09:14:21 1987
- --- jove/fmt.c Fri May 29 12:49:31 1987
- ***************
- *** 33,42 ****
- putc('\0', sp);
- }
-
- ! static char padc = ' ';
- ! static File *curiop = 0;
- !
- ! static
- PPchar(c, str)
- int c;
- char *str;
- --- 33,39 ----
- putc('\0', sp);
- }
-
- ! private
- PPchar(c, str)
- int c;
- char *str;
- ***************
- *** 53,98 ****
- sprintf(cp, "%c", c);
- }
-
- ! static
- ! putld(leftadj, width, d, base)
- long d;
- {
- int length = 1;
- long tmpd = d;
-
- while (tmpd = (tmpd / base))
- length++;
- if (d < 0)
- length++;
- ! if (!leftadj)
- ! pad(padc, width - length);
- if (d < 0) {
- ! putc('-', curiop);
- d = -d;
- }
- outld(d, base);
- ! if (leftadj)
- ! pad(padc, width - length);
- }
-
- ! static
- outld(d, base)
- long d;
- {
- ! long n;
-
- if (n = (d / base))
- outld(n, base);
- ! putc((int) ('0' + (int) (d % base)), curiop);
- }
-
- ! static
- ! puts(leftadj, width, str)
- char *str;
- {
- int length;
- ! register char *cp,
- ! c;
-
- if (str == 0)
- #if pyr
- --- 50,106 ----
- sprintf(cp, "%c", c);
- }
-
- ! private struct fmt_state {
- ! int precision,
- ! width,
- ! leftadj;
- ! char padc;
- ! File *iop;
- ! } current_fmt;
- !
- ! private
- ! putld(d, base)
- long d;
- {
- int length = 1;
- long tmpd = d;
-
- + if (current_fmt.width == 0 && current_fmt.precision) {
- + current_fmt.width = current_fmt.precision;
- + current_fmt.padc = '0';
- + }
- while (tmpd = (tmpd / base))
- length++;
- if (d < 0)
- length++;
- ! if (!current_fmt.leftadj)
- ! pad(current_fmt.padc, current_fmt.width - length);
- if (d < 0) {
- ! putc('-', current_fmt.iop);
- d = -d;
- }
- outld(d, base);
- ! if (current_fmt.leftadj)
- ! pad(current_fmt.padc, current_fmt.width - length);
- }
-
- ! private
- outld(d, base)
- long d;
- {
- ! register long n;
-
- if (n = (d / base))
- outld(n, base);
- ! putc((int) ('0' + (int) (d % base)), current_fmt.iop);
- }
-
- ! private
- ! puts(str)
- char *str;
- {
- int length;
- ! register char *cp;
-
- if (str == 0)
- #if pyr
- ***************
- *** 101,125 ****
- str = "(null)";
- #endif
- length = strlen(str);
- cp = str;
- ! if (!leftadj)
- ! pad(' ', width - length);
- ! while (c = *cp++)
- ! putc(c, curiop);
- ! if (leftadj)
- ! pad(' ', width - length);
- }
-
- ! static
- pad(c, amount)
- register int c,
- amount;
- {
- while (--amount >= 0)
- ! putc(c, curiop);
- }
-
- ! static
- doformat(sp, fmt, ap)
- register File *sp;
- register char *fmt;
- --- 109,137 ----
- str = "(null)";
- #endif
- length = strlen(str);
- + if (current_fmt.precision == 0 || length < current_fmt.precision)
- + current_fmt.precision = length;
- + else
- + length = current_fmt.precision;
- cp = str;
- ! if (!current_fmt.leftadj)
- ! pad(' ', current_fmt.width - length);
- ! while (--current_fmt.precision >= 0)
- ! putc(*cp++, current_fmt.iop);
- ! if (current_fmt.leftadj)
- ! pad(' ', current_fmt.width - length);
- }
-
- ! private
- pad(c, amount)
- register int c,
- amount;
- {
- while (--amount >= 0)
- ! putc(c, current_fmt.iop);
- }
-
- ! private
- doformat(sp, fmt, ap)
- register File *sp;
- register char *fmt;
- ***************
- *** 126,171 ****
- va_list ap;
- {
- register char c;
- ! int leftadj,
- ! width;
- ! File *pushiop = curiop;
-
- ! curiop = sp;
-
- while (c = *fmt++) {
- if (c != '%') {
- ! putc(c, sp);
- continue;
- }
-
- ! padc = ' ';
- ! leftadj = width = 0;
- c = *fmt++;
- if (c == '-') {
- ! leftadj++;
- c = *fmt++;
- }
- if (c == '0') {
- ! padc = '0';
- c = *fmt++;
- }
- while (c >= '0' && c <= '9') {
- ! width = width * 10 + (c - '0');
- c = *fmt++;
- }
- if (c == '*') {
- ! width = va_arg(ap, int);
- c = *fmt++;
- }
- reswitch:
- /* At this point, fmt points at one past the format letter. */
- switch (c) {
- case '%':
- ! putc('%', curiop);
- break;
-
- case 'D':
- ! putld(leftadj, width, va_arg(ap, long), 10);
- break;
-
- case 'b':
- --- 138,193 ----
- va_list ap;
- {
- register char c;
- ! struct fmt_state prev_fmt;
-
- ! prev_fmt = current_fmt;
- ! current_fmt.iop = sp;
-
- while (c = *fmt++) {
- if (c != '%') {
- ! putc(c, current_fmt.iop);
- continue;
- }
-
- ! current_fmt.padc = ' ';
- ! current_fmt.precision = current_fmt.leftadj = current_fmt.width = 0;
- c = *fmt++;
- if (c == '-') {
- ! current_fmt.leftadj = YES;
- c = *fmt++;
- }
- if (c == '0') {
- ! current_fmt.padc = '0';
- c = *fmt++;
- }
- while (c >= '0' && c <= '9') {
- ! current_fmt.width = current_fmt.width * 10 + (c - '0');
- c = *fmt++;
- }
- if (c == '*') {
- ! current_fmt.width = va_arg(ap, int);
- c = *fmt++;
- }
- + if (c == '.') {
- + c = *fmt++;
- + while (c >= '0' && c <= '9') {
- + current_fmt.precision = current_fmt.precision * 10 + (c - '0');
- + c = *fmt++;
- + }
- + if (c == '*') {
- + current_fmt.precision = va_arg(ap, int);
- + c = *fmt++;
- + }
- + }
- reswitch:
- /* At this point, fmt points at one past the format letter. */
- switch (c) {
- case '%':
- ! putc('%', current_fmt.iop);
- break;
-
- case 'D':
- ! putld(va_arg(ap, long), 10);
- break;
-
- case 'b':
- ***************
- *** 172,204 ****
- {
- Buffer *b = va_arg(ap, Buffer *);
-
- ! puts(leftadj, width, b->b_name);
- break;
- }
-
- case 'c':
- ! putc(va_arg(ap, int), curiop);
- break;
-
- case 'd':
- ! putld(leftadj, width, (long) va_arg(ap, int), 10);
- break;
-
- case 'f': /* current command name gets inserted here! */
- ! puts(leftadj, width, LastCmd->Name);
- break;
-
- case 'l':
- ! c = Upper(*++fmt);
- goto reswitch;
-
- case 'n':
- if (va_arg(ap, int) != 1)
- ! puts(leftadj, width, "s");
- break;
-
- case 'o':
- ! putld(leftadj, width, (long) va_arg(ap, int), 8);
- break;
-
- case 'p':
- --- 194,226 ----
- {
- Buffer *b = va_arg(ap, Buffer *);
-
- ! puts(b->b_name);
- break;
- }
-
- case 'c':
- ! putc(va_arg(ap, int), current_fmt.iop);
- break;
-
- case 'd':
- ! putld((long) va_arg(ap, int), 10);
- break;
-
- case 'f': /* current command name gets inserted here! */
- ! puts(LastCmd->Name);
- break;
-
- case 'l':
- ! c = CharUpcase(*++fmt);
- goto reswitch;
-
- case 'n':
- if (va_arg(ap, int) != 1)
- ! puts("s");
- break;
-
- case 'o':
- ! putld((long) va_arg(ap, int), 8);
- break;
-
- case 'p':
- ***************
- *** 206,217 ****
- char cbuf[20];
-
- PPchar(va_arg(ap, int), cbuf);
- ! puts(leftadj, width, cbuf);
- break;
- }
-
- case 's':
- ! puts(leftadj, width, va_arg(ap, char *));
- break;
-
- default:
- --- 228,239 ----
- char cbuf[20];
-
- PPchar(va_arg(ap, int), cbuf);
- ! puts(cbuf);
- break;
- }
-
- case 's':
- ! puts(va_arg(ap, char *));
- break;
-
- default:
- ***************
- *** 218,224 ****
- complain("Unknown format directive: \"%%%c\"", c);
- }
- }
- ! curiop = pushiop;
- }
-
- /* VARARGS1 */
- --- 240,246 ----
- complain("Unknown format directive: \"%%%c\"", c);
- }
- }
- ! current_fmt = prev_fmt;
- }
-
- /* VARARGS1 */
-