Commits

Anonymous committed 435dd32

Run "indent -kr -i8" on the sources

Let's see how nasty it is to clean things up. For real.

Comments (0)

Files changed (34)

  *	modified by Petri Kutvonen
  */
 
-#define	termdef	1			/* don't define "term" external */
+#define	termdef	1		/* don't define "term" external */
 
 #include        <stdio.h>
 #include	"estruct.h"
 
 #if     ANSI
 
-#define NROW    25                      /* Screen size.                 */
-#define NCOL    80                      /* Edit if you want to.         */
+#define NROW    25		/* Screen size.                 */
+#define NCOL    80		/* Edit if you want to.         */
 
 #if	PKCODE
 #define	MROW	64
 #endif
-#define	NPAUSE	100			/* # times thru update to pause */
-#define	MARGIN	8			/* size of minimim margin and	*/
-#define	SCRSIZ	64			/* scroll size for extended lines */
-#define BEL     0x07                    /* BEL character.               */
-#define ESC     0x1B                    /* ESC character.               */
-
-extern  int     ttopen();               /* Forward references.          */
-extern  int     ttgetc();
-extern  int     ttputc();
-extern  int     ttflush();
-extern  int     ttclose();
-extern  int     ansimove();
-extern  int     ansieeol();
-extern  int     ansieeop();
-extern  int     ansibeep();
-extern  int     ansiopen();
-extern	int	ansirev();
-extern	int	ansiclose();
-extern	int	ansikopen();
-extern	int	ansikclose();
-extern	int	ansicres();
+#define	NPAUSE	100		/* # times thru update to pause */
+#define	MARGIN	8		/* size of minimim margin and   */
+#define	SCRSIZ	64		/* scroll size for extended lines */
+#define BEL     0x07		/* BEL character.               */
+#define ESC     0x1B		/* ESC character.               */
+
+extern int ttopen();		/* Forward references.          */
+extern int ttgetc();
+extern int ttputc();
+extern int ttflush();
+extern int ttclose();
+extern int ansimove();
+extern int ansieeol();
+extern int ansieeop();
+extern int ansibeep();
+extern int ansiopen();
+extern int ansirev();
+extern int ansiclose();
+extern int ansikopen();
+extern int ansikclose();
+extern int ansicres();
 
 #if	COLOR
-extern	int	ansifcol();
-extern	int	ansibcol();
+extern int ansifcol();
+extern int ansibcol();
 
-int	cfcolor = -1;		/* current forground color */
-int	cbcolor = -1;		/* current background color */
+int cfcolor = -1;		/* current forground color */
+int cbcolor = -1;		/* current background color */
 
 #endif
 
  * Standard terminal interface dispatch table. Most of the fields point into
  * "termio" code.
  */
-TERM    term    = {
+TERM term = {
 #if	PKCODE
-	MROW-1,
+	MROW - 1,
 #else
-	NROW-1,
+	NROW - 1,
 #endif
-   	NROW-1,
-        NCOL,
-        NCOL,
+	NROW - 1,
+	NCOL,
+	NCOL,
 	MARGIN,
 	SCRSIZ,
 	NPAUSE,
-        ansiopen,
-        ansiclose,
+	ansiopen,
+	ansiclose,
 	ansikopen,
 	ansikclose,
-        ttgetc,
-        ttputc,
-        ttflush,
-        ansimove,
-        ansieeol,
-        ansieeop,
-        ansibeep,
+	ttgetc,
+	ttputc,
+	ttflush,
+	ansimove,
+	ansieeol,
+	ansieeop,
+	ansibeep,
 	ansirev,
 	ansicres
 #if	COLOR
-	, ansifcol,
+	    , ansifcol,
 	ansibcol
 #endif
 #if	SCROLLCODE
-	, NULL
+	    , NULL
 #endif
 };
 
 #if	COLOR
-ansifcol(color)		/* set the current output color */
-
-int color;	/* color to set */
+ansifcol(color)
+    /* set the current output color */
+int color;			/* color to set */
 
 {
 	if (color == cfcolor)
 		return;
 	ttputc(ESC);
 	ttputc('[');
-	ansiparm(color+30);
+	ansiparm(color + 30);
 	ttputc('m');
 	cfcolor = color;
 }
 
-ansibcol(color)		/* set the current background color */
-
-int color;	/* color to set */
+ansibcol(color)
+    /* set the current background color */
+int color;			/* color to set */
 
 {
 	if (color == cbcolor)
 		return;
 	ttputc(ESC);
 	ttputc('[');
-	ansiparm(color+40);
+	ansiparm(color + 40);
 	ttputc('m');
-        cbcolor = color;
+	cbcolor = color;
 }
 #endif
 
 ansimove(row, col)
 {
-        ttputc(ESC);
-        ttputc('[');
-        ansiparm(row+1);
-        ttputc(';');
-        ansiparm(col+1);
-        ttputc('H');
+	ttputc(ESC);
+	ttputc('[');
+	ansiparm(row + 1);
+	ttputc(';');
+	ansiparm(col + 1);
+	ttputc('H');
 }
 
 ansieeol()
 {
-        ttputc(ESC);
-        ttputc('[');
-        ttputc('K');
+	ttputc(ESC);
+	ttputc('[');
+	ttputc('K');
 }
 
 ansieeop()
 	ansifcol(gfcolor);
 	ansibcol(gbcolor);
 #endif
-        ttputc(ESC);
-        ttputc('[');
-        ttputc('J');
+	ttputc(ESC);
+	ttputc('[');
+	ttputc('J');
 }
 
