diff options
author | Kjell Wooding <kjell@cvs.openbsd.org> | 2006-05-28 23:30:17 +0000 |
---|---|---|
committer | Kjell Wooding <kjell@cvs.openbsd.org> | 2006-05-28 23:30:17 +0000 |
commit | 442d7bef79c89cebc8644e400f5bec74721d6092 (patch) | |
tree | f88615cfcffdd017d5ebe172d074896c13ba3663 | |
parent | a2416f06ac46dabf19752b024b229348c8d22815 (diff) |
Make Window Flags more mnemonic (and less dumb); i.e.
WFHARD -> WFFULL (Redraw full window)
WFFORCE -> WFFRAME (Reframe window).
No binary change
-rw-r--r-- | usr.bin/mg/basic.c | 14 | ||||
-rw-r--r-- | usr.bin/mg/buffer.c | 14 | ||||
-rw-r--r-- | usr.bin/mg/def.h | 6 | ||||
-rw-r--r-- | usr.bin/mg/dired.c | 14 | ||||
-rw-r--r-- | usr.bin/mg/display.c | 10 | ||||
-rw-r--r-- | usr.bin/mg/file.c | 8 | ||||
-rw-r--r-- | usr.bin/mg/line.c | 12 | ||||
-rw-r--r-- | usr.bin/mg/main.c | 4 | ||||
-rw-r--r-- | usr.bin/mg/re_search.c | 4 | ||||
-rw-r--r-- | usr.bin/mg/region.c | 6 | ||||
-rw-r--r-- | usr.bin/mg/search.c | 6 | ||||
-rw-r--r-- | usr.bin/mg/window.c | 18 | ||||
-rw-r--r-- | usr.bin/mg/word.c | 10 | ||||
-rw-r--r-- | usr.bin/mg/yank.c | 4 |
14 files changed, 65 insertions, 65 deletions
diff --git a/usr.bin/mg/basic.c b/usr.bin/mg/basic.c index cba7fc9657a..b31c6f946df 100644 --- a/usr.bin/mg/basic.c +++ b/usr.bin/mg/basic.c @@ -1,4 +1,4 @@ -/* $OpenBSD: basic.c,v 1.21 2005/11/18 20:56:52 deraadt Exp $ */ +/* $OpenBSD: basic.c,v 1.22 2006/05/28 23:30:16 kjell Exp $ */ /* This file is in the public domain */ @@ -98,7 +98,7 @@ forwchar(int f, int n) /* * Go to the beginning of the - * buffer. Setting WFHARD is conservative, + * buffer. Setting WFFULL is conservative, * but almost always the case. */ int @@ -107,13 +107,13 @@ gotobob(int f, int n) (void) setmark(f, n); curwp->w_dotp = lforw(curbp->b_linep); curwp->w_doto = 0; - curwp->w_flag |= WFHARD; + curwp->w_flag |= WFFULL; return (TRUE); } /* * Go to the end of the buffer. - * Setting WFHARD is conservative, but + * Setting WFFULL is conservative, but * almost always the case. */ int @@ -122,7 +122,7 @@ gotoeob(int f, int n) (void) setmark(f, n); curwp->w_dotp = lback(curbp->b_linep); curwp->w_doto = llength(curwp->w_dotp); - curwp->w_flag |= WFHARD; + curwp->w_flag |= WFFULL; return (TRUE); } @@ -276,7 +276,7 @@ forwpage(int f, int n) while (n-- && lforw(lp) != curbp->b_linep) lp = lforw(lp); curwp->w_linep = lp; - curwp->w_flag |= WFHARD; + curwp->w_flag |= WFFULL; /* if in current window, don't move dot */ for (n = curwp->w_ntrows; n-- && lp != curbp->b_linep; lp = lforw(lp)) if (lp == curwp->w_dotp) @@ -314,7 +314,7 @@ backpage(int f, int n) while (n-- && lback(lp) != curbp->b_linep) lp = lback(lp); curwp->w_linep = lp; - curwp->w_flag |= WFHARD; + curwp->w_flag |= WFFULL; /* if in current window, don't move dot */ for (n = curwp->w_ntrows; n-- && lp != curbp->b_linep; lp = lforw(lp)) if (lp == curwp->w_dotp) diff --git a/usr.bin/mg/buffer.c b/usr.bin/mg/buffer.c index bc4b5cb8860..52d0b3e21c9 100644 --- a/usr.bin/mg/buffer.c +++ b/usr.bin/mg/buffer.c @@ -1,4 +1,4 @@ -/* $OpenBSD: buffer.c,v 1.57 2006/05/02 17:10:25 kjell Exp $ */ +/* $OpenBSD: buffer.c,v 1.58 2006/05/28 23:30:16 kjell Exp $ */ /* This file is in the public domain. */ @@ -61,7 +61,7 @@ usebuffer(int f, int n) /* and put it in current window */ curbp = bp; - return (showbuffer(bp, curwp, WFFORCE | WFHARD)); + return (showbuffer(bp, curwp, WFFRAME | WFFULL)); } /* @@ -153,7 +153,7 @@ killbuffer(struct buffer *bp) for (wp = wheadp; bp->b_nwnd > 0; wp = wp->w_wndp) { if (wp->w_bufp == bp) { bp2 = bp1->b_altb; /* save alternate buffer */ - if (showbuffer(bp1, wp, WFMODE | WFFORCE | WFHARD)) + if (showbuffer(bp1, wp, WFMODE | WFFRAME | WFFULL)) bp1->b_altb = bp2; else bp1 = bp2; @@ -649,10 +649,10 @@ popbuf(struct buffer *bp) } else for (wp = wheadp; wp != NULL; wp = wp->w_wndp) if (wp->w_bufp == bp) { - wp->w_flag |= WFHARD | WFFORCE; + wp->w_flag |= WFFULL | WFFRAME; return (wp); } - if (showbuffer(bp, wp, WFHARD) != TRUE) + if (showbuffer(bp, wp, WFFULL) != TRUE) return (NULL); return (wp); } @@ -709,7 +709,7 @@ bufferinsert(int f, int n) while (nline-- && lback(clp) != curbp->b_linep) clp = lback(clp); curwp->w_linep = clp; /* adjust framing. */ - curwp->w_flag |= WFHARD; + curwp->w_flag |= WFFULL; } return (TRUE); } @@ -751,7 +751,7 @@ popbuftop(struct buffer *bp) if (wp->w_bufp == bp) { wp->w_dotp = bp->b_dotp; wp->w_doto = 0; - wp->w_flag |= WFHARD; + wp->w_flag |= WFFULL; } } return (popbuf(bp) != NULL); diff --git a/usr.bin/mg/def.h b/usr.bin/mg/def.h index ffb982be5fc..339ee66942d 100644 --- a/usr.bin/mg/def.h +++ b/usr.bin/mg/def.h @@ -1,4 +1,4 @@ -/* $OpenBSD: def.h,v 1.88 2006/05/27 21:20:11 kjell Exp $ */ +/* $OpenBSD: def.h,v 1.89 2006/05/28 23:30:16 kjell Exp $ */ /* This file is in the public domain. */ @@ -218,10 +218,10 @@ struct mgwin { * Because commands set bits in the "w_flag", update will see * all change flags, and do the most general one. */ -#define WFFORCE 0x01 /* Force reframe. */ +#define WFFRAME 0x01 /* Force reframe. */ #define WFMOVE 0x02 /* Movement from line to line. */ #define WFEDIT 0x04 /* Editing within a line. */ -#define WFHARD 0x08 /* Better to a full display. */ +#define WFFULL 0x08 /* Do a full display. */ #define WFMODE 0x10 /* Update mode line. */ struct undo_rec; diff --git a/usr.bin/mg/dired.c b/usr.bin/mg/dired.c index e89f5c803ec..b6d51a66d7f 100644 --- a/usr.bin/mg/dired.c +++ b/usr.bin/mg/dired.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dired.c,v 1.36 2006/05/02 17:10:25 kjell Exp $ */ +/* $OpenBSD: dired.c,v 1.37 2006/05/28 23:30:16 kjell Exp $ */ /* This file is in the public domain. */ @@ -197,7 +197,7 @@ dired(int f, int n) return (FALSE); curbp = bp; - return (showbuffer(bp, curwp, WFHARD | WFMODE)); + return (showbuffer(bp, curwp, WFFULL | WFMODE)); } /* ARGSUSED */ @@ -300,7 +300,7 @@ d_findfile(int f, int n) if (bp == NULL) return (FALSE); curbp = bp; - if (showbuffer(bp, curwp, WFHARD) != TRUE) + if (showbuffer(bp, curwp, WFFULL) != TRUE) return (FALSE); if (bp->b_fname[0] != 0) return (TRUE); @@ -359,7 +359,7 @@ d_expunge(int f, int n) break; } lfree(lp); - curwp->w_flag |= WFHARD; + curwp->w_flag |= WFFULL; } } return (TRUE); @@ -392,7 +392,7 @@ d_copy(int f, int n) if (ret != TRUE) return (ret); bp = dired_(curbp->b_fname); - return (showbuffer(bp, curwp, WFHARD | WFMODE)); + return (showbuffer(bp, curwp, WFFULL | WFMODE)); } /* ARGSUSED */ @@ -422,7 +422,7 @@ d_rename(int f, int n) if (ret != TRUE) return (ret); bp = dired_(curbp->b_fname); - return (showbuffer(bp, curwp, WFHARD | WFMODE)); + return (showbuffer(bp, curwp, WFFULL | WFMODE)); } /* ARGSUSED */ @@ -550,7 +550,7 @@ d_create_directory(int f, int n) return (FALSE); } bp = dired_(curbp->b_fname); - return (showbuffer(bp, curwp, WFHARD | WFMODE)); + return (showbuffer(bp, curwp, WFFULL | WFMODE)); } #define NAME_FIELD 8 diff --git a/usr.bin/mg/display.c b/usr.bin/mg/display.c index 80a2b489f9c..0351c97dab3 100644 --- a/usr.bin/mg/display.c +++ b/usr.bin/mg/display.c @@ -1,4 +1,4 @@ -/* $OpenBSD: display.c,v 1.26 2005/12/13 06:01:27 kjell Exp $ */ +/* $OpenBSD: display.c,v 1.27 2006/05/28 23:30:16 kjell Exp $ */ /* This file is in the public domain. */ @@ -376,7 +376,7 @@ update(void) if (sgarbf) { /* must update everything */ wp = wheadp; while (wp != NULL) { - wp->w_flag |= WFMODE | WFHARD; + wp->w_flag |= WFMODE | WFFULL; wp = wp->w_wndp; } } @@ -388,7 +388,7 @@ update(void) if (wp->w_flag == 0) continue; - if ((wp->w_flag & WFFORCE) == 0) { + if ((wp->w_flag & WFFRAME) == 0) { lp = wp->w_linep; for (i = 0; i < wp->w_ntrows; ++i) { if (lp == wp->w_dotp) @@ -422,7 +422,7 @@ update(void) lp = lback(lp); } wp->w_linep = lp; - wp->w_flag |= WFHARD; /* Force full. */ + wp->w_flag |= WFFULL; /* Force full. */ out: lp = wp->w_linep; /* Try reduced update. */ i = wp->w_toprow; @@ -437,7 +437,7 @@ update(void) for (j = 0; j < llength(lp); ++j) vtputc(lgetc(lp, j)); vteeol(); - } else if ((wp->w_flag & (WFEDIT | WFHARD)) != 0) { + } else if ((wp->w_flag & (WFEDIT | WFFULL)) != 0) { hflag = TRUE; while (i < wp->w_toprow + wp->w_ntrows) { vscreen[i]->v_color = CTEXT; diff --git a/usr.bin/mg/file.c b/usr.bin/mg/file.c index 74120b0a472..20809d53890 100644 --- a/usr.bin/mg/file.c +++ b/usr.bin/mg/file.c @@ -1,4 +1,4 @@ -/* $OpenBSD: file.c,v 1.54 2006/05/02 17:10:25 kjell Exp $ */ +/* $OpenBSD: file.c,v 1.55 2006/05/28 23:30:16 kjell Exp $ */ /* This file is in the public domain. */ @@ -62,7 +62,7 @@ filevisit(int f, int n) if ((bp = findbuffer(adjf)) == NULL) return (FALSE); curbp = bp; - if (showbuffer(bp, curwp, WFHARD) != TRUE) + if (showbuffer(bp, curwp, WFFULL) != TRUE) return (FALSE); if (bp->b_fname[0] == '\0') { if ((status = readin(adjf)) != TRUE) @@ -105,7 +105,7 @@ filevisitalt(int f, int n) if ((bp = findbuffer(adjf)) == NULL) return (FALSE); curbp = bp; - if (showbuffer(bp, curwp, WFHARD) != TRUE) + if (showbuffer(bp, curwp, WFFULL) != TRUE) return (FALSE); if (bp->b_fname[0] == '\0') { if ((status = readin(adjf)) != TRUE) @@ -324,7 +324,7 @@ insertfile(char *fname, char *newname, int replacebuf) return (FALSE); undo_enable(x); curbp = bp; - return (showbuffer(bp, curwp, WFHARD | WFMODE)); + return (showbuffer(bp, curwp, WFFULL | WFMODE)); } else { (void)strlcpy(bp->b_cwd, dirname(fname), sizeof(bp->b_cwd)); (void)strlcat(bp->b_cwd, "/", sizeof(bp->b_cwd)); diff --git a/usr.bin/mg/line.c b/usr.bin/mg/line.c index 014a0581e7f..df648807e11 100644 --- a/usr.bin/mg/line.c +++ b/usr.bin/mg/line.c @@ -1,4 +1,4 @@ -/* $OpenBSD: line.c,v 1.38 2006/05/27 21:20:11 kjell Exp $ */ +/* $OpenBSD: line.c,v 1.39 2006/05/28 23:30:16 kjell Exp $ */ /* This file is in the public domain. */ @@ -122,7 +122,7 @@ lchange(int flag) if (wp->w_bufp == curbp) { wp->w_flag |= flag; if (wp != curwp) - wp->w_flag |= WFHARD; + wp->w_flag |= WFFULL; } } } @@ -152,7 +152,7 @@ linsert_str(const char *s, int n) if (!n) return (TRUE); - lchange(WFHARD); + lchange(WFFULL); /* current line */ lp1 = curwp->w_dotp; @@ -316,7 +316,7 @@ lnewline_at(struct line *lp1, int doto) int nlen; struct mgwin *wp; - lchange(WFHARD); + lchange(WFFULL); /* If start of line, allocate a new line instead of copying */ if (doto == 0) { @@ -427,7 +427,7 @@ ldelete(RSIZE n, int kflag) if (dotp == lback(curbp->b_linep)) /* End of buffer */ return (FALSE); - lchange(WFHARD); + lchange(WFFULL); if (ldelnewline() == FALSE) return (FALSE); end = strlcat(sv, "\n", len + 1); @@ -563,7 +563,7 @@ lreplace(RSIZE plen, char *st) rlen = strlen(st); region_put_data(st, rlen); - lchange(WFHARD); + lchange(WFFULL); undo_no_boundary(FALSE); undo_add_boundary(); diff --git a/usr.bin/mg/main.c b/usr.bin/mg/main.c index 7ca6233e897..4500c461283 100644 --- a/usr.bin/mg/main.c +++ b/usr.bin/mg/main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.50 2006/04/03 02:43:22 kjell Exp $ */ +/* $OpenBSD: main.c,v 1.51 2006/05/28 23:30:16 kjell Exp $ */ /* This file is in the public domain. */ @@ -185,7 +185,7 @@ edinit(PF init_fcn) wp->w_wndp = NULL; /* Initialize window. */ wp->w_linep = wp->w_dotp = bp->b_linep; wp->w_ntrows = nrow - 2; /* 2 = mode, echo. */ - wp->w_flag = WFMODE | WFHARD; /* Full. */ + wp->w_flag = WFMODE | WFFULL; /* Full. */ if (init_fcn) init_fcn(0, 1); diff --git a/usr.bin/mg/re_search.c b/usr.bin/mg/re_search.c index c1b64af3300..bdc57aa2d05 100644 --- a/usr.bin/mg/re_search.c +++ b/usr.bin/mg/re_search.c @@ -1,4 +1,4 @@ -/* $OpenBSD: re_search.c,v 1.22 2005/12/13 06:01:27 kjell Exp $ */ +/* $OpenBSD: re_search.c,v 1.23 2006/05/28 23:30:16 kjell Exp $ */ /* This file is in the public domain. */ @@ -189,7 +189,7 @@ retry: } stopsearch: - curwp->w_flag |= WFHARD; + curwp->w_flag |= WFFULL; update(); if (!inmacro) { if (rcnt == 0) diff --git a/usr.bin/mg/region.c b/usr.bin/mg/region.c index 4d4f9a1f611..d225ea691ef 100644 --- a/usr.bin/mg/region.c +++ b/usr.bin/mg/region.c @@ -1,4 +1,4 @@ -/* $OpenBSD: region.c,v 1.21 2005/12/15 19:39:19 kjell Exp $ */ +/* $OpenBSD: region.c,v 1.22 2006/05/28 23:30:16 kjell Exp $ */ /* This file is in the public domain. */ @@ -102,7 +102,7 @@ lowerregion(int f, int n) undo_add_change(region.r_linep, region.r_offset, region.r_size); - lchange(WFHARD); + lchange(WFFULL); linep = region.r_linep; loffs = region.r_offset; while (region.r_size--) { @@ -142,7 +142,7 @@ upperregion(int f, int n) undo_add_change(region.r_linep, region.r_offset, region.r_size); - lchange(WFHARD); + lchange(WFFULL); linep = region.r_linep; loffs = region.r_offset; while (region.r_size--) { diff --git a/usr.bin/mg/search.c b/usr.bin/mg/search.c index 33a0f0e88dd..cb259031925 100644 --- a/usr.bin/mg/search.c +++ b/usr.bin/mg/search.c @@ -1,4 +1,4 @@ -/* $OpenBSD: search.c,v 1.28 2006/02/03 13:57:03 otto Exp $ */ +/* $OpenBSD: search.c,v 1.29 2006/05/28 23:30:16 kjell Exp $ */ /* This file is in the public domain. */ @@ -591,7 +591,7 @@ retry: } } stopsearch: - curwp->w_flag |= WFHARD; + curwp->w_flag |= WFFULL; update(); if (rcnt == 1) ewprintf("Replaced 1 occurrence"); @@ -628,7 +628,7 @@ replstr(int f, int n) rcnt++; } - curwp->w_flag |= WFHARD; + curwp->w_flag |= WFFULL; update(); if (rcnt == 1) diff --git a/usr.bin/mg/window.c b/usr.bin/mg/window.c index 21e20296afa..f7fcc4ca587 100644 --- a/usr.bin/mg/window.c +++ b/usr.bin/mg/window.c @@ -1,4 +1,4 @@ -/* $OpenBSD: window.c,v 1.21 2006/02/25 14:40:16 otto Exp $ */ +/* $OpenBSD: window.c,v 1.22 2006/05/28 23:30:16 kjell Exp $ */ /* This file is in the public domain. */ @@ -47,7 +47,7 @@ reposition(int f, int n) #else /* !GOSREC */ curwp->w_force = n; #endif /* !GOSREC */ - curwp->w_flag |= WFFORCE; + curwp->w_flag |= WFFRAME; sgarbf = TRUE; return (TRUE); } @@ -191,7 +191,7 @@ onlywind(int f, int n) /* 2 = mode, echo */ curwp->w_ntrows = nrow - 2; curwp->w_linep = lp; - curwp->w_flag |= WFMODE | WFHARD; + curwp->w_flag |= WFMODE | WFFULL; return (TRUE); } @@ -272,8 +272,8 @@ splitwind(int f, int n) curwp->w_linep = lp; wp->w_linep = lp; - curwp->w_flag |= WFMODE | WFHARD; - wp->w_flag |= WFMODE | WFHARD; + curwp->w_flag |= WFMODE | WFFULL; + wp->w_flag |= WFMODE | WFFULL; return (TRUE); } @@ -324,8 +324,8 @@ enlargewind(int f, int n) } curwp->w_ntrows += n; adjwp->w_ntrows -= n; - curwp->w_flag |= WFMODE | WFHARD; - adjwp->w_flag |= WFMODE | WFHARD; + curwp->w_flag |= WFMODE | WFFULL; + adjwp->w_flag |= WFMODE | WFFULL; return (TRUE); } @@ -377,8 +377,8 @@ shrinkwind(int f, int n) } curwp->w_ntrows -= n; adjwp->w_ntrows += n; - curwp->w_flag |= WFMODE | WFHARD; - adjwp->w_flag |= WFMODE | WFHARD; + curwp->w_flag |= WFMODE | WFFULL; + adjwp->w_flag |= WFMODE | WFFULL; return (TRUE); } diff --git a/usr.bin/mg/word.c b/usr.bin/mg/word.c index 41518fc4134..9489120f10a 100644 --- a/usr.bin/mg/word.c +++ b/usr.bin/mg/word.c @@ -1,4 +1,4 @@ -/* $OpenBSD: word.c,v 1.13 2005/11/18 20:56:53 deraadt Exp $ */ +/* $OpenBSD: word.c,v 1.14 2006/05/28 23:30:16 kjell Exp $ */ /* This file is in the public domain. */ @@ -91,7 +91,7 @@ upperword(int f, int n) if (ISLOWER(c) != FALSE) { c = TOUPPER(c); lputc(curwp->w_dotp, curwp->w_doto, c); - lchange(WFHARD); + lchange(WFFULL); } if (forwchar(FFRAND, 1) == FALSE) return (TRUE); @@ -130,7 +130,7 @@ lowerword(int f, int n) if (ISUPPER(c) != FALSE) { c = TOLOWER(c); lputc(curwp->w_dotp, curwp->w_doto, c); - lchange(WFHARD); + lchange(WFFULL); } if (forwchar(FFRAND, 1) == FALSE) return (TRUE); @@ -172,7 +172,7 @@ capword(int f, int n) if (ISLOWER(c) != FALSE) { c = TOUPPER(c); lputc(curwp->w_dotp, curwp->w_doto, c); - lchange(WFHARD); + lchange(WFFULL); } if (forwchar(FFRAND, 1) == FALSE) return (TRUE); @@ -181,7 +181,7 @@ capword(int f, int n) if (ISUPPER(c) != FALSE) { c = TOLOWER(c); lputc(curwp->w_dotp, curwp->w_doto, c); - lchange(WFHARD); + lchange(WFFULL); } if (forwchar(FFRAND, 1) == FALSE) return (TRUE); diff --git a/usr.bin/mg/yank.c b/usr.bin/mg/yank.c index 17962610ed8..aa6116bd4f2 100644 --- a/usr.bin/mg/yank.c +++ b/usr.bin/mg/yank.c @@ -1,4 +1,4 @@ -/* $OpenBSD: yank.c,v 1.2 2005/12/20 06:17:36 kjell Exp $ */ +/* $OpenBSD: yank.c,v 1.3 2006/05/28 23:30:16 kjell Exp $ */ /* This file is in the public domain. */ @@ -249,7 +249,7 @@ yank(int f, int n) lp = lback(lp); /* adjust framing */ curwp->w_linep = lp; - curwp->w_flag |= WFHARD; + curwp->w_flag |= WFFULL; } undo_no_boundary(FALSE); undo_add_boundary(); |