home *** CD-ROM | disk | FTP | other *** search
Text File | 1987-09-15 | 42.7 KB | 1,999 lines |
- diff -c ojove/fp.c jove/fp.c
- *** ojove/fp.c Thu Jul 16 09:14:23 1987
- --- jove/fp.c Fri Jun 12 10:30:44 1987
- ***************
- *** 7,12 ****
- --- 7,13 ----
-
- #include "jove.h"
- #include "io.h"
- + #include "ctype.h"
- #include "termcap.h"
- #include <sys/stat.h>
- #include <sys/file.h>
- ***************
- *** 14,22 ****
-
- #define MAXFILES 20 /* good enough for my purposes */
-
- ! static File _openfiles[MAXFILES] = {0};
-
- ! static File *
- f_alloc(name, flags, fd, buffer, buf_size)
- char *name,
- *buffer;
- --- 15,23 ----
-
- #define MAXFILES 20 /* good enough for my purposes */
-
- ! private File _openfiles[MAXFILES] = {0};
-
- ! private File *
- f_alloc(name, flags, fd, buffer, buf_size)
- char *name,
- *buffer;
- ***************
- *** 106,111 ****
- --- 107,114 ----
- return EOF;
- fp->f_ptr = fp->f_base;
- fp->f_cnt = read(fp->f_fd, fp->f_base, fp->f_bufsize);
- + while (fp->f_cnt == -1 && errno == EINTR)
- + fp->f_cnt = read(fp->f_fd, fp->f_base, fp->f_bufsize);
- if (fp->f_cnt == -1) {
- printf("[Read error %d]", errno);
- fp->f_flags |= F_ERR;
- ***************
- *** 147,152 ****
- --- 150,166 ----
- _flush(EOF, fp);
- }
-
- + f_seek(fp, offset)
- + register File *fp;
- + off_t offset;
- + {
- + if (fp->f_flags & F_WRITE)
- + flush(fp);
- + fp->f_cnt = 0; /* next read will filbuf(), next write
- + will flush() with no bad effects */
- + lseek(fp->f_fd, (long) offset, L_SET);
- + }
- +
- _flush(c, fp)
- register File *fp;
- {
- ***************
- *** 182,188 ****
- return EOF;
- while (((c = getc(fp)) != EOF) && (c != '\n')) {
- if (c == NULL)
- ! continue; /* sorry we don't read nulls */
- if (cp >= endp) {
- add_mess(" [Line too long]");
- rbell();
- --- 196,202 ----
- return EOF;
- while (((c = getc(fp)) != EOF) && (c != '\n')) {
- if (c == NULL)
- ! break; /* sorry we don't read nulls */
- if (cp >= endp) {
- add_mess(" [Line too long]");
- rbell();
- ***************
- *** 201,215 ****
- return NIL; /* this means okay */
- }
-
- /* Deals with output to the terminal, setting up the amount of characters
- to be buffered depending on the output baud rate. Why it's in a
- separate file I don't know ... */
-
- ! static char one_buf;
-
- int BufSize = 1;
-
- ! static File _stdout = {1, 1, 1, F_WRITE, &one_buf, &one_buf};
- File *stdout = &_stdout;
-
- /* put a string with padding */
- --- 215,264 ----
- return NIL; /* this means okay */
- }
-
- + /* skip to beginning of next line, i.e., next read returns first
- + character of new line */
- + f_toNL(fp)
- + register File *fp;
- + {
- + register int c;
- +
- + if (fp->f_flags & F_EOF)
- + return;
- + while (((c = getc(fp)) != EOF) && (c != '\n'))
- + ;
- + if (c == EOF)
- + fp->f_flags |= F_EOF;
- + }
- +
- + f_readn(fp, addr, n)
- + register File *fp;
- + register char *addr;
- + register int n;
- + {
- + while (--n >= 0)
- + *addr++ = getc(fp);
- + }
- +
- + f_getint(fp)
- + File *fp;
- + {
- + int n = 0,
- + c;
- +
- + while (isdigit(c = getc(fp)))
- + n = (n * 10) + c;
- + return n;
- + }
- +
- /* Deals with output to the terminal, setting up the amount of characters
- to be buffered depending on the output baud rate. Why it's in a
- separate file I don't know ... */
-
- ! private char one_buf;
-
- int BufSize = 1;
-
- ! private File _stdout = {1, 1, 1, F_WRITE, &one_buf, &one_buf};
- File *stdout = &_stdout;
-
- /* put a string with padding */
- diff -c ojove/funcdefs.c jove/funcdefs.c
- *** ojove/funcdefs.c Thu Jul 16 09:14:24 1987
- --- jove/funcdefs.c Fri Jun 12 12:25:57 1987
- ***************
- *** 6,11 ****
- --- 6,12 ----
- ************************************************************************/
-
- #include "jove.h"
- + #include "ctype.h"
-
- #ifndef TXT_TO_C
- extern int
- ***************
- *** 97,103 ****
- ForChar(),
- FSexpr(),
- ForWord(),
- ! FourTime(),
- GoLine(),
- GrowWindow(),
- IncFSearch(),
- --- 98,104 ----
- ForChar(),
- FSexpr(),
- ForWord(),
- ! TimesFour(),
- GoLine(),
- GrowWindow(),
- IncFSearch(),
- ***************
- *** 167,172 ****
- --- 168,174 ----
- SpelBuffer(),
- #endif
- SplitWind(),
- + GotoWind(),
- Remember(),
- Forget(),
- StrLength(),
- ***************
- *** 354,363 ****
- --- 356,367 ----
- FUNCTION, "forward-sentence", WIRED_CMD(Eos),
- FUNCTION, "forward-word", WIRED_CMD(ForWord),
- DefMajor(FUNDAMENTAL), "fundamental-mode", 0,
- + FUNCTION, "gather-numeric-argument", WIRED_CMD(TimesFour),
- #ifdef LISP
- FUNCTION, "grind-s-expr", WIRED_CMD(GSexpr),
- #endif
- FUNCTION, "goto-line", WIRED_CMD(GoLine),
- + FUNCTION, "goto-window-with-buffer", WIRED_CMD(GotoWind),
- FUNCTION, "grow-window", WIRED_CMD(GrowWindow),
- FUNCTION, "handle-tab", WIRED_CMD(Tab),
- FUNCTION, "i-search-forward", WIRED_CMD(IncFSearch),
- ***************
- *** 432,438 ****
- FUNCTION, "pushd", WIRED_CMD(Pushd),
- FUNCTION, "pwd", WIRED_CMD(prCWD),
- #endif
- - FUNCTION, "quadruple-numeric-argument", WIRED_CMD(FourTime),
- FUNCTION, "query-replace-string", WIRED_CMD(QRepSearch),
- #ifdef IPROCS
- FUNCTION, "quit-process", WIRED_CMD(ProcQuit),
- --- 436,441 ----
- ***************
- *** 520,530 ****
- struct cmd *which;
- int cmdlen,
- found = 0;
- ! static struct cmd *cmdhash[1 + 26];
- static int beenhere = NO;
-
- /* special case for prefix commands--only upper case ones */
- ! #define hash(c) ((c == 'P') ? 0 : 1 + (c - 'a'))
-
- /* initialize the hash table */
- if (beenhere == NO) {
- --- 523,533 ----
- struct cmd *which;
- int cmdlen,
- found = 0;
- ! static struct cmd *cmdhash[26];
- static int beenhere = NO;
-
- /* special case for prefix commands--only upper case ones */
- ! #define hash(c) (c - 'a')
-
- /* initialize the hash table */
- if (beenhere == NO) {
- ***************
- *** 539,546 ****
- }
-
- /* gather the cmd name */
- ! while (((c = getch()) != EOF) && !index(" \t\r\n", c))
- *cp++ = c;
- if (c == EOF)
- return 0;
- *cp = '\0';
- --- 542,552 ----
- }
-
- /* gather the cmd name */
- ! while (((c = getch()) != EOF) && !index(" \t\r\n", c)) {
- ! if (isupper(c))
- ! c = tolower(c);
- *cp++ = c;
- + }
- if (c == EOF)
- return 0;
- *cp = '\0';
- ***************
- *** 549,555 ****
- return 0;
-
- /* look it up (in the reduced search space) */
- ! for (cmd = cmdhash[hash(cmdbuf[0])]; cmd->Name[0] == cmdbuf[0]; cmd++) {
- if (strncmp(cmd->Name, cmdbuf, cmdlen) == 0) {
- if (strcmp(cmd->Name, cmdbuf) == 0)
- return (data_obj *) cmd;
- --- 555,562 ----
- return 0;
-
- /* look it up (in the reduced search space) */
- ! if (islower(cmdbuf[0]))
- ! for (cmd = cmdhash[hash(cmdbuf[0])]; cmd != 0 && cmd->Name[0] == cmdbuf[0]; cmd++) {
- if (strncmp(cmd->Name, cmdbuf, cmdlen) == 0) {
- if (strcmp(cmd->Name, cmdbuf) == 0)
- return (data_obj *) cmd;
- ***************
- *** 556,562 ****
- found++;
- which = cmd;
- }
- ! }
- if (found > 1)
- complain("[\"%s\" ambiguous]", cmdbuf);
- else if (found == 0)
- --- 563,569 ----
- found++;
- which = cmd;
- }
- ! }
- if (found > 1)
- complain("[\"%s\" ambiguous]", cmdbuf);
- else if (found == 0)
- ***************
- *** 565,581 ****
- return (data_obj *) which;
- } else {
- static char *strings[(sizeof commands) / sizeof (commands[0])];
- ! static int beenhere = 0;
- register int com;
-
- ! if (beenhere == 0) {
- register char **strs = strings;
- ! register struct cmd *c = commands;
-
- ! beenhere = 1;
- ! for (; c->Name; c++)
- *strs++ = c->Name;
- *strs = 0;
- }
-
- if ((com = complete(strings, prompt, CASEIND)) < 0)
- --- 572,588 ----
- return (data_obj *) which;
- } else {
- static char *strings[(sizeof commands) / sizeof (commands[0])];
- ! static int beenhere = NO;
- register int com;
-
- ! if (beenhere == NO) {
- register char **strs = strings;
- ! register struct cmd *c;
-
- ! for (c = commands; c->Name != 0; c++)
- *strs++ = c->Name;
- *strs = 0;
- + beenhere = YES;
- }
-
- if ((com = complete(strings, prompt, CASEIND)) < 0)
- diff -c ojove/insert.c jove/insert.c
- *** ojove/insert.c Thu Jul 16 09:14:25 1987
- --- jove/insert.c Fri Jul 10 09:25:50 1987
- ***************
- *** 96,108 ****
- incrmt = (tabstop - (dotcol % tabstop));
- if (dotcol + incrmt > goal)
- break;
- ! Insert('\t');
- dotcol += incrmt;
- }
- if (dotcol != goal)
- ! DoTimes(Insert(' '), (goal - dotcol));
- ! exp_p = NO;
- ! exp = 1;
- }
-
- SelfInsert()
- --- 96,106 ----
- incrmt = (tabstop - (dotcol % tabstop));
- if (dotcol + incrmt > goal)
- break;
- ! insert_c('\t', 1);
- dotcol += incrmt;
- }
- if (dotcol != goal)
- ! insert_c(' ', (goal - dotcol));
- }
-
- SelfInsert()
- ***************
- *** 116,132 ****
- register int num,
- i;
-
- ! for (i = 0, num = exp, exp = 1; i < num; i++) {
- int pos = calc_pos(linebuf, curchar);
-
- if (!eolp()) {
- if (linebuf[curchar] == '\t') {
- if ((pos + 1) == ((pos + tabstop) - (pos % tabstop)))
- ! DelNChar();
- } else
- ! DelNChar();
- }
- ! Insert(LastKeyStruck);
- }
- } else
- Insert(LastKeyStruck);
- --- 114,130 ----
- register int num,
- i;
-
- ! for (i = 0, num = arg_value(); i < num; i++) {
- int pos = calc_pos(linebuf, curchar);
-
- if (!eolp()) {
- if (linebuf[curchar] == '\t') {
- if ((pos + 1) == ((pos + tabstop) - (pos % tabstop)))
- ! del_char(FORWARD, 1);
- } else
- ! del_char(FORWARD, 1);
- }
- ! insert_c(LastKeyStruck, 1);
- }
- } else
- Insert(LastKeyStruck);
- ***************
- *** 139,151 ****
-
- Insert(c)
- {
- ! if (exp <= 0)
- return;
- modify();
- makedirty(curline);
- ! ins_c(c, linebuf, curchar, exp, LBSIZE);
- ! IFixMarks(curline, curchar, curline, curchar + exp);
- ! curchar += exp;
- }
-
- /* Tab in to the right place for C mode */
- --- 137,155 ----
-
- Insert(c)
- {
- ! insert_c(c, arg_value());
- ! }
- !
- ! /* insert character C N times at point */
- ! insert_c(c, n)
- ! {
- ! if (n <= 0)
- return;
- modify();
- makedirty(curline);
- ! ins_c(c, linebuf, curchar, n, LBSIZE);
- ! IFixMarks(curline, curchar, curline, curchar + n);
- ! curchar += n;
- }
-
- /* Tab in to the right place for C mode */
- ***************
- *** 159,165 ****
-
- ToIndent();
- if (dotchar > curchar)
- ! m = MakeMark(curline, dotchar, FLOATER);
- (void) lisp_indent();
- if (m) {
- ToMark(m);
- --- 163,169 ----
-
- ToIndent();
- if (dotchar > curchar)
- ! m = MakeMark(curline, dotchar, M_FLOATER);
- (void) lisp_indent();
- if (m) {
- ToMark(m);
- ***************
- *** 177,191 ****
-
- QuotChar()
- {
- ! int c;
- ! extern int alarmed; /* If waitfor had to wait. */
-
- ! c = waitchar();
- ! if (alarmed)
- message(key_strokes);
- ! if (c == CTL(J))
- ! LineInsert(exp);
- ! else if (c != CTL(@))
- Insert(c);
- }
-
- --- 181,195 ----
-
- QuotChar()
- {
- ! int c,
- ! slow;
-
- ! c = waitchar(&slow);
- ! if (slow)
- message(key_strokes);
- ! if (c == CTL('J'))
- ! LineInsert(arg_value());
- ! else if (c != CTL('@'))
- Insert(c);
- }
-
- ***************
- *** 215,224 ****
- #endif
- SelfInsert();
- if (MinorMode(ShowMatch) && !charp() && !in_macro()) {
- ! BackChar(); /* Back onto the ')' */
- if ((int) bp == -1)
- bp = m_paren(c, BACKWARD, NO, YES);
- ! ForChar();
- if (bp != 0) {
- nx = in_window(curwind, bp->p_line);
- if (nx != -1) { /* is visible */
- --- 219,228 ----
- #endif
- SelfInsert();
- if (MinorMode(ShowMatch) && !charp() && !in_macro()) {
- ! b_char(1); /* Back onto the ')' */
- if ((int) bp == -1)
- bp = m_paren(c, BACKWARD, NO, YES);
- ! f_char(1);
- if (bp != 0) {
- nx = in_window(curwind, bp->p_line);
- if (nx != -1) { /* is visible */
- ***************
- *** 264,279 ****
- #ifdef LISP
- if (MajorMode(LISPMODE))
- DelWtSpace();
- #endif
- ! else if (blnkp(linebuf))
- DelWtSpace();
-
- /* If there is more than 2 blank lines in a row then don't make
- a newline, just move down one. */
- ! if (exp == 1 && eolp() && TwoBlank())
- SetLine(curline->l_next);
- else
- ! LineInsert(exp);
-
- if (indentp)
- #ifdef LISP
- --- 268,284 ----
- #ifdef LISP
- if (MajorMode(LISPMODE))
- DelWtSpace();
- + else
- #endif
- ! if (blnkp(linebuf))
- DelWtSpace();
-
- /* If there is more than 2 blank lines in a row then don't make
- a newline, just move down one. */
- ! if (arg_value() == 1 && eolp() && TwoBlank())
- SetLine(curline->l_next);
- else
- ! LineInsert(arg_value());
-
- if (indentp)
- #ifdef LISP
- ***************
- *** 292,298 ****
- int llen;
-
- if (*str == 0)
- ! return; /* ain't nothing to insert! */
- DOTsave(&save);
- llen = strlen(linebuf);
- while (c = *str++) {
- --- 297,303 ----
- int llen;
-
- if (*str == 0)
- ! return; /* ain't nothing to insert! */
- DOTsave(&save);
- llen = strlen(linebuf);
- while (c = *str++) {
- ***************
- *** 314,328 ****
- makedirty(curline);
- }
-
- ! OpenLine()
- {
- Bufpos dot;
-
- DOTsave(&dot);
- ! LineInsert(exp); /* Open the lines... */
- SetDot(&dot);
- }
-
- /* Take the region FLINE/FCHAR to TLINE/TCHAR and insert it at
- ATLINE/ATCHAR in WHATBUF. */
-
- --- 319,338 ----
- makedirty(curline);
- }
-
- ! open_lines(n)
- {
- Bufpos dot;
-
- DOTsave(&dot);
- ! LineInsert(n); /* Open the lines... */
- SetDot(&dot);
- }
-
- + OpenLine()
- + {
- + open_lines(arg_value());
- + }
- +
- /* Take the region FLINE/FCHAR to TLINE/TCHAR and insert it at
- ATLINE/ATCHAR in WHATBUF. */
-
- ***************
- *** 392,398 ****
-
- /* Now must find a recently killed region. */
-
- ! if (exp < 0)
- dir = 1;
-
- killptr += dir;
- --- 402,408 ----
-
- /* Now must find a recently killed region. */
-
- ! if (arg_value() < 0)
- dir = 1;
-
- killptr += dir;
- ***************
- *** 468,474 ****
- }
- }
-
- ! static
- newchunk()
- {
- register Line *newline;
- --- 478,484 ----
- }
- }
-
- ! private
- newchunk()
- {
- register Line *newline;
- ***************
- *** 520,526 ****
- /* Remove the free lines, in chunk c, from the free list because they are
- no longer free. */
-
- ! static
- remfreelines(c)
- register struct chunk *c;
- {
- --- 530,536 ----
- /* Remove the free lines, in chunk c, from the free list because they are
- no longer free. */
-
- ! private
- remfreelines(c)
- register struct chunk *c;
- {
- ***************
- *** 584,595 ****
- DOTsave(&dot);
- FSexpr();
- DOTsave(&end);
- - exp = 1;
- SetDot(&dot);
- for (;;) {
- if (curline == end.p_line)
- break;
- ! line_move(FORWARD, NO);
- if (!blnkp(linebuf))
- (void) lisp_indent();
- }
- --- 594,604 ----
- DOTsave(&dot);
- FSexpr();
- DOTsave(&end);
- SetDot(&dot);
- for (;;) {
- if (curline == end.p_line)
- break;
- ! line_move(FORWARD, 1, NO);
- if (!blnkp(linebuf))
- (void) lisp_indent();
- }
- ***************
- *** 656,662 ****
-
- DOTsave(&savedot);
- SetDot(bp);
- ! DoTimes(ForChar(), 1);
- if (linebuf[curchar] != '(') {
- register Word *wp;
-
- --- 665,671 ----
-
- DOTsave(&savedot);
- SetDot(bp);
- ! f_char(1);
- if (linebuf[curchar] != '(') {
- register Word *wp;
-
- ***************
- *** 669,675 ****
- int c_char = curchar;
-
- WITH_TABLE(curbuf->b_major)
- ! ForWord();
- END_TABLE();
- if (LookingAt("[ \t]*;\\|[ \t]*$", linebuf, curchar))
- curchar = c_char;
- --- 678,684 ----
- int c_char = curchar;
-
- WITH_TABLE(curbuf->b_major)
- ! f_word(1);
- END_TABLE();
- if (LookingAt("[ \t]*;\\|[ \t]*$", linebuf, curchar))
- curchar = c_char;
- diff -c ojove/io.c jove/io.c
- *** ojove/io.c Thu Jul 16 09:14:28 1987
- --- jove/io.c Fri Jun 19 16:00:59 1987
- ***************
- *** 107,115 ****
- }
- DOTsave(&save);
- dofread(fp);
- ! SetDot(&save);
- ! if (is_insert && io_chars > 0)
- modify();
- getDOT();
- close_file(fp);
- }
- --- 107,117 ----
- }
- DOTsave(&save);
- dofread(fp);
- ! if (is_insert && io_chars > 0) {
- modify();
- + set_mark();
- + }
- + SetDot(&save);
- getDOT();
- close_file(fp);
- }
- ***************
- *** 121,127 ****
- int xeof = 0;
- Line *savel = curline;
- int savec = curchar;
- ! disk_line f_getputl() ;
-
- strcpy(end, linebuf + curchar);
- xeof = f_gets(fp, linebuf + curchar, LBSIZE - curchar);
- --- 123,129 ----
- int xeof = 0;
- Line *savel = curline;
- int savec = curchar;
- ! extern disk_line f_getputl();
-
- strcpy(end, linebuf + curchar);
- xeof = f_gets(fp, linebuf + curchar, LBSIZE - curchar);
- ***************
- *** 157,169 ****
- #ifndef CHDIR
-
- char *
- ! pr_name(fname)
- char *fname;
- {
- if (fname == 0)
- return 0;
-
- ! if (strncmp(fname, HomeDir, HomeLen) == 0) {
- static char name_buf[100];
-
- sprintf(name_buf, "~%s", fname + HomeLen);
- --- 159,171 ----
- #ifndef CHDIR
-
- char *
- ! pr_name(fname, okay_home)
- char *fname;
- {
- if (fname == 0)
- return 0;
-
- ! if (okay_home == YES && strncmp(fname, HomeDir, HomeLen) == 0) {
- static char name_buf[100];
-
- sprintf(name_buf, "~%s", fname + HomeLen);
- ***************
- *** 188,194 ****
- }
-
- char *
- ! pr_name(fname)
- char *fname;
- {
- int n;
- --- 190,196 ----
- }
-
- char *
- ! pr_name(fname, okay_home)
- char *fname;
- {
- int n;
- ***************
- *** 201,207 ****
- (fname[n] == '/'))
- return fname + n + 1;
-
- ! if (strcmp(HomeDir, "/") != 0 && strncmp(fname, HomeDir, HomeLen) == 0) {
- static char name_buf[100];
-
- sprintf(name_buf, "~%s", fname + HomeLen);
- --- 203,209 ----
- (fname[n] == '/'))
- return fname + n + 1;
-
- ! if (okay_home == YES && strcmp(HomeDir, "/") != 0 && strncmp(fname, HomeDir, HomeLen) == 0) {
- static char name_buf[100];
-
- sprintf(name_buf, "~%s", fname + HomeLen);
- ***************
- *** 256,268 ****
-
- getCWD()
- {
- ! char *cwd = getenv("CWD");
- #ifdef JOB_CONTROL
- extern char *getwd();
- char pathname[FILESIZE];
- #endif
-
- if (cwd == 0)
- #ifdef JOB_CONTROL
- cwd = getwd(pathname);
- #else
- --- 258,273 ----
-
- getCWD()
- {
- ! char *cwd;
- #ifdef JOB_CONTROL
- extern char *getwd();
- char pathname[FILESIZE];
- #endif
-
- + cwd = getenv("CWD");
- if (cwd == 0)
- + cwd = getenv("PWD");
- + if (cwd == 0)
- #ifdef JOB_CONTROL
- cwd = getwd(pathname);
- #else
- ***************
- *** 278,284 ****
-
- s_mess(": %f ");
- for (i = DirSP; i >= 0; i--)
- ! add_mess("%s ", pr_name(DirStack[i]));
- }
-
- prCWD()
- --- 283,289 ----
-
- s_mess(": %f ");
- for (i = DirSP; i >= 0; i--)
- ! add_mess("%s ", pr_name(DirStack[i], YES));
- }
-
- prCWD()
- ***************
- *** 339,344 ****
- --- 344,350 ----
- return offset;
- }
-
- + private
- dfollow(file, into)
- char *file,
- *into;
- ***************
- *** 377,382 ****
- --- 383,389 ----
-
- #endif CHDIR
-
- + private
- get_hdir(user, buf)
- register char *user,
- *buf;
- ***************
- *** 453,464 ****
-
- WrtReg()
- {
- ! DoWriteReg(0);
- }
-
- AppReg()
- {
- ! DoWriteReg(1);
- }
-
- int CreatMode = DFLT_MODE;
- --- 460,471 ----
-
- WrtReg()
- {
- ! DoWriteReg(NO);
- }
-
- AppReg()
- {
- ! DoWriteReg(YES);
- }
-
- int CreatMode = DFLT_MODE;
- ***************
- *** 474,480 ****
- fname = ask_file((char *) 0, (char *) 0, fnamebuf);
-
- #ifdef BACKUPFILES
- ! if (!app) {
- filemunge(fname);
-
- if (BkupOnWrite)
- --- 481,487 ----
- fname = ask_file((char *) 0, (char *) 0, fnamebuf);
-
- #ifdef BACKUPFILES
- ! if (app == NO) {
- filemunge(fname);
-
- if (BkupOnWrite)
- ***************
- *** 511,522 ****
-
- chk_mtime(curbuf, fname, "write");
- filemunge(fname);
- ! curbuf->b_type = B_FILE; /* In case it wasn't before. */
- setfname(curbuf, fname);
- file_write(fname, 0);
- unmodify();
- }
-
- File *
- open_file(fname, buf, how, ifbad, loudness)
- register char *fname;
- --- 518,545 ----
-
- chk_mtime(curbuf, fname, "write");
- filemunge(fname);
- ! curbuf->b_type = B_FILE; /* in case it wasn't before */
- setfname(curbuf, fname);
- file_write(fname, 0);
- unmodify();
- }
-
- + /* Open file FNAME supplying the buffer IO routine with buffer BUF.
- + HOW is F_READ, F_WRITE or F_APPEND. IFBAD == COMPLAIN means that
- + if we fail at opening the file, call complain. LOUDNESS says
- + whether or not to print the "reading ..." message on the message
- + line.
- +
- + NOTE: This opens the pr_name(fname, NO) of fname. That is, FNAME
- + is usually an entire pathname, which can be slow when the
- + pathname is long and there are lots of symbolic links along
- + the way (which has become very common in my experience). So,
- + this speeds up opens file names in the local directory. It
- + will not speed up things like "../scm/foo.scm" simple because
- + by the time we get here that's already been expanded to an
- + absolute pathname. But this is a start.
- + */
- +
- File *
- open_file(fname, buf, how, ifbad, loudness)
- register char *fname;
- ***************
- *** 529,535 ****
- io_lines = 0;
- tellall = loudness;
-
- ! fp = f_open(fname, how, buf, LBSIZE);
- if (fp == NIL) {
- message(IOerr((how == F_READ) ? "open" : "create", fname));
- if (ifbad == COMPLAIN)
- --- 552,558 ----
- io_lines = 0;
- tellall = loudness;
-
- ! fp = f_open(pr_name(fname, NO), how, buf, LBSIZE);
- if (fp == NIL) {
- message(IOerr((how == F_READ) ? "open" : "create", fname));
- if (ifbad == COMPLAIN)
- ***************
- *** 537,547 ****
- } else {
- int readonly = FALSE;
-
- ! if (access(fname, W_OK) == -1 && errno != ENOENT)
- readonly = TRUE;
-
- if (loudness != QUIET)
- ! f_mess("\"%s\"%s", pr_name(fname),
- readonly ? " [Read only]" : NullStr);
- }
- return fp;
- --- 560,570 ----
- } else {
- int readonly = FALSE;
-
- ! if (access(pr_name(fname, NO), W_OK) == -1 && errno != ENOENT)
- readonly = TRUE;
-
- if (loudness != QUIET)
- ! f_mess("\"%s\"%s", pr_name(fname, YES),
- readonly ? " [Read only]" : NullStr);
- }
- return fp;
- ***************
- *** 552,559 ****
- doing.
-
- I hate to use another stat(), but to use confirm we gotta
- ! do this before we open the file. */
-
- chk_mtime(thisbuf, fname, how)
- Buffer *thisbuf;
- char *fname,
- --- 575,586 ----
- doing.
-
- I hate to use another stat(), but to use confirm we gotta
- ! do this before we open the file.
-
- + NOTE: This stats FNAME after converting it to a path-relative
- + name. I can't see why this would cause a problem ...
- + */
- +
- chk_mtime(thisbuf, fname, how)
- Buffer *thisbuf;
- char *fname,
- ***************
- *** 566,577 ****
- if ((thisbuf->b_mtime != 0) && /* if we care ... */
- (b = file_exists(fname)) && /* we already have this file */
- (b == thisbuf) && /* and it's the current buffer */
- ! (stat(fname, &stbuf) != -1) && /* and we can stat it */
- (stbuf.st_mtime != b->b_mtime)) { /* and there's trouble. */
- rbell();
- redisplay(); /* Ring that bell! */
- TOstart("Warning", TRUE);
- ! Typeout("\"%s\" now saved on disk is not what you last", pr_name(fname));
- Typeout("visited or saved. Probably someone else is editing");
- Typeout("your file at the same time.");
- if (how) {
- --- 593,604 ----
- if ((thisbuf->b_mtime != 0) && /* if we care ... */
- (b = file_exists(fname)) && /* we already have this file */
- (b == thisbuf) && /* and it's the current buffer */
- ! (stat(pr_name(fname, NO), &stbuf) != -1) && /* and we can stat it */
- (stbuf.st_mtime != b->b_mtime)) { /* and there's trouble. */
- rbell();
- redisplay(); /* Ring that bell! */
- TOstart("Warning", TRUE);
- ! Typeout("\"%s\" now saved on disk is not what you last", pr_name(fname, YES));
- Typeout("visited or saved. Probably someone else is editing");
- Typeout("your file at the same time.");
- if (how) {
- ***************
- *** 626,632 ****
- for (;;) {
- rbell();
- y_or_n = ask(NullStr, "Shall I make your changes to \"%s\" permanent? ", curbuf->b_name);
- ! c = Upper(*y_or_n);
- if (c == 'Y' || c == 'N')
- break;
- }
- --- 653,659 ----
- for (;;) {
- rbell();
- y_or_n = ask(NullStr, "Shall I make your changes to \"%s\" permanent? ", curbuf->b_name);
- ! c = CharUpcase(*y_or_n);
- if (c == 'Y' || c == 'N')
- break;
- }
- ***************
- *** 658,664 ****
-
- private int nleft, /* number of good characters left in current block */
- tmpfd = -1;
- ! private disk_line DFree = 1;
- /* pointer to end of tmp file */
- private char *tfname;
-
- --- 685,691 ----
-
- private int nleft, /* number of good characters left in current block */
- tmpfd = -1;
- ! disk_line DFree = 1;
- /* pointer to end of tmp file */
- private char *tfname;
-
- ***************
- *** 682,691 ****
- (void) unlink(tfname);
- }
-
- ! /* Get a line at `tl' in the tmp file into `buf' which should be LBSIZE
- ! long. */
-
- ! int Jr_Len; /* Length of Just Read Line. */
- private char *getblock();
-
- getline(addr, buf)
- --- 709,718 ----
- (void) unlink(tfname);
- }
-
- ! /* get a line at `tl' in the tmp file into `buf' which should be LBSIZE
- ! long */
-
- ! int Jr_Len; /* length of Just Read Line */
- private char *getblock();
-
- getline(addr, buf)
- diff -c ojove/iproc-pipes.c jove/iproc-pipes.c
- *** ojove/iproc-pipes.c Thu Jul 16 09:14:30 1987
- --- jove/iproc-pipes.c Thu Jun 25 10:02:30 1987
- ***************
- *** 13,20 ****
- #include <signal.h>
- #include <sgtty.h>
-
- - typedef struct process Process;
- -
- #define DEAD 1 /* Dead but haven't informed user yet */
- #define STOPPED 2 /* Job stopped */
- #define RUNNING 3 /* Just running */
- --- 13,18 ----
- ***************
- *** 25,30 ****
- --- 23,29 ----
- #define KILLED 2
-
- #define isdead(p) (p == 0 || proc_state(p) == DEAD || p->p_toproc == -1)
- + #define makedead(p) (proc_state(p) = DEAD)
-
- #define proc_buf(p) (p->p_buffer->b_name)
- #define proc_cmd(p) (p->p_name)
- ***************
- *** 36,42 ****
- ProcOutput,
- NumProcs = 0;
-
- ! static char *
- pstate(p)
- Process *p;
- {
- --- 35,41 ----
- ProcOutput,
- NumProcs = 0;
-
- ! char *
- pstate(p)
- Process *p;
- {
- ***************
- *** 54,65 ****
- if (p->p_howdied == EXITED) {
- if (p->p_reason == 0)
- return "Done";
- ! return sprint("[Exit %d]", p->p_reason);
- }
- ! return sprint("[Killed %d]", p->p_reason);
-
- default:
- ! return "Unknown state.";
- }
- }
-
- --- 53,64 ----
- if (p->p_howdied == EXITED) {
- if (p->p_reason == 0)
- return "Done";
- ! return sprint("Exit %d", p->p_reason);
- }
- ! return sprint("Killed %d", p->p_reason);
-
- default:
- ! return "Unknown state";
- }
- }
-
- ***************
- *** 98,104 ****
- finish(1);
- read_proc(header.pid, header.nbytes);
- }
- - redisplay();
- here = 0;
- sigrelse(SIGCHLD);
- }
- --- 97,102 ----
- ***************
- *** 126,132 ****
- }
-
- if (nbytes == EOF) { /* Okay to clean up this process */
- ! p->p_eof = 1;
- NumProcs--; /* As far as getch() in main is concerned */
- return;
- }
- --- 124,130 ----
- }
-
- if (nbytes == EOF) { /* Okay to clean up this process */
- ! proc_close(p);
- NumProcs--; /* As far as getch() in main is concerned */
- return;
- }
- ***************
- *** 155,166 ****
- proc_kill(curbuf->b_process, SIGQUIT);
- }
-
- ! static
- proc_close(p)
- Process *p;
- {
- (void) close(p->p_toproc);
- ! p->p_toproc = -1; /* Writes will fail. */
- }
-
- do_rtp(mp)
- --- 153,164 ----
- proc_kill(curbuf->b_process, SIGQUIT);
- }
-
- ! private
- proc_close(p)
- Process *p;
- {
- (void) close(p->p_toproc);
- ! p->p_toproc = -1; /* writes will fail */
- }
-
- do_rtp(mp)
- ***************
- *** 228,234 ****
- (void) dup2(ProcOutput, 1);
- (void) dup2(ProcOutput, 2);
- pclose(toproc);
- ! execv(Portsrv, args);
- printf("Execl failed.\n");
- _exit(1);
- }
- --- 226,232 ----
- (void) dup2(ProcOutput, 1);
- (void) dup2(ProcOutput, 2);
- pclose(toproc);
- ! execv(Portsrv, argv);
- printf("Execl failed.\n");
- _exit(1);
- }
- ***************
- *** 260,270 ****
- /* Pop_wind() after everything is set up; important!
- Bindings won't work right unless newbuf->b_process is already
- set up BEFORE NEWBUF is first SetBuf()'d. */
- ! newp->p_mark = MakeMark(curline, curchar, FLOATER);
-
- newp->p_toproc = toproc[1];
- newp->p_reason = 0;
- - newp->p_eof = 0;
- NumProcs++;
- (void) close(toproc[0]);
- sigrelse(SIGCHLD);
- --- 258,267 ----
- /* Pop_wind() after everything is set up; important!
- Bindings won't work right unless newbuf->b_process is already
- set up BEFORE NEWBUF is first SetBuf()'d. */
- ! newp->p_mark = MakeMark(curline, curchar, M_FLOATER);
-
- newp->p_toproc = toproc[1];
- newp->p_reason = 0;
- NumProcs++;
- (void) close(toproc[0]);
- sigrelse(SIGCHLD);
- diff -c ojove/iproc-ptys.c jove/iproc-ptys.c
- *** ojove/iproc-ptys.c Thu Jul 16 09:14:31 1987
- --- jove/iproc-ptys.c Thu Jun 25 10:01:44 1987
- ***************
- *** 12,17 ****
- --- 12,18 ----
- #endif
- #include <signal.h>
- #include <sgtty.h>
- + #include <errno.h>
-
- #define DEAD 1 /* Dead but haven't informed user yet */
- #define STOPPED 2 /* Job stopped */
- ***************
- *** 23,28 ****
- --- 24,30 ----
- #define KILLED 2
-
- #define isdead(p) (p == 0 || proc_state(p) == DEAD || p->p_fd == -1)
- + #define makedead(p) (proc_state(p) = DEAD)
-
- #define proc_buf(p) (p->p_buffer->b_name)
- #define proc_cmd(p) (p->p_name)
- ***************
- *** 45,51 ****
- extern struct ltchars ls1;
- #endif
-
- ! static char *
- pstate(p)
- Process *p;
- {
- --- 47,53 ----
- extern struct ltchars ls1;
- #endif
-
- ! char *
- pstate(p)
- Process *p;
- {
- ***************
- *** 60,71 ****
- if (p->p_howdied == EXITED) {
- if (p->p_reason == 0)
- return "Done";
- ! return sprint("exit(%d)", p->p_reason);
- }
- ! return sprint("Killed(%d)", p->p_reason);
-
- default:
- ! return "Unknown state.";
- }
- }
-
- --- 62,73 ----
- if (p->p_howdied == EXITED) {
- if (p->p_reason == 0)
- return "Done";
- ! return sprint("Exit %d", p->p_reason);
- }
- ! return sprint("Killed %d", p->p_reason);
-
- default:
- ! return "Unknown state";
- }
- }
-
- ***************
- *** 98,111 ****
- }
-
- n = read(fd, ibuf, sizeof(ibuf) - 1);
- ! if (n == 0) {
- ! proc_close(p);
- ! NumProcs--;
- return;
- }
- ibuf[n] = '\0';
- proc_rec(p, ibuf);
- - redisplay();
- }
-
- ProcKill()
- --- 100,123 ----
- }
-
- n = read(fd, ibuf, sizeof(ibuf) - 1);
- ! /* NOTE: This read somethings returns -1 when it's the first time
- ! we're reading the socket. Errno was set to I/O error or something
- ! bizarre like that. So, I'm choosing to ignore this. I ignored
- ! it before, and what happened was random text was being inserted
- ! at the beginning of the buffer because the ibuf[n] = '\0' wasn't
- ! working right (ibuf[-1] = '\0'). */
- ! if (n == -1 && errno == EIO)
- return;
- + if (n <= 0) {
- + if (n == 0) {
- + makedead(p);
- + return;
- + }
- + sprintf(ibuf, "\n[pty read error: %d]\n", errno);
- + n = strlen(ibuf);
- }
- ibuf[n] = '\0';
- proc_rec(p, ibuf);
- }
-
- ProcKill()
- ***************
- *** 171,183 ****
- (void) write(p->p_fd, &c, 1);
- }
-
- ! static
- proc_close(p)
- Process *p;
- {
- (void) close(p->p_fd);
- global_fd &= ~(1 << p->p_fd);
- - p->p_eof++;
- }
-
- do_rtp(mp)
- --- 183,194 ----
- (void) write(p->p_fd, &c, 1);
- }
-
- ! private
- proc_close(p)
- Process *p;
- {
- (void) close(p->p_fd);
- global_fd &= ~(1 << p->p_fd);
- }
-
- do_rtp(mp)
- ***************
- *** 216,222 ****
- va_list ap;
- char *argv[32],
- *cp;
- ! Window *owind = curwind;
- int pid;
- Process *newp;
- Buffer *newbuf;
- --- 227,233 ----
- va_list ap;
- char *argv[32],
- *cp;
- ! Window *owind = curwind;
- int pid;
- Process *newp;
- Buffer *newbuf;
- ***************
- *** 348,354 ****
-
- newp->p_fd = ttyfd;
- newp->p_pid = pid;
- - newp->p_eof = 0;
-
- newbuf = do_select((Window *) 0, bufname);
- newbuf->b_type = B_PROCESS;
- --- 359,364 ----
- ***************
- *** 371,377 ****
- newp->p_name = copystr(cmdbuf);
- newp->p_state = RUNNING;
- newp->p_reason = 0;
- ! newp->p_mark = MakeMark(curline, curchar, FLOATER);
-
- newp->p_next = procs;
- procs = newp;
- --- 381,387 ----
- newp->p_name = copystr(cmdbuf);
- newp->p_state = RUNNING;
- newp->p_reason = 0;
- ! newp->p_mark = MakeMark(curline, curchar, M_FLOATER);
-
- newp->p_next = procs;
- procs = newp;
- diff -c ojove/iproc.c jove/iproc.c
- *** ojove/iproc.c Thu Jul 16 09:14:32 1987
- --- jove/iproc.c Wed Jun 24 12:52:13 1987
- ***************
- *** 30,36 ****
- if (!isdead(p)) {
- if (killem == -1) {
- yorn = ask("y", "Should I kill your i-processes? ");
- ! killem = (Upper(*yorn) == 'Y');
- }
- if (killem)
- proc_kill(p, SIGKILL);
- --- 30,36 ----
- if (!isdead(p)) {
- if (killem == -1) {
- yorn = ask("y", "Should I kill your i-processes? ");
- ! killem = (CharUpcase(*yorn) == 'Y');
- }
- if (killem)
- proc_kill(p, SIGKILL);
- ***************
- *** 50,56 ****
- /* Process receive: receives the characters in buf, and appends them to
- the buffer associated with p. */
-
- ! static
- proc_rec(p, buf)
- register Process *p;
- char *buf;
- --- 50,56 ----
- /* Process receive: receives the characters in buf, and appends them to
- the buffer associated with p. */
-
- ! private
- proc_rec(p, buf)
- register Process *p;
- char *buf;
- ***************
- *** 68,88 ****
- if (w != 0)
- do_disp = (in_window(w, p->p_mark->m_line) != -1);
- SetBuf(p->p_buffer);
- ! savepoint = MakeMark(curline, curchar, FLOATER);
- ! ToMark(p->p_mark); /* Where output last stopped. */
- if (savepoint->m_line == curline && savepoint->m_char == curchar)
- sameplace++;
-
- ins_str(buf, YES);
- if (do_disp) {
- w->w_line = curline;
- w->w_char = curchar;
- redisplay();
- }
- - MarkSet(p->p_mark, curline, curchar);
- - if (!sameplace)
- - ToMark(savepoint); /* Back to where we were. */
- - DelMark(savepoint);
- SetBuf(saveb);
- }
-
- --- 68,91 ----
- if (w != 0)
- do_disp = (in_window(w, p->p_mark->m_line) != -1);
- SetBuf(p->p_buffer);
- ! savepoint = MakeMark(curline, curchar, M_FLOATER);
- ! ToMark(p->p_mark); /* where output last stopped */
- if (savepoint->m_line == curline && savepoint->m_char == curchar)
- sameplace++;
-
- ins_str(buf, YES);
- + MarkSet(p->p_mark, curline, curchar);
- + if (!sameplace)
- + ToMark(savepoint); /* back to where we were */
- + DelMark(savepoint);
- + /* redisplay now, instead of right after the ins_str, so that
- + we don't get a bouncing effect if point is not the same as
- + the process output position */
- if (do_disp) {
- w->w_line = curline;
- w->w_char = curchar;
- redisplay();
- }
- SetBuf(saveb);
- }
-
- ***************
- *** 95,105 ****
- s_mess("Cannot kill %s!", proc_buf(p));
- }
-
- ! /* Deal with a process' death. proc_rec turns on the FREEUP bit when it
- ! it gets the "EOF" from portsrv. FREEUP'd processes get unlinked from
- ! the list, and the proc stucture and proc_buf(p) get free'd up, here. */
-
- - private
- DealWDeath()
- {
- register Process *p,
- --- 98,107 ----
- s_mess("Cannot kill %s!", proc_buf(p));
- }
-
- ! /* Deal with a process' death. Go through all processes and find
- ! the ones which have gotten EOF. Delete them from the list and
- ! free up the memory, and insert a status string. */
-
- DealWDeath()
- {
- register Process *p,
- ***************
- *** 108,114 ****
-
- for (p = procs; p != 0; p = next) {
- next = p->p_next;
- ! if (!p->p_eof) {
- prev = p;
- continue;
- }
- --- 110,116 ----
-
- for (p = procs; p != 0; p = next) {
- next = p->p_next;
- ! if (p->p_state != DEAD) {
- prev = p;
- continue;
- }
- ***************
- *** 130,135 ****
- --- 132,138 ----
- char *fmt = "%-15s %-15s %-8s %s",
- pidstr[10];
-
- + DealWDeath();
- if (procs == 0) {
- message("[No subprocesses]");
- return;
- ***************
- *** 142,148 ****
- sprintf(pidstr, "%d", p->p_pid);
- Typeout(fmt, proc_buf(p), pstate(p), pidstr, p->p_name);
- }
- - DealWDeath();
- TOstop();
- }
-
- --- 145,150 ----
- ***************
- *** 160,168 ****
- --- 162,193 ----
- SendData(newlinep)
- {
- register Process *p = curbuf->b_process;
- + register char *lp,
- + *gp; /* JF fix for better prompt handling */
-
- if (isdead(p))
- return;
- + /* If the process mark was involved in a big deletion, because
- + the user hit ^W or something, then let's do some magic with
- + the process mark. Problem is that if the user yanks back the
- + text he deleted, the mark stays at the beginning of the region,
- + and so the next time SendData() is called the entire region
- + will be sent. That's not good. So, to deal with that we reset
- + the mark to the last line, after skipping over the prompt, etc. */
- + if (p->p_mark->m_flags & M_BIG_DELETE) {
- + Bufpos bp;
- +
- + p->p_mark->m_flags &= ~M_BIG_DELETE;
- +
- + DOTsave(&bp);
- + ToLast();
- + Bol();
- + while (LookingAt(proc_prompt, linebuf, curchar))
- + SetDot(dosearch(proc_prompt, 1, 1));
- + MarkSet(p->p_mark, curline, curchar);
- + SetDot(&bp);
- + }
- +
- if (lastp(curline)) {
- Eol();
- if (newlinep)
- ***************
- *** 174,181 ****
- while (LookingAt(proc_prompt, linebuf, curchar))
- SetDot(dosearch(proc_prompt, 1, 1));
- strcpy(genbuf, linebuf + curchar);
- ! ToLast();
- ! ins_str(genbuf, NO);
- }
- }
-
- --- 199,210 ----
- while (LookingAt(proc_prompt, linebuf, curchar))
- SetDot(dosearch(proc_prompt, 1, 1));
- strcpy(genbuf, linebuf + curchar);
- ! Eof();
- ! gp = genbuf;
- ! lp = linebuf;
- ! while (*lp == *gp && *lp != '\0')
- ! lp++, gp++;
- ! ins_str(gp, NO);
- }
- }
-
- ***************
- *** 222,233 ****
- register int pid;
- union wait w;
- {
- - char str[128];
- register Process *child;
-
- if ((child = proc_pid(pid)) == 0)
- return;
-
- if (WIFSTOPPED(w))
- child->p_state = STOPPED;
- else {
- --- 251,262 ----
- register int pid;
- union wait w;
- {
- register Process *child;
-
- if ((child = proc_pid(pid)) == 0)
- return;
-
- + UpdModLine = YES; /* we're changing state ... */
- if (WIFSTOPPED(w))
- child->p_state = STOPPED;
- else {
- ***************
- *** 238,249 ****
- child->p_reason = w.w_termsig;
- child->p_howdied = KILLED;
- }
- ! proc_close(child);
- }
- - sprintf(str, "[Process %s: %s]\n",
- - proc_cmd(child),
- - pstate(child));
- - proc_rec(child, str);
- }
-
- /* Push/pod process bindings. I openly acknowledge that this is a
- --- 267,286 ----
- child->p_reason = w.w_termsig;
- child->p_howdied = KILLED;
- }
- ! {
- ! Buffer *save = curbuf;
- ! char mesg[128];
- !
- ! /* insert status message now */
- ! sprintf(mesg, "[Process %s: %s]\n",
- ! proc_cmd(child),
- ! pstate(child));
- ! SetBuf(child->p_buffer);
- ! ins_str(mesg, NO);
- ! SetBuf(save);
- ! redisplay();
- ! }
- }
- }
-
- /* Push/pod process bindings. I openly acknowledge that this is a
- diff -c ojove/jove.c jove/jove.c
- *** ojove/jove.c Thu Jul 16 09:14:35 1987
- --- jove/jove.c Fri Jul 10 09:25:50 1987
- ***************
- *** 20,27 ****
- #include <sgtty.h>
- #else
- #include <termio.h>
- - #endif SYSV
- #include <fcntl.h>
-
- #ifdef TIOCSLTC
- struct ltchars ls1,
- --- 20,27 ----
- #include <sgtty.h>
- #else
- #include <termio.h>
- #include <fcntl.h>
- + #endif SYSV
-
- #ifdef TIOCSLTC
- struct ltchars ls1,
- ***************
- *** 62,71 ****
- int CoreDump = (code != 0 && code != SIGHUP),
- DelTmps = 1; /* Usually we delete them. */
-
- - #ifdef LSRHS
- - if (CoreDump)
- - setdump(1);
- - #endif
- if (code == SIGINT) {
- char c;
-
- --- 62,67 ----
- ***************
- *** 106,114 ****
- if (CoreDump)
- abort();
- #ifdef PROFILING
- ! exit(exp_p);
- #else
- ! _exit(exp_p);
- #endif
- }
-
- --- 102,110 ----
- if (CoreDump)
- abort();
- #ifdef PROFILING
- ! exit(0);
- #else
- ! _exit(0);
- #endif
- }
-
- ***************
- *** 137,143 ****
- }
- if (fcntl(fd, F_SETFL, on ? blockf : nonblockf) == -1)
- finish(SIGHUP);
- - return;
- }
- #endif SYSV
-
- --- 133,138 ----
- ***************
- *** 399,405 ****
- }
-
- int OKXonXoff = 0, /* ^S and ^Q initially DON'T work */
- ! IntChar = CTL(]);
-
- ttsize()
- {
- --- 394,400 ----
- }
-
- int OKXonXoff = 0, /* ^S and ^Q initially DON'T work */
- ! IntChar = CTL(']');
-
- ttsize()
- {
- ***************
- *** 500,505 ****
- --- 495,502 ----
- TABS = !((sg1.c_oflag & TAB3) == TAB3);
- ospeed = sg1.c_cflag & CBAUD;
-
- + if (OKXonXoff)
- + sg2.c_iflag &= ~(IXON | IXOFF);
- sg2.c_iflag &= ~(INLCR|ICRNL|IGNCR);
- sg2.c_lflag &= ~(ISIG|ICANON|ECHO);
- sg2.c_oflag &= ~(OCRNL|ONLCR);
- ***************
- *** 584,591 ****
-
- if (cp == 0) {
- rbell();
- ! exp = 1;
- ! exp_p = errormsg = NO;
- message(NullStr);
- } else
- ExecCmd(cp);
- --- 581,588 ----
-
- if (cp == 0) {
- rbell();
- ! clr_arg_value();
- ! errormsg = NO;
- message(NullStr);
- } else
- ExecCmd(cp);
- ***************
- *** 662,668 ****
-
- dorecover()
- {
- ! execl(Recover, "jove_recover", "-d", TmpFilePath, (char *)0);
- printf("%s: execl failed!\n", Recover);
- flusho();
- _exit(-1);
- --- 659,665 ----
-
- dorecover()
- {
- ! execl(Recover, "jove_recover", "-d", TmpFilePath, (char *) 0);
- printf("%s: execl failed!\n", Recover);
- flusho();
- _exit(-1);
- ***************
- *** 721,727 ****
- case 't':
- ++argv;
- --argc;
- - exp_p = YES;
- find_tag(argv[1], YES);
- break;
-
- --- 718,723 ----
- ***************
- *** 812,818 ****
- Mark *m;
-
- sprintf(bname, "%s", curbuf->b_name);
- ! m = MakeMark(curline, curchar, FLOATER);
-
- RecDepth++;
- UpdModLine++;
- --- 808,814 ----
- Mark *m;
-
- sprintf(bname, "%s", curbuf->b_name);
- ! m = MakeMark(curline, curchar, M_FLOATER);
-
- RecDepth++;
- UpdModLine++;
- ***************
- *** 820,826 ****
- UpdModLine++;
- RecDepth--;
- SetBuf(do_select(curwind, bname));
- ! if (exp_p == NO)
- ToMark(m);
- DelMark(m);
- }
- --- 816,822 ----
- UpdModLine++;
- RecDepth--;
- SetBuf(do_select(curwind, bname));
- ! if (!is_an_arg())
- ToMark(m);
- DelMark(m);
- }
- ***************
- *** 846,858 ****
- if (RecDepth == 0) {
- if (ModMacs()) {
- rbell();
- ! if (Upper(*ask("No",
- "Some MACROS haven't been saved; leave anyway? ")) != 'Y')
- break;
- }
- if (ModBufs(0)) {
- rbell();
- ! if (Upper(*ask("No",
- "Some buffers haven't been saved; leave anyway? ")) != 'Y')
- break;
- }
- --- 842,854 ----
- if (RecDepth == 0) {
- if (ModMacs()) {
- rbell();
- ! if (CharUpcase(*ask("No",
- "Some MACROS haven't been saved; leave anyway? ")) != 'Y')
- break;
- }
- if (ModBufs(0)) {
- rbell();
- ! if (CharUpcase(*ask("No",
- "Some buffers haven't been saved; leave anyway? ")) != 'Y')
- break;
- }
- ***************
- *** 880,887 ****
-
- for (;;) {
- if (this_cmd != ARG_CMD) {
- ! exp = 1;
- ! exp_p = NO;
- last_cmd = this_cmd;
- init_strokes();
- }
- --- 876,882 ----
-
- for (;;) {
- if (this_cmd != ARG_CMD) {
- ! clr_arg_value();
- last_cmd = this_cmd;
- init_strokes();
- }
- ***************
- *** 1051,1061 ****
- }
- if (scanvec(argv, "-r"))
- dorecover();
-
- - (void) time(&time0);
- ttinit(); /* initialize terminal (after ~/.joverc) */
- settout(ttbuf); /* not until we know baudrate */
- - ResetTerm();
-
- (void) signal(SIGHUP, finish);
- (void) signal(SIGINT, finish);
- --- 1046,1056 ----
- }
- if (scanvec(argv, "-r"))
- dorecover();
- + if (scanvec(argv, "-rc"))
- + FullRecover();
-
- ttinit(); /* initialize terminal (after ~/.joverc) */
- settout(ttbuf); /* not until we know baudrate */
-
- (void) signal(SIGHUP, finish);
- (void) signal(SIGINT, finish);
- ***************
- *** 1071,1078 ****
-
- /* set things up to update the modeline every UpdFreq seconds */
- (void) signal(SIGALRM, updmode);
- ! (void) alarm((unsigned) UpdFreq);
-
- cl_scr(1);
- flusho();
- RedrawDisplay(); /* start the redisplay process. */
- --- 1066,1075 ----
-
- /* set things up to update the modeline every UpdFreq seconds */
- (void) signal(SIGALRM, updmode);
- ! (void) time(&time0);
- ! (void) alarm((unsigned) (60 - (time0 % 60)));
-
- + ResetTerm();
- cl_scr(1);
- flusho();
- RedrawDisplay(); /* start the redisplay process. */
-