-ansirev(state)		/* change reverse video state */
-
-int state;	/* TRUE = reverse, FALSE = normal */
+ansirev(state)
+    /* change reverse video state */
+int state;			/* TRUE = reverse, FALSE = normal */
 
 {
 #if	COLOR
 
 	ttputc(ESC);
 	ttputc('[');
-	ttputc(state ? '7': '0');
+	ttputc(state ? '7' : '0');
 	ttputc('m');
 #if	COLOR
 	if (state == FALSE) {
 #endif
 }
 
-ansicres()	/* change screen resolution */
-
-{
-	return(TRUE);
+ansicres()
+{				/* change screen resolution */
+	return (TRUE);
 }
 
-spal(dummy)		/* change pallette settings */
-
-{
+spal(dummy)
+{				/* change pallette settings */
 	/* none for now */
 }
 
 ansibeep()
 {
-        ttputc(BEL);
-        ttflush();
+	ttputc(BEL);
+	ttflush();
 }
 
 ansiparm(n)
-register int    n;
+register int n;
 {
-        register int q,r;
+	register int q, r;
 
-        q = n/10;
-        if (q != 0) {
-		r = q/10;
+	q = n / 10;
+	if (q != 0) {
+		r = q / 10;
 		if (r != 0) {
-			ttputc((r%10)+'0');
+			ttputc((r % 10) + '0');
 		}
-		ttputc((q%10) + '0');
-        }
-        ttputc((n%10) + '0');
+		ttputc((q % 10) + '0');
+	}
+	ttputc((n % 10) + '0');
 }
 
 ansiopen()
 {
 #if     V7 | USG | BSD
-        register char *cp;
-        char *getenv();
-
-        if ((cp = getenv("TERM")) == NULL) {
-                puts("Shell variable TERM not defined!");
-                exit(1);
-        }
-        if (strcmp(cp, "vt100") != 0) {
-                puts("Terminal type not 'vt100'!");
-                exit(1);
-        }
+	register char *cp;
+	char *getenv();
+
+	if ((cp = getenv("TERM")) == NULL) {
+		puts("Shell variable TERM not defined!");
+		exit(1);
+	}
+	if (strcmp(cp, "vt100") != 0) {
+		puts("Terminal type not 'vt100'!");
+		exit(1);
+	}
 #endif
 	strcpy(sres, "NORMAL");
 	revexist = TRUE;
-        ttopen();
+	ttopen();
 }
 
 ansiclose()
-
 {
 #if	COLOR
 	ansifcol(7);
 	ttclose();
 }
 
-ansikopen()	/* open the keyboard (a noop here) */
-
-{
+ansikopen()
+{				/* open the keyboard (a noop here) */
 }
 
-ansikclose()	/* close the keyboard (a noop here) */
-
-{
+ansikclose()
+{				/* close the keyboard (a noop here) */
 }
 
 #if	FNLABEL
-fnclabel(f, n)		/* label a function key */
-
-int f,n;	/* default flag, numeric argument [unused] */
+fnclabel(f, n)
+    /* label a function key */
+int f, n;			/* default flag, numeric argument [unused] */
 
 {
 	/* on machines with no function keys...don't bother */
-	return(TRUE);
+	return (TRUE);
 }
 #endif
 #else
  */
 gotobol(f, n)
 {
-        curwp->w_doto  = 0;
-        return (TRUE);
+	curwp->w_doto = 0;
+	return (TRUE);
 }
 
 /*
  * line pointer for dot changes.
  */
 backchar(f, n)
-register int    n;
+register int n;
 {
-        register LINE   *lp;
-
-        if (n < 0)
-                return (forwchar(f, -n));
-        while (n--) {
-                if (curwp->w_doto == 0) {
-                        if ((lp=lback(curwp->w_dotp)) == curbp->b_linep)
-                                return (FALSE);
-                        curwp->w_dotp  = lp;
-                        curwp->w_doto  = llength(lp);
-                        curwp->w_flag |= WFMOVE;
-                } else
-                        curwp->w_doto--;
-        }
-        return (TRUE);
+	register LINE *lp;
+
+	if (n < 0)
+		return (forwchar(f, -n));
+	while (n--) {
+		if (curwp->w_doto == 0) {
+			if ((lp = lback(curwp->w_dotp)) == curbp->b_linep)
+				return (FALSE);
+			curwp->w_dotp = lp;
+			curwp->w_doto = llength(lp);
+			curwp->w_flag |= WFMOVE;
+		} else
+			curwp->w_doto--;
+	}
+	return (TRUE);
 }
 
 /*
  */
 gotoeol(f, n)
 {
-        curwp->w_doto  = llength(curwp->w_dotp);
-        return (TRUE);
+	curwp->w_doto = llength(curwp->w_dotp);
+	return (TRUE);
 }
 
 /*
  * buffer. Set the flag if the line pointer for dot changes.
  */
 forwchar(f, n)
-register int    n;
+register int n;
 {
-        if (n < 0)
-                return (backchar(f, -n));
-        while (n--) {
-                if (curwp->w_doto == llength(curwp->w_dotp)) {
-                        if (curwp->w_dotp == curbp->b_linep)
-                                return (FALSE);
-                        curwp->w_dotp  = lforw(curwp->w_dotp);
-                        curwp->w_doto  = 0;
-                        curwp->w_flag |= WFMOVE;
-                } else
-                        curwp->w_doto++;
-        }
-        return (TRUE);
+	if (n < 0)
+		return (backchar(f, -n));
+	while (n--) {
+		if (curwp->w_doto == llength(curwp->w_dotp)) {
+			if (curwp->w_dotp == curbp->b_linep)
+				return (FALSE);
+			curwp->w_dotp = lforw(curwp->w_dotp);
+			curwp->w_doto = 0;
+			curwp->w_flag |= WFMOVE;
+		} else
+			curwp->w_doto++;
+	}
+	return (TRUE);
 }
 
-gotoline(f, n)		/* move to a particular line.
-			   argument (n) must be a positive integer for
-			   this to actually do anything		*/
-
-{
+gotoline(f, n)
+{				/* move to a particular line.
+				   argument (n) must be a positive integer for
+				   this to actually do anything           */
 	register int status;	/* status return */
 	char arg[NSTRING];	/* buffer to hold argument */
 
 	/* get an argument if one doesnt exist */
 	if (f == FALSE) {
-		if ((status = mlreply("Line to GOTO: ", arg, NSTRING)) != TRUE) {
+		if ((status =
+		     mlreply("Line to GOTO: ", arg, NSTRING)) != TRUE) {
 			mlwrite("(Aborted)");
-			return(status);
+			return (status);
 		}
 		n = atoi(arg);
 	}
 
 	if (n < 1)		/* if a bogus argument...then leave */
-		return(FALSE);
+		return (FALSE);
 
 	/* first, we go to the start of the buffer */
-        curwp->w_dotp  = lforw(curbp->b_linep);
-        curwp->w_doto  = 0;
-	return(forwline(f, n-1));
+	curwp->w_dotp = lforw(curbp->b_linep);
+	curwp->w_doto = 0;
+	return (forwline(f, n - 1));
 }
 
 /*
  */
 gotobob(f, n)
 {
-        curwp->w_dotp  = lforw(curbp->b_linep);
-        curwp->w_doto  = 0;
-        curwp->w_flag |= WFHARD;
-        return (TRUE);
+	curwp->w_dotp = lforw(curbp->b_linep);
+	curwp->w_doto = 0;
+	curwp->w_flag |= WFHARD;
+	return (TRUE);
 }
 
 /*
  */
 gotoeob(f, n)
 {
-        curwp->w_dotp  = curbp->b_linep;
-        curwp->w_doto  = 0;
-        curwp->w_flag |= WFHARD;
-        return (TRUE);
+	curwp->w_dotp = curbp->b_linep;
+	curwp->w_doto = 0;
+	curwp->w_flag |= WFHARD;
+	return (TRUE);
 }
 
 /*
  */
 forwline(f, n)
 {
-        register LINE   *dlp;
+	register LINE *dlp;
 
-        if (n < 0)
-                return (backline(f, -n));
+	if (n < 0)
+		return (backline(f, -n));
 
 	/* if we are on the last line as we start....fail the command */
 	if (curwp->w_dotp == curbp->b_linep)
-		return(FALSE);
+		return (FALSE);
 
 	/* if the last command was not note a line move,
 	   reset the goal column */
-        if ((lastflag&CFCPCN) == 0)
-                curgoal = getccol(FALSE);
+	if ((lastflag & CFCPCN) == 0)
+		curgoal = getccol(FALSE);
 
 	/* flag this command as a line move */
-        thisflag |= CFCPCN;
+	thisflag |= CFCPCN;
 
 	/* and move the point down */
-        dlp = curwp->w_dotp;
-        while (n-- && dlp!=curbp->b_linep)
-                dlp = lforw(dlp);
+	dlp = curwp->w_dotp;
+	while (n-- && dlp != curbp->b_linep)
+		dlp = lforw(dlp);
 
 	/* reseting the current position */
-        curwp->w_dotp  = dlp;
-        curwp->w_doto  = getgoal(dlp);
-        curwp->w_flag |= WFMOVE;
-        return (TRUE);
+	curwp->w_dotp = dlp;
+	curwp->w_doto = getgoal(dlp);
+	curwp->w_flag |= WFMOVE;
+	return (TRUE);
 }
 
 /*
  */
 backline(f, n)
 {
-        register LINE   *dlp;
+	register LINE *dlp;
 
-        if (n < 0)
-                return (forwline(f, -n));
+	if (n < 0)
+		return (forwline(f, -n));
 
 
 	/* if we are on the last line as we start....fail the command */
 	if (lback(curwp->w_dotp) == curbp->b_linep)
-		return(FALSE);
+		return (FALSE);
 
 	/* if the last command was not note a line move,
 	   reset the goal column */
-        if ((lastflag&CFCPCN) == 0)
-                curgoal = getccol(FALSE);
+	if ((lastflag & CFCPCN) == 0)
+		curgoal = getccol(FALSE);
 
 	/* flag this command as a line move */
-        thisflag |= CFCPCN;
+	thisflag |= CFCPCN;
 
 	/* and move the point up */
-        dlp = curwp->w_dotp;
-        while (n-- && lback(dlp)!=curbp->b_linep)
-                dlp = lback(dlp);
+	dlp = curwp->w_dotp;
+	while (n-- && lback(dlp) != curbp->b_linep)
+		dlp = lback(dlp);
 
 	/* reseting the current position */
-        curwp->w_dotp  = dlp;
-        curwp->w_doto  = getgoal(dlp);
-        curwp->w_flag |= WFMOVE;
-        return (TRUE);
+	curwp->w_dotp = dlp;
+	curwp->w_doto = getgoal(dlp);
+	curwp->w_flag |= WFMOVE;
+	return (TRUE);
 }
 
 #if	WORDPRO
-gotobop(f, n)	/* go back to the beginning of the current paragraph
-		   here we look for a <NL><NL> or <NL><TAB> or <NL><SPACE>
-		   combination to delimit the beginning of a paragraph	*/
-
-int f, n;	/* default Flag & Numeric argument */
+gotobop(f, n)
+    /* go back to the beginning of the current paragraph
+       here we look for a <NL><NL> or <NL><TAB> or <NL><SPACE>
+       combination to delimit the beginning of a paragraph      */
+int f, n;			/* default Flag & Numeric argument */
 
 {
 	register int suc;	/* success of last backchar */
 
-	if (n < 0)	/* the other way...*/
-		return(gotoeop(f, -n));
+	if (n < 0)		/* the other way... */
+		return (gotoeop(f, -n));
 
 	while (n-- > 0) {	/* for each one asked for */
 
 		curwp->w_doto = 0;	/* and go to the B-O-Line */
 
 		/* and scan back until we hit a <NL><NL> or <NL><TAB>
-		   or a <NL><SPACE>					*/
+		   or a <NL><SPACE>                                     */
 		while (lback(curwp->w_dotp) != curbp->b_linep)
 			if (llength(curwp->w_dotp) != 0 &&
 #if	PKCODE
 			    ((justflag == TRUE) ||
 #endif
-			    lgetc(curwp->w_dotp, curwp->w_doto) != TAB &&
-			    lgetc(curwp->w_dotp, curwp->w_doto) != ' ')
+			     lgetc(curwp->w_dotp, curwp->w_doto) != TAB &&
+			     lgetc(curwp->w_dotp, curwp->w_doto) != ' ')
 #if	PKCODE
-									)
+			    )
 #endif
 				curwp->w_dotp = lback(curwp->w_dotp);
 			else
 			suc = forwchar(FALSE, 1);
 	}
 	curwp->w_flag |= WFMOVE;	/* force screen update */
-	return(TRUE);
+	return (TRUE);
 }
 
-gotoeop(f, n)	/* go forword to the end of the current paragraph
-		   here we look for a <NL><NL> or <NL><TAB> or <NL><SPACE>
-		   combination to delimit the beginning of a paragraph	*/
-
-int f, n;	/* default Flag & Numeric argument */
+gotoeop(f, n)
+    /* go forword to the end of the current paragraph
+       here we look for a <NL><NL> or <NL><TAB> or <NL><SPACE>
+       combination to delimit the beginning of a paragraph      */
+int f, n;			/* default Flag & Numeric argument */
 
 {
 	register int suc;	/* success of last backchar */
 
-	if (n < 0)	/* the other way...*/
-		return(gotobop(f, -n));
+	if (n < 0)		/* the other way... */
+		return (gotobop(f, -n));
 
 	while (n-- > 0) {	/* for each one asked for */
 
 			curwp->w_dotp = lforw(curwp->w_dotp);
 
 		/* and scan forword until we hit a <NL><NL> or <NL><TAB>
-		   or a <NL><SPACE>					*/
+		   or a <NL><SPACE>                                     */
 		while (curwp->w_dotp != curbp->b_linep) {
 			if (llength(curwp->w_dotp) != 0 &&
 #if	PKCODE
 			    ((justflag == TRUE) ||
 #endif
-			    lgetc(curwp->w_dotp, curwp->w_doto) != TAB &&
-			    lgetc(curwp->w_dotp, curwp->w_doto) != ' ')
+			     lgetc(curwp->w_dotp, curwp->w_doto) != TAB &&
+			     lgetc(curwp->w_dotp, curwp->w_doto) != ' ')
 #if	PKCODE
-									)
+			    )
 #endif
 				curwp->w_dotp = lforw(curwp->w_dotp);
 			else
 		curwp->w_doto = llength(curwp->w_dotp);	/* and to the EOL */
 	}
 	curwp->w_flag |= WFMOVE;	/* force screen update */
-	return(TRUE);
+	return (TRUE);
 }
 #endif
 
  * Used by "C-N" and "C-P".
  */
 getgoal(dlp)
-register LINE   *dlp;
+register LINE *dlp;
 {
-        register int    c;
-        register int    col;
-        register int    newcol;
-        register int    dbo;
-
-        col = 0;
-        dbo = 0;
-        while (dbo != llength(dlp)) {
-                c = lgetc(dlp, dbo);
-                newcol = col;
-                if (c == '\t')
-                        newcol |= tabmask;
-                else if (c<0x20 || c==0x7F)
-                        ++newcol;
-                ++newcol;
-                if (newcol > curgoal)
-                        break;
-                col = newcol;
-                ++dbo;
-        }
-        return (dbo);
+	register int c;
+	register int col;
+	register int newcol;
+	register int dbo;
+
+	col = 0;
+	dbo = 0;
+	while (dbo != llength(dlp)) {
+		c = lgetc(dlp, dbo);
+		newcol = col;
+		if (c == '\t')
+			newcol |= tabmask;
+		else if (c < 0x20 || c == 0x7F)
+			++newcol;
+		++newcol;
+		if (newcol > curgoal)
+			break;
+		col = newcol;
+		++dbo;
+	}
+	return (dbo);
 }
 
 /*
  * this zaps the top line in the display window, we have to do a hard update.
  */
 forwpage(f, n)
-register int    n;
+register int n;
 {
-        register LINE   *lp;
+	register LINE *lp;
 
-        if (f == FALSE) {
+	if (f == FALSE) {
 #if SCROLLCODE
 		if (term.t_scroll != NULL)
 			if (overlap == 0)
 				n = curwp->w_ntrows - overlap;
 		else
 #endif
-		n = curwp->w_ntrows - 2;	/* Default scroll.      */
-                if (n <= 0)                     /* Forget the overlap   */
-                        n = 1;                  /* if tiny window.      */
-        } else if (n < 0)
-                return (backpage(f, -n));
+			n = curwp->w_ntrows - 2;	/* Default scroll.      */
+		if (n <= 0)	/* Forget the overlap   */
+			n = 1;	/* if tiny window.      */
+	} else if (n < 0)
+		return (backpage(f, -n));
 #if     CVMVAS
-        else                                    /* Convert from pages   */
-                n *= curwp->w_ntrows;           /* to lines.            */
+	else			/* Convert from pages   */
+		n *= curwp->w_ntrows;	/* to lines.            */
 #endif
-        lp = curwp->w_linep;
-        while (n-- && lp!=curbp->b_linep)
-                lp = lforw(lp);
-        curwp->w_linep = lp;
-        curwp->w_dotp  = lp;
-        curwp->w_doto  = 0;
+	lp = curwp->w_linep;
+	while (n-- && lp != curbp->b_linep)
+		lp = lforw(lp);
+	curwp->w_linep = lp;
+	curwp->w_dotp = lp;
+	curwp->w_doto = 0;
 #if SCROLLCODE
-	curwp->w_flag |= WFHARD|WFKILLS;
+	curwp->w_flag |= WFHARD | WFKILLS;
 #else
 	curwp->w_flag |= WFHARD;
 #endif
-        return (TRUE);
+	return (TRUE);
 }
 
 /*
  * reason.
  */
 backpage(f, n)
-register int    n;
+register int n;
 {
-        register LINE   *lp;
+	register LINE *lp;
 
-        if (f == FALSE) {
+	if (f == FALSE) {
 #if SCROLLCODE
 		if (term.t_scroll != NULL)
 			if (overlap == 0)
 				n = curwp->w_ntrows - overlap;
 		else
 #endif
-		n = curwp->w_ntrows - 2;	/* Default scroll.      */
-                if (n <= 0)                     /* Don't blow up if the */
-                        n = 1;                  /* window is tiny.      */
-        } else if (n < 0)
-                return (forwpage(f, -n));
+			n = curwp->w_ntrows - 2;	/* Default scroll.      */
+		if (n <= 0)	/* Don't blow up if the */
+			n = 1;	/* window is tiny.      */
+	} else if (n < 0)
+		return (forwpage(f, -n));
 #if     CVMVAS
-        else                                    /* Convert from pages   */
-                n *= curwp->w_ntrows;           /* to lines.            */
+	else			/* Convert from pages   */
+		n *= curwp->w_ntrows;	/* to lines.            */
 #endif
-        lp = curwp->w_linep;
-        while (n-- && lback(lp)!=curbp->b_linep)
-                lp = lback(lp);
-        curwp->w_linep = lp;
-        curwp->w_dotp  = lp;
-        curwp->w_doto  = 0;
+	lp = curwp->w_linep;
+	while (n-- && lback(lp) != curbp->b_linep)
+		lp = lback(lp);
+	curwp->w_linep = lp;
+	curwp->w_dotp = lp;
+	curwp->w_doto = 0;
 #if SCROLLCODE
-        curwp->w_flag |= WFHARD|WFINS;
+	curwp->w_flag |= WFHARD | WFINS;
 #else
-        curwp->w_flag |= WFHARD;
+	curwp->w_flag |= WFHARD;
 #endif
-        return (TRUE);
+	return (TRUE);
 }
 
 /*
  */
 setmark(f, n)
 {
-        curwp->w_markp = curwp->w_dotp;
-        curwp->w_marko = curwp->w_doto;
-        mlwrite("(Mark set)");
-        return (TRUE);
+	curwp->w_markp = curwp->w_dotp;
+	curwp->w_marko = curwp->w_doto;
+	mlwrite("(Mark set)");
+	return (TRUE);
 }
 
 /*
  */
 swapmark(f, n)
 {
-        register LINE   *odotp;
-        register int    odoto;
-
-        if (curwp->w_markp == NULL) {
-                mlwrite("No mark in this window");
-                return (FALSE);
-        }
-        odotp = curwp->w_dotp;
-        odoto = curwp->w_doto;
-        curwp->w_dotp  = curwp->w_markp;
-        curwp->w_doto  = curwp->w_marko;
-        curwp->w_markp = odotp;
-        curwp->w_marko = odoto;
-        curwp->w_flag |= WFMOVE;
-        return (TRUE);
+	register LINE *odotp;
+	register int odoto;
+
+	if (curwp->w_markp == NULL) {
+		mlwrite("No mark in this window");
+		return (FALSE);
+	}
+	odotp = curwp->w_dotp;
+	odoto = curwp->w_doto;
+	curwp->w_dotp = curwp->w_markp;
+	curwp->w_doto = curwp->w_marko;
+	curwp->w_markp = odotp;
+	curwp->w_marko = odoto;
+	curwp->w_flag |= WFMOVE;
+	return (TRUE);
 }
 #include	"edef.h"
 #include	"epath.h"
 
-extern int meta(), cex(), unarg(), ctrlg(); /* dummy prefix binding functions */
+extern int meta(), cex(), unarg(), ctrlg();	/* dummy prefix binding functions */
 
-help(f, n)	/* give me some help!!!!
-		   bring up a fake buffer and read the help file
-		   into it with view mode			*/
-{
+help(f, n)
+{				/* give me some help!!!!
+				   bring up a fake buffer and read the help file
+				   into it with view mode                 */
 	register WINDOW *wp;	/* scaning pointer to windows */
 	register BUFFER *bp;	/* buffer pointer to help */
 	char *fname;		/* ptr to file returned by flook() */
 		fname = flook(pathname[1], FALSE);
 		if (fname == NULL) {
 			mlwrite("(Help file is not online)");
-			return(FALSE);
+			return (FALSE);
 		}
 	}
 
 	/* split the current window to make room for the help stuff */
 	if (splitwind(FALSE, 1) == FALSE)
-			return(FALSE);
+		return (FALSE);
 
 	if (bp == NULL) {
 		/* and read the stuff in */
 		if (getfile(fname, FALSE) == FALSE)
-			return(FALSE);
+			return (FALSE);
 	} else
 		swbuffer(bp);
 
 		wp->w_flag |= WFMODE;
 		wp = wp->w_wndp;
 	}
-	return(TRUE);
+	return (TRUE);
 }
 
-deskey(f, n)	/* describe the command for a certain key */
-
-{
+deskey(f, n)
+{				/* describe the command for a certain key */
 	register int c;		/* key to describe */
 	register char *ptr;	/* string pointer to scan output strings */
 	char outseq[NSTRING];	/* output buffer for command sequence */
-	int (*getbind())();
+	int (*getbind()) ();
 
 	/* prompt the user to type us a key to describe */
 	mlwrite(": describe-key ");
 
 bindtokey(f, n)
 
-int f, n;	/* command arguments [IGNORED] */
+int f, n;			/* command arguments [IGNORED] */
 
 {
-	register unsigned int c;/* command key to bind */
-	register int (*kfunc)();/* ptr to the requested function to bind to */
+	register unsigned int c;	/* command key to bind */
+	register int (*kfunc) ();	/* ptr to the requested function to bind to */
 	register KEYTAB *ktp;	/* pointer into the command table */
 	register int found;	/* matched command flag */
 	char outseq[80];	/* output buffer for keystroke sequence */
-	int (*getname())();
+	int (*getname()) ();
 
 	/* prompt the user to type in a key to bind */
 	mlwrite(": bind-to-key ");
 	kfunc = getname();
 	if (kfunc == NULL) {
 		mlwrite("(No such function)");
-		return(FALSE);
+		return (FALSE);
 	}
 	ostring(" ");
 
 	/* get the command sequence to bind */
 	c = getckey((kfunc == meta) || (kfunc == cex) ||
-	            (kfunc == unarg) || (kfunc == ctrlg));
+		    (kfunc == unarg) || (kfunc == ctrlg));
 
 	/* change it to something we can print as well */
 	cmdstr(c, &outseq[0]);
 		++ktp;
 	}
 
-	if (found) {	/* it exists, just change it then */
+	if (found) {		/* it exists, just change it then */
 		ktp->k_fp = kfunc;
-	} else {	/* otherwise we need to add it to the end */
+	} else {		/* otherwise we need to add it to the end */
 		/* if we run out of binding room, bitch */
 		if (ktp >= &keytab[NBINDS]) {
 			mlwrite("Binding table FULL!");
-			return(FALSE);
+			return (FALSE);
 		}
 
 		ktp->k_code = c;	/* add keycode */
 		ktp->k_fp = kfunc;	/* and the function pointer */
-		++ktp;			/* and make sure the next is null */
+		++ktp;		/* and make sure the next is null */
 		ktp->k_code = 0;
 		ktp->k_fp = NULL;
 	}
-	return(TRUE);
+	return (TRUE);
 }
 
 /* unbindkey:	delete a key from the key binding table	*/
 
 unbindkey(f, n)
 
-int f, n;	/* command arguments [IGNORED] */
+int f, n;			/* command arguments [IGNORED] */
 
 {
 	register int c;		/* command key to unbind */
 	mlwrite(": unbind-key ");
 
 	/* get the command sequence to unbind */
-	c = getckey(FALSE);		/* get a command sequence */
+	c = getckey(FALSE);	/* get a command sequence */
 
 	/* change it to something we can print as well */
 	cmdstr(c, &outseq[0]);
 	/* if it isn't bound, bitch */
 	if (unbindchar(c) == FALSE) {
 		mlwrite("(Key not bound)");
-		return(FALSE);
+		return (FALSE);
 	}
-	return(TRUE);
+	return (TRUE);
 }
 
 unbindchar(c)
 
-int c;		/* command key to unbind */
+int c;				/* command key to unbind */
 
 {
 	register KEYTAB *ktp;	/* pointer into the command table */
 
 	/* if it isn't bound, bitch */
 	if (!found)
-		return(FALSE);
+		return (FALSE);
 
 	/* save the pointer and scan to the end of the table */
 	sktp = ktp;
 	while (ktp->k_fp != NULL)
 		++ktp;
-	--ktp;		/* backup to the last legit entry */
+	--ktp;			/* backup to the last legit entry */
 
 	/* copy the last entry to the current one */
 	sktp->k_code = ktp->k_code;
-	sktp->k_fp   = ktp->k_fp;
+	sktp->k_fp = ktp->k_fp;
 
 	/* null out the last one */
 	ktp->k_code = 0;
 	ktp->k_fp = NULL;
-	return(TRUE);
+	return (TRUE);
 }
 
-desbind(f, n)	/* describe bindings
-		   bring up a fake buffer and list the key bindings
-		   into it with view mode			*/
-
+desbind(f, n)
+    /* describe bindings
+       bring up a fake buffer and list the key bindings
+       into it with view mode                   */
 #if	APROP
 {
 	buildlist(TRUE, "");
 }
 
-apro(f, n)	/* Apropos (List functions that match a substring) */
-
-{
+apro(f, n)
+{				/* Apropos (List functions that match a substring) */
 	char mstring[NSTRING];	/* string to match cmd names to */
 	int status;		/* status return */
 
 	status = mlreply("Apropos string: ", mstring, NSTRING - 1);
 	if (status != TRUE)
-		return(status);
+		return (status);
 
-	return(buildlist(FALSE, mstring));
+	return (buildlist(FALSE, mstring));
 }
 
-buildlist(type, mstring)  /* build a binding list (limited or full) */
-
-int type;	/* true = full list,   false = partial list */
-char *mstring;	/* match string if a partial list */
+buildlist(type, mstring)
+    /* build a binding list (limited or full) */
+int type;			/* true = full list,   false = partial list */
+char *mstring;			/* match string if a partial list */
 
 #endif
 {
 
 	/* split the current window to make room for the binding list */
 	if (splitwind(FALSE, 1) == FALSE)
-			return(FALSE);
+		return (FALSE);
 
 	/* and get a buffer for it */
 	bp = bfind("*Binding list*", TRUE, 0);
 	if (bp == NULL || bclear(bp) == FALSE) {
 		mlwrite("Can not display binding list");
-		return(FALSE);
+		return (FALSE);
 	}
 
 	/* let us know this is in progress */
 	mlwrite("(Building binding list)");
 
 	/* disconect the current buffer */
-        if (--curbp->b_nwnd == 0) {             /* Last use.            */
-                curbp->b_dotp  = curwp->w_dotp;
-                curbp->b_doto  = curwp->w_doto;
-                curbp->b_markp = curwp->w_markp;
-                curbp->b_marko = curwp->w_marko;
-        }
+	if (--curbp->b_nwnd == 0) {	/* Last use.            */
+		curbp->b_dotp = curwp->w_dotp;
+		curbp->b_doto = curwp->w_doto;
+		curbp->b_markp = curwp->w_markp;
+		curbp->b_marko = curwp->w_marko;
+	}
 
 	/* connect the current window to this buffer */
-	curbp = bp;	/* make this buffer current in current window */
+	curbp = bp;		/* make this buffer current in current window */
 	bp->b_mode = 0;		/* no modes active in binding list */
 	bp->b_nwnd++;		/* mark us as more in use */
 	wp = curwp;
 	wp->w_bufp = bp;
 	wp->w_linep = bp->b_linep;
-	wp->w_flag = WFHARD|WFFORCE;
+	wp->w_flag = WFHARD | WFFORCE;
 	wp->w_dotp = bp->b_dotp;
 	wp->w_doto = bp->b_doto;
 	wp->w_markp = NULL;
 
 				/* and add it as a line into the buffer */
 				if (linstr(outseq) != TRUE)
-					return(FALSE);
+					return (FALSE);
 
 				cpos = 0;	/* and clear the line */
 			}
 			outseq[cpos++] = '\n';
 			outseq[cpos] = 0;
 			if (linstr(outseq) != TRUE)
-				return(FALSE);
+				return (FALSE);
 		}
 
-fail:		/* and on to the next name */
+	      fail:		/* and on to the next name */
 		++nptr;
 	}
 
-	curwp->w_bufp->b_mode |= MDVIEW;/* put this buffer view mode */
+	curwp->w_bufp->b_mode |= MDVIEW;	/* put this buffer view mode */
 	curbp->b_flag &= ~BFCHG;	/* don't flag this as a change */
-	wp->w_dotp = lforw(bp->b_linep);/* back to the beginning */
+	wp->w_dotp = lforw(bp->b_linep);	/* back to the beginning */
 	wp->w_doto = 0;
-	wp = wheadp;			/* and update ALL mode lines */
+	wp = wheadp;		/* and update ALL mode lines */
 	while (wp != NULL) {
 		wp->w_flag |= WFMODE;
 		wp = wp->w_wndp;
 	}
-	mlwrite("");	/* clear the mode line */
-	return(TRUE);
+	mlwrite("");		/* clear the mode line */
+	return (TRUE);
 }
 
 #if	APROP
-strinc(source, sub)	/* does source include sub? */
-
-char *source;	/* string to search in */
-char *sub;	/* substring to look for */
+strinc(source, sub)
+    /* does source include sub? */
+char *source;			/* string to search in */
+char *sub;			/* substring to look for */
 
 {
-	char *sp;	/* ptr into source */
-	char *nxtsp;	/* next ptr into source */
-	char *tp;	/* ptr into substring */
+	char *sp;		/* ptr into source */
+	char *nxtsp;		/* next ptr into source */
+	char *tp;		/* ptr into substring */
 
 	/* for each character in the source string */
 	sp = source;
 
 		/* yes, return a success */
 		if (*tp == 0)
-			return(TRUE);
+			return (TRUE);
 
 		/* no, onward */
 		sp++;
 	}
-	return(FALSE);
+	return (FALSE);
 }
 #endif
 
 
 unsigned int getckey(mflag)
 
-int mflag;	/* going for a meta sequence? */
+int mflag;			/* going for a meta sequence? */
 
 {
 	register unsigned int c;	/* character fetched */
-	char tok[NSTRING];		/* command incoming */
+	char tok[NSTRING];	/* command incoming */
 
 	/* check to see if we are executing a command line */
 	if (clexec) {
 		macarg(tok);	/* get the next token */
-		return(stock(tok));
+		return (stock(tok));
 	}
 
 	/* or the normal way */
 		c = get1key();
 	else
 		c = getcmd();
-	return(c);
+	return (c);
 }
 
 /* execute the startup file */
 
 startup(sfname)
 
-char *sfname;	/* name of startup file (null if default) */
+char *sfname;			/* name of startup file (null if default) */
 
 {
-	char *fname;	/* resulting file name to execute */
+	char *fname;		/* resulting file name to execute */
 
 	/* look up the startup file */
 	if (*sfname != 0)
 
 	/* if it isn't around, don't sweat it */
 	if (fname == NULL)
-		return(TRUE);
+		return (TRUE);
 
 	/* otherwise, execute the sucker */
-	return(dofile(fname));
+	return (dofile(fname));
 }
 
 /*	Look up the existance of a file along the normal or PATH
 
 char *flook(fname, hflag)
 
-char *fname;	/* base file name to search for */
-int hflag;	/* Look in the HOME environment variable first? */
+char *fname;			/* base file name to search for */
+int hflag;			/* Look in the HOME environment variable first? */
 
 {
 	register char *home;	/* path to home directory */
 			/* and try it out */
 			if (ffropen(fspec) == FIOSUC) {
 				ffclose();
-				return(fspec);
+				return (fspec);
 			}
 		}
 	}
 	/* always try the current directory first */
 	if (ffropen(fname) == FIOSUC) {
 		ffclose();
-		return(fname);
+		return (fname);
 	}
-
 #if	ENVFUNC
 	/* get the PATH variable */
 	path = getenv("PATH");
 			/* and try it out */
 			if (ffropen(fspec) == FIOSUC) {
 				ffclose();
-				return(fspec);
+				return (fspec);
 			}
 
 			if (*path == PATHCHR)
 #endif
 
 	/* look it up via the old table method */
-	for (i=2; i < NPNAMES; i++) {
+	for (i = 2; i < NPNAMES; i++) {
 		strcpy(fspec, pathname[i]);
 		strcat(fspec, fname);
 
 		/* and try it out */
 		if (ffropen(fspec) == FIOSUC) {
 			ffclose();
-			return(fspec);
+			return (fspec);
 		}
 	}
 
-	return(NULL);	/* no such luck */
+	return (NULL);		/* no such luck */
 }
 
-cmdstr(c, seq)	/* change a key command to a string we can print out */
-
-int c;		/* sequence to translate */
-char *seq;	/* destination string for sequence */
+cmdstr(c, seq)
+    /* change a key command to a string we can print out */
+int c;				/* sequence to translate */
+char *seq;			/* destination string for sequence */
 
 {
-	char *ptr;	/* pointer into current position in sequence */
+	char *ptr;		/* pointer into current position in sequence */
 
 	ptr = seq;
 
 	/* and output the final sequence */
 
 	*ptr++ = c & 255;	/* strip the prefixes */
-		
-	*ptr = 0;	/* terminate the string */
+
+	*ptr = 0;		/* terminate the string */
 }
 
 /*	This function looks a key binding up in the binding table	*/
 
-int (*getbind(c))()
+int (*getbind(c)) ()
 
-int c;	/* key to find what is bound to it */
+int c;				/* key to find what is bound to it */
 
 {
 	register KEYTAB *ktp;
 
-        ktp = &keytab[0];                       /* Look in key table.   */
-        while (ktp->k_fp != NULL) {
-                if (ktp->k_code == c)
-                        return(ktp->k_fp);
-                ++ktp;
-        }
+	ktp = &keytab[0];	/* Look in key table.   */
+	while (ktp->k_fp != NULL) {
+		if (ktp->k_code == c)
+			return (ktp->k_fp);
+		++ktp;
+	}
 
 	/* no such binding */
-	return(NULL);
+	return (NULL);
 }
 
 /* getfname:	This function takes a ptr to function and gets the name
 
 char *getfname(func)
 
-int (*func)();	/* ptr to the requested function to bind to */
+int (*func) ();			/* ptr to the requested function to bind to */
 
 {
 	register NBIND *nptr;	/* pointer into the name binding table */
 	nptr = &names[0];
 	while (nptr->n_func != NULL) {
 		if (nptr->n_func == func)
-			return(nptr->n_name);
+			return (nptr->n_name);
 		++nptr;
 	}
-	return(NULL);
+	return (NULL);
 }
 
-int (*fncmatch(fname))() /* match fname to a function in the names table
-			    and return any match or NULL if none		*/
-
-char *fname;	/* name to attempt to match */
+int (*fncmatch(fname)) ()
+			     /* match fname to a function in the names table
+			        and return any match or NULL if none            */
+char *fname;			/* name to attempt to match */
 
 {
 	register NBIND *ffp;	/* pointer to entry in name binding table */
 	ffp = &names[0];
 	while (ffp->n_func != NULL) {
 		if (strcmp(fname, ffp->n_name) == 0)
-			return(ffp->n_func);
+			return (ffp->n_func);
 		++ffp;
 	}
-	return(NULL);
+	return (NULL);
 }
 
 /* stock:	String key name TO Command Key		*/
 
 unsigned int stock(keyname)
 
-char *keyname;		/* name of key to translate to Command key form */
+char *keyname;			/* name of key to translate to Command key form */
 
 {
 	register unsigned int c;	/* key sequence to return */
 	c = 0;
 
 	/* first, the META prefix */
-	if (*keyname == 'M' && *(keyname+1) == '-') {
+	if (*keyname == 'M' && *(keyname + 1) == '-') {
 		c = META;
 		keyname += 2;
 	}
 
 	/* next the function prefix */
-	if (*keyname == 'F' && *(keyname+1) == 'N') {
+	if (*keyname == 'F' && *(keyname + 1) == 'N') {
 		c |= SPEC;
 		keyname += 2;
 	}
 
 	/* control-x as well... (but not with FN) */
-	if (*keyname == '^' && *(keyname+1) == 'X'&& !(c & SPEC)) {
+	if (*keyname == '^' && *(keyname + 1) == 'X' && !(c & SPEC)) {
 		c |= CTLX;
 		keyname += 2;
 	}
 
 	/* a control char? */
-	if (*keyname == '^' && *(keyname+1) != 0) {
+	if (*keyname == '^' && *(keyname + 1) != 0) {
 		c |= CONTROL;
 		++keyname;
 	}
 	}
 
 
-	/* make sure we are not lower case (not with function keys)*/
+	/* make sure we are not lower case (not with function keys) */
 	if (*keyname >= 'a' && *keyname <= 'z' && !(c & SPEC))
 		*keyname -= 32;
 
 	/* the final sequence... */
 	c |= *keyname;
-	return(c);
+	return (c);
 }
 
-char *transbind(skey)	/* string key name to binding name.... */
-
-char *skey;	/* name of keey to get binding for */
+char *transbind(skey)
+			    /* string key name to binding name.... */
+char *skey;			/* name of keey to get binding for */
 
 {
 	char *bindname;
 	unsigned int stock();
-	int (*getbind())();
+	int (*getbind()) ();
 
 	bindname = getfname(getbind(stock(skey)));
 	if (bindname == NULL)
 		bindname = "ERROR";
 
-	return(bindname);
+	return (bindname);
 }
  */
 usebuffer(f, n)
 {
-        register BUFFER *bp;
-        register int    s;
-        char            bufn[NBUFN];
-
-        if ((s=mlreply("Use buffer: ", bufn, NBUFN)) != TRUE)
-                return (s);
-        if ((bp=bfind(bufn, TRUE, 0)) == NULL)
-                return (FALSE);
-	return(swbuffer(bp));
+	register BUFFER *bp;
+	register int s;
+	char bufn[NBUFN];
+
+	if ((s = mlreply("Use buffer: ", bufn, NBUFN)) != TRUE)
+		return (s);
+	if ((bp = bfind(bufn, TRUE, 0)) == NULL)
+		return (FALSE);
+	return (swbuffer(bp));
 }
 
-nextbuffer(f, n)	/* switch to the next buffer in the buffer list */
-
-int f, n;	/* default flag, numeric argument */
+nextbuffer(f, n)
+    /* switch to the next buffer in the buffer list */
+int f, n;			/* default flag, numeric argument */
 {
-	register BUFFER *bp;	/* eligable buffer to switch to*/
-	register BUFFER *bbp;	/* eligable buffer to switch to*/
+	register BUFFER *bp;	/* eligable buffer to switch to */
+	register BUFFER *bbp;	/* eligable buffer to switch to */
 
 	/* make sure the arg is legit */
 	if (f == FALSE)
 		n = 1;
 	if (n < 1)
-		return(FALSE);
+		return (FALSE);
 
 	bbp = curbp;
 	while (n-- > 0) {
 
 			/* don't get caught in an infinite loop! */
 			if (bp == bbp)
-				return(FALSE);
+				return (FALSE);
 
-		}		
+		}
 
 		bbp = bp;
 	}
 
-	return(swbuffer(bp));
+	return (swbuffer(bp));
 }
 
-swbuffer(bp)	/* make buffer BP current */
-
+swbuffer(bp)
+    /* make buffer BP current */
 BUFFER *bp;
 
 {
-        register WINDOW *wp;
-
-        if (--curbp->b_nwnd == 0) {             /* Last use.            */
-                curbp->b_dotp  = curwp->w_dotp;
-                curbp->b_doto  = curwp->w_doto;
-                curbp->b_markp = curwp->w_markp;
-                curbp->b_marko = curwp->w_marko;
-        }
-        curbp = bp;                             /* Switch.              */
-	if (curbp->b_active != TRUE) {		/* buffer not active yet*/
+	register WINDOW *wp;
+
+	if (--curbp->b_nwnd == 0) {	/* Last use.            */
+		curbp->b_dotp = curwp->w_dotp;
+		curbp->b_doto = curwp->w_doto;
+		curbp->b_markp = curwp->w_markp;
+		curbp->b_marko = curwp->w_marko;
+	}
+	curbp = bp;		/* Switch.              */
+	if (curbp->b_active != TRUE) {	/* buffer not active yet */
 		/* read it in and activate it */
 		readin(curbp->b_fname, TRUE);
 		curbp->b_dotp = lforw(curbp->b_linep);
 		curbp->b_doto = 0;
 		curbp->b_active = TRUE;
-		curbp->b_mode |= gmode;		/* P.K. */
+		curbp->b_mode |= gmode;	/* P.K. */
 	}
-        curwp->w_bufp  = bp;
-        curwp->w_linep = bp->b_linep;           /* For macros, ignored. */
-        curwp->w_flag |= WFMODE|WFFORCE|WFHARD; /* Quite nasty.         */
-        if (bp->b_nwnd++ == 0) {                /* First use.           */
-                curwp->w_dotp  = bp->b_dotp;
-                curwp->w_doto  = bp->b_doto;
-                curwp->w_markp = bp->b_markp;
+	curwp->w_bufp = bp;
+	curwp->w_linep = bp->b_linep;	/* For macros, ignored. */
+	curwp->w_flag |= WFMODE | WFFORCE | WFHARD;	/* Quite nasty.         */
+	if (bp->b_nwnd++ == 0) {	/* First use.           */
+		curwp->w_dotp = bp->b_dotp;
+		curwp->w_doto = bp->b_doto;
+		curwp->w_markp = bp->b_markp;
 		curwp->w_marko = bp->b_marko;
 		cknewwindow();
-                return (TRUE);
-        }
-        wp = wheadp;                            /* Look for old.        */
-        while (wp != NULL) {
-                if (wp!=curwp && wp->w_bufp==bp) {
-                        curwp->w_dotp  = wp->w_dotp;
-                        curwp->w_doto  = wp->w_doto;
-                        curwp->w_markp = wp->w_markp;
-                        curwp->w_marko = wp->w_marko;
-                        break;
-                }
-                wp = wp->w_wndp;
-        }
+		return (TRUE);
+	}
+	wp = wheadp;		/* Look for old.        */
+	while (wp != NULL) {
+		if (wp != curwp && wp->w_bufp == bp) {
+			curwp->w_dotp = wp->w_dotp;
+			curwp->w_doto = wp->w_doto;
+			curwp->w_markp = wp->w_markp;
+			curwp->w_marko = wp->w_marko;
+			break;
+		}
+		wp = wp->w_wndp;
+	}
 	cknewwindow();
 	return (TRUE);
 }
  * line and the buffer header. Bound to "C-X K".
  */
 killbuffer(f, n)
-
 {
 	register BUFFER *bp;
-        register int    s;
-        char bufn[NBUFN];
-
-        if ((s=mlreply("Kill buffer: ", bufn, NBUFN)) != TRUE)
-                return(s);
-        if ((bp=bfind(bufn, FALSE, 0)) == NULL) /* Easy if unknown.     */
-                return (TRUE);
-	if(bp->b_flag & BFINVS)		/* Deal with special buffers	*/
-			return (TRUE);		/* by doing nothing.	*/
-	return(zotbuf(bp));
+	register int s;
+	char bufn[NBUFN];
+
+	if ((s = mlreply("Kill buffer: ", bufn, NBUFN)) != TRUE)
+		return (s);
+	if ((bp = bfind(bufn, FALSE, 0)) == NULL)	/* Easy if unknown.     */
+		return (TRUE);
+	if (bp->b_flag & BFINVS)	/* Deal with special buffers        */
+		return (TRUE);	/* by doing nothing.    */
+	return (zotbuf(bp));
 }
 
-zotbuf(bp)	/* kill the buffer pointed to by bp */
-
+zotbuf(bp)
+    /* kill the buffer pointed to by bp */
 register BUFFER *bp;
 
 {
-        register BUFFER *bp1;
-        register BUFFER *bp2;
-        register int    s;
-
-        if (bp->b_nwnd != 0) {                  /* Error if on screen.  */
-                mlwrite("Buffer is being displayed");
-                return (FALSE);
-        }
-        if ((s=bclear(bp)) != TRUE)             /* Blow text away.      */
-                return (s);
-        free((char *) bp->b_linep);             /* Release header line. */
-        bp1 = NULL;                             /* Find the header.     */
-        bp2 = bheadp;
-        while (bp2 != bp) {
-                bp1 = bp2;
-                bp2 = bp2->b_bufp;
-        }
-        bp2 = bp2->b_bufp;                      /* Next one in chain.   */
-        if (bp1 == NULL)                        /* Unlink it.           */
-                bheadp = bp2;
-        else
-                bp1->b_bufp = bp2;
-        free((char *) bp);                      /* Release buffer block */
-        return (TRUE);
-}
+	register BUFFER *bp1;
+	register BUFFER *bp2;
+	register int s;
 
-namebuffer(f,n)		/*	Rename the current buffer	*/
+	if (bp->b_nwnd != 0) {	/* Error if on screen.  */
+		mlwrite("Buffer is being displayed");
+		return (FALSE);
+	}
+	if ((s = bclear(bp)) != TRUE)	/* Blow text away.      */
+		return (s);
+	free((char *) bp->b_linep);	/* Release header line. */
+	bp1 = NULL;		/* Find the header.     */
+	bp2 = bheadp;
+	while (bp2 != bp) {
+		bp1 = bp2;
+		bp2 = bp2->b_bufp;
+	}
+	bp2 = bp2->b_bufp;	/* Next one in chain.   */
+	if (bp1 == NULL)	/* Unlink it.           */
+		bheadp = bp2;
+	else
+		bp1->b_bufp = bp2;
+	free((char *) bp);	/* Release buffer block */
+	return (TRUE);
+}
 
-int f, n;		/* default Flag & Numeric arg */
+namebuffer(f, n)
+    /*  Rename the current buffer       */
+int f, n;			/* default Flag & Numeric arg */
 
 {
 	register BUFFER *bp;	/* pointer to scan through all buffers */
 	char bufn[NBUFN];	/* buffer to hold buffer name */
 
 	/* prompt for and get the new buffer name */
-ask:	if (mlreply("Change buffer name to: ", bufn, NBUFN) != TRUE)
-		return(FALSE);
+      ask:if (mlreply("Change buffer name to: ", bufn, NBUFN) !=
+	    TRUE)
+		return (FALSE);
 
 	/* and check for duplicates */
 	bp = bheadp;
 		if (bp != curbp) {
 			/* if the names the same */
 			if (strcmp(bufn, bp->b_bname) == 0)
-				goto ask;  /* try again */
+				goto ask;	/* try again */
 		}
 		bp = bp->b_bufp;	/* onward */
 	}
 	strcpy(curbp->b_bname, bufn);	/* copy buffer name to structure */
 	curwp->w_flag |= WFMODE;	/* make mode line replot */
 	mlerase();
-	return(TRUE);
+	return (TRUE);
 }
 
 /*
 
 listbuffers(f, n)
 {
-        register WINDOW *wp;
-        register BUFFER *bp;
-        register int    s;
-
-        if ((s=makelist(f)) != TRUE)
-                return (s);
-        if (blistp->b_nwnd == 0) {              /* Not on screen yet.   */
-                if ((wp=wpopup()) == NULL)
-                        return (FALSE);
-                bp = wp->w_bufp;
-                if (--bp->b_nwnd == 0) {
-                        bp->b_dotp  = wp->w_dotp;
-                        bp->b_doto  = wp->w_doto;
-                        bp->b_markp = wp->w_markp;
-                        bp->b_marko = wp->w_marko;
-                }
-                wp->w_bufp  = blistp;
-                ++blistp->b_nwnd;
-        }
-        wp = wheadp;
-        while (wp != NULL) {
-                if (wp->w_bufp == blistp) {
-                        wp->w_linep = lforw(blistp->b_linep);
-                        wp->w_dotp  = lforw(blistp->b_linep);
-                        wp->w_doto  = 0;
-                        wp->w_markp = NULL;
-                        wp->w_marko = 0;
-                        wp->w_flag |= WFMODE|WFHARD;
-                }
-                wp = wp->w_wndp;
-        }
-        return (TRUE);
+	register WINDOW *wp;
+	register BUFFER *bp;
+	register int s;
+
+	if ((s = makelist(f)) != TRUE)
+		return (s);
+	if (blistp->b_nwnd == 0) {	/* Not on screen yet.   */
+		if ((wp = wpopup()) == NULL)
+			return (FALSE);
+		bp = wp->w_bufp;
+		if (--bp->b_nwnd == 0) {
+			bp->b_dotp = wp->w_dotp;
+			bp->b_doto = wp->w_doto;
+			bp->b_markp = wp->w_markp;
+			bp->b_marko = wp->w_marko;
+		}
+		wp->w_bufp = blistp;
+		++blistp->b_nwnd;
+	}
+	wp = wheadp;
+	while (wp != NULL) {
+		if (wp->w_bufp == blistp) {
+			wp->w_linep = lforw(blistp->b_linep);
+			wp->w_dotp = lforw(blistp->b_linep);
+			wp->w_doto = 0;
+			wp->w_markp = NULL;
+			wp->w_marko = 0;
+			wp->w_flag |= WFMODE | WFHARD;
+		}
+		wp = wp->w_wndp;
+	}
+	return (TRUE);
 }
 
 /*
 #define MAXLINE	MAXCOL
 makelist(iflag)
 
-int iflag;	/* list hidden buffer flag */
+int iflag;			/* list hidden buffer flag */
 
 {
-        register char   *cp1;
-        register char   *cp2;
-        register int    c;
-        register BUFFER *bp;
-        register LINE   *lp;
-        register int    s;
-	register int	i;
-        long nbytes;		/* # of bytes in current buffer */
-        char b[7+1];
-        char line[MAXLINE];
-
-        blistp->b_flag &= ~BFCHG;               /* Don't complain!      */
-        if ((s=bclear(blistp)) != TRUE)         /* Blow old text away   */
-                return (s);
-        strcpy(blistp->b_fname, "");
-        if (addline("ACT MODES        Size Buffer        File") == FALSE
-        ||  addline("--- -----        ---- ------        ----") == FALSE)
-                return (FALSE);
-        bp = bheadp;                            /* For all buffers      */
+	register char *cp1;
+	register char *cp2;
+	register int c;
+	register BUFFER *bp;
+	register LINE *lp;
+	register int s;
+	register int i;
+	long nbytes;		/* # of bytes in current buffer */
+	char b[7 + 1];
+	char line[MAXLINE];
+
+	blistp->b_flag &= ~BFCHG;	/* Don't complain!      */
+	if ((s = bclear(blistp)) != TRUE)	/* Blow old text away   */
+		return (s);
+	strcpy(blistp->b_fname, "");
+	if (addline("ACT MODES        Size Buffer        File") == FALSE
+	    || addline("--- -----        ---- ------        ----") ==
+	    FALSE)
+		return (FALSE);
+	bp = bheadp;		/* For all buffers      */
 
 	/* build line to report global mode settings */
 	cp1 = &line[0];
 			*cp1++ = '.';
 	strcpy(cp1, "         Global Modes");
 	if (addline(line) == FALSE)
-		return(FALSE);
+		return (FALSE);
 
 	/* output the list of buffers */
-        while (bp != NULL) {
+	while (bp != NULL) {
 		/* skip invisable buffers if iflag is false */
-                if (((bp->b_flag&BFINVS) != 0) && (iflag != TRUE)) {
-                        bp = bp->b_bufp;
-                        continue;
-                }
-                cp1 = &line[0];                 /* Start at left edge   */
+		if (((bp->b_flag & BFINVS) != 0) && (iflag != TRUE)) {
+			bp = bp->b_bufp;
+			continue;
+		}
+		cp1 = &line[0];	/* Start at left edge   */
 
 		/* output status of ACTIVE flag (has the file been read in? */
-                if (bp->b_active == TRUE)    /* "@" if activated       */
-                        *cp1++ = '@';
-                else
-                        *cp1++ = ' ';
+		if (bp->b_active == TRUE)	/* "@" if activated       */
+			*cp1++ = '@';
+		else
+			*cp1++ = ' ';
 
 		/* output status of changed flag */
-                if ((bp->b_flag&BFCHG) != 0)    /* "*" if changed       */
-                        *cp1++ = '*';
-                else
-                        *cp1++ = ' ';
+		if ((bp->b_flag & BFCHG) != 0)	/* "*" if changed       */
+			*cp1++ = '*';
+		else
+			*cp1++ = ' ';
 
 		/* report if the file is truncated */
-                if ((bp->b_flag&BFTRUNC) != 0)
-                        *cp1++ = '#';
-                else
-                        *cp1++ = ' ';
+		if ((bp->b_flag & BFTRUNC) != 0)
+			*cp1++ = '#';
+		else
+			*cp1++ = ' ';
 
-                *cp1++ = ' ';	/* space */
+		*cp1++ = ' ';	/* space */
 
 		/* output the mode codes */
 		for (i = 0; i < NUMMODES; i++) {
 			else
 				*cp1++ = '.';
 		}
-                *cp1++ = ' ';                   /* Gap.                 */
-                nbytes = 0L;                    /* Count bytes in buf.  */
-                lp = lforw(bp->b_linep);
-                while (lp != bp->b_linep) {
-                        nbytes += (long)llength(lp)+1L;
-                        lp = lforw(lp);
-                }
-                ltoa(b, 7, nbytes);             /* 6 digit buffer size. */
-                cp2 = &b[0];
-                while ((c = *cp2++) != 0)
-                        *cp1++ = c;
-                *cp1++ = ' ';                   /* Gap.                 */
-                cp2 = &bp->b_bname[0];          /* Buffer name          */
-                while ((c = *cp2++) != 0)
-                        *cp1++ = c;
-                cp2 = &bp->b_fname[0];          /* File name            */
-                if (*cp2 != 0) {
-                        while (cp1 < &line[3+1+5+1+6+4+NBUFN])
-                                *cp1++ = ' ';
-                        while ((c = *cp2++) != 0) {
-                                if (cp1 < &line[MAXLINE-1])
-                                        *cp1++ = c;
-                        }
-                }
-                *cp1 = 0;                       /* Add to the buffer.   */
-                if (addline(line) == FALSE)
-                        return (FALSE);
-                bp = bp->b_bufp;
-        }
-        return (TRUE);                          /* All done             */
+		*cp1++ = ' ';	/* Gap.                 */
+		nbytes = 0L;	/* Count bytes in buf.  */
+		lp = lforw(bp->b_linep);
+		while (lp != bp->b_linep) {
+			nbytes += (long) llength(lp) + 1L;
+			lp = lforw(lp);
+		}
+		ltoa(b, 7, nbytes);	/* 6 digit buffer size. */
+		cp2 = &b[0];
+		while ((c = *cp2++) != 0)
+			*cp1++ = c;
+		*cp1++ = ' ';	/* Gap.                 */
+		cp2 = &bp->b_bname[0];	/* Buffer name          */
+		while ((c = *cp2++) != 0)
+			*cp1++ = c;
+		cp2 = &bp->b_fname[0];	/* File name            */
+		if (*cp2 != 0) {
+			while (cp1 < &line[3 + 1 + 5 + 1 + 6 + 4 + NBUFN])
+				*cp1++ = ' ';
+			while ((c = *cp2++) != 0) {
+				if (cp1 < &line[MAXLINE - 1])
+					*cp1++ = c;
+			}
+		}
+		*cp1 = 0;	/* Add to the buffer.   */
+		if (addline(line) == FALSE)
+			return (FALSE);
+		bp = bp->b_bufp;
+	}
+	return (TRUE);		/* All done             */
 }
 
 ltoa(buf, width, num)
 
-char   buf[];
-int    width;
-long   num;
+char buf[];
+int width;
+long num;
 
 {
-        buf[width] = 0;                         /* End of string.       */
-        while (num >= 10) {                     /* Conditional digits.  */
-                buf[--width] = (int)(num%10L) + '0';
-                num /= 10L;
-        }
-        buf[--width] = (int)num + '0';          /* Always 1 digit.      */
-        while (width != 0)                      /* Pad with blanks.     */
-                buf[--width] = ' ';
+	buf[width] = 0;		/* End of string.       */
+	while (num >= 10) {	/* Conditional digits.  */
+		buf[--width] = (int) (num % 10L) + '0';
+		num /= 10L;
+	}
+	buf[--width] = (int) num + '0';	/* Always 1 digit.      */
+	while (width != 0)	/* Pad with blanks.     */
+		buf[--width] = ' ';
 }
 
 /*
  * FALSE if you ran out of room.
  */
 addline(text)
-char    *text;
+char *text;
 {
-        register LINE   *lp;
-        register int    i;
-        register int    ntext;
-
-        ntext = strlen(text);
-        if ((lp=lalloc(ntext)) == NULL)
-                return (FALSE);
-        for (i=0; i<ntext; ++i)
-                lputc(lp, i, text[i]);
-        blistp->b_linep->l_bp->l_fp = lp;       /* Hook onto the end    */
-        lp->l_bp = blistp->b_linep->l_bp;
-        blistp->b_linep->l_bp = lp;
-        lp->l_fp = blistp->b_linep;
-        if (blistp->b_dotp == blistp->b_linep)  /* If "." is at the end */
-                blistp->b_dotp = lp;            /* move it to new line  */
-        return (TRUE);
+	register LINE *lp;
+	register int i;
+	register int ntext;
+
+	ntext = strlen(text);
+	if ((lp = lalloc(ntext)) == NULL)
+		return (FALSE);
+	for (i = 0; i < ntext; ++i)
+		lputc(lp, i, text[i]);
+	blistp->b_linep->l_bp->l_fp = lp;	/* Hook onto the end    */
+	lp->l_bp = blistp->b_linep->l_bp;
+	blistp->b_linep->l_bp = lp;
+	lp->l_fp = blistp->b_linep;
+	if (blistp->b_dotp == blistp->b_linep)	/* If "." is at the end */
+		blistp->b_dotp = lp;	/* move it to new line  */
+	return (TRUE);
 }
 
 /*
  */
 anycb()
 {
-        register BUFFER *bp;
-
-        bp = bheadp;
-        while (bp != NULL) {
-                if ((bp->b_flag&BFINVS)==0 && (bp->b_flag&BFCHG)!=0)
-                        return (TRUE);
-                bp = bp->b_bufp;
-        }
-        return (FALSE);
+	register BUFFER *bp;
+
+	bp = bheadp;
+	while (bp != NULL) {
+		if ((bp->b_flag & BFINVS) == 0
+		    && (bp->b_flag & BFCHG) != 0)
+			return (TRUE);
+		bp = bp->b_bufp;
+	}
+	return (FALSE);
 }
 
 /*
  * and the "cflag" is TRUE, create it. The "bflag" is
  * the settings for the flags in in buffer.
  */
-BUFFER  *
-bfind(bname, cflag, bflag)
-register char   *bname;
+BUFFER *bfind(bname, cflag, bflag)
+register char *bname;
 {
-        register BUFFER *bp;
+	register BUFFER *bp;
 	register BUFFER *sb;	/* buffer to insert after */
-        register LINE   *lp;
+	register LINE *lp;
 	char *malloc();
 
-        bp = bheadp;
-        while (bp != NULL) {
-                if (strcmp(bname, bp->b_bname) == 0)
-                        return (bp);
-                bp = bp->b_bufp;
-        }
-        if (cflag != FALSE) {
-                if ((bp=(BUFFER *)malloc(sizeof(BUFFER))) == NULL)
-                        return (NULL);
-                if ((lp=lalloc(0)) == NULL) {
-                        free((char *) bp);
-                        return (NULL);
-                }
+	bp = bheadp;
+	while (bp != NULL) {
+		if (strcmp(bname, bp->b_bname) == 0)
+			return (bp);
+		bp = bp->b_bufp;
+	}
+	if (cflag != FALSE) {
+		if ((bp = (BUFFER *) malloc(sizeof(BUFFER))) == NULL)
+			return (NULL);
+		if ((lp = lalloc(0)) == NULL) {
+			free((char *) bp);
+			return (NULL);
+		}
 		/* find the place in the list to insert this buffer */
 		if (bheadp == NULL || strcmp(bheadp->b_bname, bname) > 0) {
 			/* insert at the beginning */
-	                bp->b_bufp = bheadp;
-        	        bheadp = bp;
-        	} else {
+			bp->b_bufp = bheadp;
+			bheadp = bp;
+		} else {
 			sb = bheadp;
 			while (sb->b_bufp != NULL) {
 				if (strcmp(sb->b_bufp->b_bname, bname) > 0)
 			}
 
 			/* and insert it */
-       			bp->b_bufp = sb->b_bufp;
-        		sb->b_bufp = bp;
-       		}
+			bp->b_bufp = sb->b_bufp;
+			sb->b_bufp = bp;
+		}
 
 		/* and set up the other buffer fields */
 		bp->b_active = TRUE;
-                bp->b_dotp  = lp;
-                bp->b_doto  = 0;
-                bp->b_markp = NULL;
-                bp->b_marko = 0;
-                bp->b_flag  = bflag;
-		bp->b_mode  = gmode;
-                bp->b_nwnd  = 0;
-                bp->b_linep = lp;
-                strcpy(bp->b_fname, "");
-                strcpy(bp->b_bname, bname);
+		bp->b_dotp = lp;
+		bp->b_doto = 0;
+		bp->b_markp = NULL;
+		bp->b_marko = 0;
+		bp->b_flag = bflag;
+		bp->b_mode = gmode;
+		bp->b_nwnd = 0;
+		bp->b_linep = lp;
+		strcpy(bp->b_fname, "");
+		strcpy(bp->b_bname, bname);
 #if	CRYPT
 		bp->b_key[0] = 0;
 #endif
-                lp->l_fp = lp;
-                lp->l_bp = lp;
-        }
-        return (bp);
+		lp->l_fp = lp;
+		lp->l_bp = lp;
+	}
+	return (bp);
 }
 
 /*
 bclear(bp)
 register BUFFER *bp;
 {
-        register LINE   *lp;
-        register int    s;
-
-        if ((bp->b_flag&BFINVS) == 0            /* Not scratch buffer.  */
-        && (bp->b_flag&BFCHG) != 0              /* Something changed    */
-        && (s=mlyesno("Discard changes")) != TRUE)
-                return (s);
-        bp->b_flag  &= ~BFCHG;                  /* Not changed          */
-        while ((lp=lforw(bp->b_linep)) != bp->b_linep)
-                lfree(lp);
-        bp->b_dotp  = bp->b_linep;              /* Fix "."              */
-        bp->b_doto  = 0;
-        bp->b_markp = NULL;                     /* Invalidate "mark"    */
-        bp->b_marko = 0;
-        return (TRUE);
+	register LINE *lp;
+	register int s;
+
+	if ((bp->b_flag & BFINVS) == 0	/* Not scratch buffer.  */
+	    && (bp->b_flag & BFCHG) != 0	/* Something changed    */
+	    && (s = mlyesno("Discard changes")) != TRUE)
+		return (s);
+	bp->b_flag &= ~BFCHG;	/* Not changed          */
+	while ((lp = lforw(bp->b_linep)) != bp->b_linep)
+		lfree(lp);
+	bp->b_dotp = bp->b_linep;	/* Fix "."              */
+	bp->b_doto = 0;
+	bp->b_markp = NULL;	/* Invalidate "mark"    */
+	bp->b_marko = 0;
+	return (TRUE);
 }
 
-unmark(f, n)	/* unmark the current buffers change flag */
-
-int f, n;	/* unused command arguments */
+unmark(f, n)
+    /* unmark the current buffers change flag */
+int f, n;			/* unused command arguments */
 
 {
 	curbp->b_flag &= ~BFCHG;
 	curwp->w_flag |= WFMODE;
-	return(TRUE);
+	return (TRUE);
 }
 
 static int mod95();
 
-setkey(f, n)	/* reset encryption key of current buffer */
-
-int f;		/* default flag */
-int n;		/* numeric argument */
+setkey(f, n)
+    /* reset encryption key of current buffer */
+int f;				/* default flag */
+int n;				/* numeric argument */
 
 {