mirror of
https://github.com/rfivet/uemacs.git
synced 2024-09-24 06:35:54 -04:00
Transition from logger/logwrite/mlwrite to writestr/writefmt.
This commit is contained in:
parent
891f4c3238
commit
15ae2d4135
15
basic.c
15
basic.c
@ -100,8 +100,10 @@ int gotoline(int f, int n)
|
|||||||
/* Get an argument if one doesnt exist. */
|
/* Get an argument if one doesnt exist. */
|
||||||
if( f == FALSE) {
|
if( f == FALSE) {
|
||||||
status = mlreply( "Line to GOTO: ", arg, sizeof arg) ;
|
status = mlreply( "Line to GOTO: ", arg, sizeof arg) ;
|
||||||
if( status != TRUE)
|
if( status != TRUE) {
|
||||||
return logger( status, "(Aborted)") ;
|
writestr( "(Aborted)") ;
|
||||||
|
return status ;
|
||||||
|
}
|
||||||
|
|
||||||
n = atoi( arg) ;
|
n = atoi( arg) ;
|
||||||
}
|
}
|
||||||
@ -313,7 +315,8 @@ int setmark(int f, int n)
|
|||||||
{
|
{
|
||||||
curwp->w_markp = curwp->w_dotp;
|
curwp->w_markp = curwp->w_dotp;
|
||||||
curwp->w_marko = curwp->w_doto;
|
curwp->w_marko = curwp->w_doto;
|
||||||
return logger( TRUE, "(Mark set)") ;
|
writestr( "(Mark set)") ;
|
||||||
|
return TRUE ;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -327,8 +330,10 @@ int swapmark(int f, int n)
|
|||||||
struct line *odotp;
|
struct line *odotp;
|
||||||
int odoto;
|
int odoto;
|
||||||
|
|
||||||
if( curwp->w_markp == NULL)
|
if( curwp->w_markp == NULL) {
|
||||||
return logger( FALSE, "No mark in this window") ;
|
writestr( "No mark in this window") ;
|
||||||
|
return FALSE ;
|
||||||
|
}
|
||||||
|
|
||||||
odotp = curwp->w_dotp;
|
odotp = curwp->w_dotp;
|
||||||
odoto = curwp->w_doto;
|
odoto = curwp->w_doto;
|
||||||
|
@ -150,7 +150,8 @@ int ctlxe(int f, int n)
|
|||||||
*/
|
*/
|
||||||
int ctrlg( int f, int n) {
|
int ctrlg( int f, int n) {
|
||||||
kbdmode = STOP ;
|
kbdmode = STOP ;
|
||||||
return logger( ABORT, "%B(Aborted)") ;
|
writefmt( "%B(Aborted)") ;
|
||||||
|
return ABORT ;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* user function that does NOTHING */
|
/* user function that does NOTHING */
|
||||||
|
@ -102,6 +102,7 @@ int execute(int c, int f, int n)
|
|||||||
}
|
}
|
||||||
|
|
||||||
lastflag = 0 ; /* Fake last flags. */
|
lastflag = 0 ; /* Fake last flags. */
|
||||||
return logger( FALSE, "%B(Key not bound)") ; /* Complain */
|
writefmt( "%B(Key not bound)") ; /* Complain */
|
||||||
|
return FALSE ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
36
file.c
36
file.c
@ -169,7 +169,7 @@ int set_encryption_key(int f, int n)
|
|||||||
strcpy(curbp->b_key, key);
|
strcpy(curbp->b_key, key);
|
||||||
cryptbufferkey( curbp) ;
|
cryptbufferkey( curbp) ;
|
||||||
|
|
||||||
logwrite(" "); /* clear it off the bottom line */
|
writestr( " ") ; /* clear it off the bottom line */
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -231,7 +231,7 @@ int getfile( const char *fname, boolean lockfl)
|
|||||||
curwp->w_linep = lp;
|
curwp->w_linep = lp;
|
||||||
curwp->w_flag |= WFMODE | WFHARD;
|
curwp->w_flag |= WFMODE | WFHARD;
|
||||||
cknewwindow();
|
cknewwindow();
|
||||||
logwrite("(Old buffer)");
|
writestr( "(Old buffer)") ;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -247,7 +247,7 @@ int getfile( const char *fname, boolean lockfl)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (bp == NULL && (bp = bfind(bname, TRUE, 0)) == NULL) {
|
if (bp == NULL && (bp = bfind(bname, TRUE, 0)) == NULL) {
|
||||||
logwrite("Cannot create buffer");
|
writestr( "Cannot create buffer") ;
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
if (--curbp->b_nwnd == 0) { /* Undisplay. */
|
if (--curbp->b_nwnd == 0) { /* Undisplay. */
|
||||||
@ -318,12 +318,12 @@ int readin(const char *fname, boolean lockfl)
|
|||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
if (s == FIOFNF) { /* File not found. */
|
if (s == FIOFNF) { /* File not found. */
|
||||||
logwrite("(New file)");
|
writestr( "(New file)") ;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* read the file in */
|
/* read the file in */
|
||||||
logwrite("(Reading file)");
|
writestr( "(Reading file)") ;
|
||||||
nline = 0;
|
nline = 0;
|
||||||
while ((s = ffgetline()) == FIOSUC) {
|
while ((s = ffgetline()) == FIOSUC) {
|
||||||
nbytes = fpayload ;
|
nbytes = fpayload ;
|
||||||
@ -347,7 +347,7 @@ int readin(const char *fname, boolean lockfl)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if( s == FIOERR)
|
if( s == FIOERR)
|
||||||
logwrite( "File read error") ;
|
writestr( "File read error") ;
|
||||||
|
|
||||||
switch( ftype) {
|
switch( ftype) {
|
||||||
case FTYPE_DOS:
|
case FTYPE_DOS:
|
||||||
@ -386,7 +386,7 @@ int readin(const char *fname, boolean lockfl)
|
|||||||
strcat( mesg, ", eol = ") ;
|
strcat( mesg, ", eol = ") ;
|
||||||
strcat( mesg, eolname[ found_eol]) ;
|
strcat( mesg, eolname[ found_eol]) ;
|
||||||
strcat(mesg, ")");
|
strcat(mesg, ")");
|
||||||
logwrite(mesg);
|
writestr( mesg) ;
|
||||||
|
|
||||||
out:
|
out:
|
||||||
for (wp = wheadp; wp != NULL; wp = wp->w_wndp) {
|
for (wp = wheadp; wp != NULL; wp = wp->w_wndp) {
|
||||||
@ -518,14 +518,14 @@ int filesave(int f, int n)
|
|||||||
if ((curbp->b_flag & BFCHG) == 0) /* Return, no changes. */
|
if ((curbp->b_flag & BFCHG) == 0) /* Return, no changes. */
|
||||||
return TRUE;
|
return TRUE;
|
||||||
if (curbp->b_fname[0] == 0) { /* Must have a name. */
|
if (curbp->b_fname[0] == 0) { /* Must have a name. */
|
||||||
logwrite("No file name");
|
writestr( "No file name") ;
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* complain about truncated files */
|
/* complain about truncated files */
|
||||||
if ((curbp->b_flag & BFTRUNC) != 0) {
|
if ((curbp->b_flag & BFTRUNC) != 0) {
|
||||||
if (mlyesno("Truncated file ... write it out") == FALSE) {
|
if (mlyesno("Truncated file ... write it out") == FALSE) {
|
||||||
logwrite("(Aborted)");
|
writestr( "(Aborted)") ;
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -563,16 +563,16 @@ int writeout( const char *fn)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
if ((s = ffwopen(fn)) != FIOSUC) { /* Open writes message. */
|
if ((s = ffwopen(fn)) != FIOSUC) { /* Open writes message. */
|
||||||
logwrite( "Cannot open file for writing") ;
|
writestr( "Cannot open file for writing") ;
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
logwrite("(Writing...)"); /* tell us were writing */
|
writestr( "(Writing...)") ; /* tell us were writing */
|
||||||
lp = lforw(curbp->b_linep); /* First line. */
|
lp = lforw(curbp->b_linep); /* First line. */
|
||||||
nline = 0; /* Number of lines. */
|
nline = 0; /* Number of lines. */
|
||||||
while (lp != curbp->b_linep) {
|
while (lp != curbp->b_linep) {
|
||||||
s = ffputline( &lp->l_text[0], llength(lp), curbp->b_mode & MDDOS) ;
|
s = ffputline( &lp->l_text[0], llength(lp), curbp->b_mode & MDDOS) ;
|
||||||
if( s != FIOSUC) {
|
if( s != FIOSUC) {
|
||||||
logwrite( "Write I/O error") ;
|
writestr( "Write I/O error") ;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -583,11 +583,11 @@ int writeout( const char *fn)
|
|||||||
s = ffclose();
|
s = ffclose();
|
||||||
if (s == FIOSUC) { /* No close error. */
|
if (s == FIOSUC) { /* No close error. */
|
||||||
if (nline == 1)
|
if (nline == 1)
|
||||||
logwrite("(Wrote 1 line)");
|
writestr( "(Wrote 1 line)") ;
|
||||||
else
|
else
|
||||||
logwrite("(Wrote %d lines)", nline);
|
writefmt( "(Wrote %d lines)", nline) ;
|
||||||
} else
|
} else
|
||||||
logwrite( "Error closing file") ;
|
writestr( "Error closing file") ;
|
||||||
} else /* Ignore close error */
|
} else /* Ignore close error */
|
||||||
ffclose(); /* if a write error. */
|
ffclose(); /* if a write error. */
|
||||||
if (s != FIOSUC) /* Some sort of error. */
|
if (s != FIOSUC) /* Some sort of error. */
|
||||||
@ -650,10 +650,10 @@ int ifile( const char *fname)
|
|||||||
if ((s = ffropen(fname)) == FIOERR) /* Hard file open. */
|
if ((s = ffropen(fname)) == FIOERR) /* Hard file open. */
|
||||||
goto out;
|
goto out;
|
||||||
if (s == FIOFNF) { /* File not found. */
|
if (s == FIOFNF) { /* File not found. */
|
||||||
logwrite("(No such file)");
|
writestr( "(No such file)") ;
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
logwrite("(Inserting file)");
|
writestr( "(Inserting file)") ;
|
||||||
|
|
||||||
#if CRYPT
|
#if CRYPT
|
||||||
s = resetkey();
|
s = resetkey();
|
||||||
@ -702,7 +702,7 @@ int ifile( const char *fname)
|
|||||||
if (nline > 1)
|
if (nline > 1)
|
||||||
strcat(mesg, "s");
|
strcat(mesg, "s");
|
||||||
strcat(mesg, ")");
|
strcat(mesg, ")");
|
||||||
logwrite(mesg);
|
writestr( mesg);
|
||||||
|
|
||||||
out:
|
out:
|
||||||
/* advance to the next line and mark the window for changes */
|
/* advance to the next line and mark the window for changes */
|
||||||
|
16
line.c
16
line.c
@ -164,7 +164,7 @@ struct line *lalloc(int used)
|
|||||||
if (size == 0) /* Assume that is an empty. */
|
if (size == 0) /* Assume that is an empty. */
|
||||||
size = BLOCK_SIZE; /* Line is for type-in. */
|
size = BLOCK_SIZE; /* Line is for type-in. */
|
||||||
if ((lp = (struct line *)malloc(sizeof(struct line) + size)) == NULL) {
|
if ((lp = (struct line *)malloc(sizeof(struct line) + size)) == NULL) {
|
||||||
logwrite( "(OUT OF MEMORY)") ;
|
writestr( "(OUT OF MEMORY)") ;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
lp->l_size = size;
|
lp->l_size = size;
|
||||||
@ -268,8 +268,10 @@ int linstr( char *instr) {
|
|||||||
(tmpc == '\n' ? lnewline() : linsert( 1, tmpc)) ;
|
(tmpc == '\n' ? lnewline() : linsert( 1, tmpc)) ;
|
||||||
|
|
||||||
/* Insertion error? */
|
/* Insertion error? */
|
||||||
if( status != TRUE)
|
if( status != TRUE) {
|
||||||
return logger( status, "%%Out of memory while inserting") ;
|
writestr( "%Out of memory while inserting") ;
|
||||||
|
return status ;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -306,7 +308,7 @@ static int linsert_byte(int n, int c)
|
|||||||
lp1 = curwp->w_dotp; /* Current line */
|
lp1 = curwp->w_dotp; /* Current line */
|
||||||
if (lp1 == curbp->b_linep) { /* At the end: special */
|
if (lp1 == curbp->b_linep) { /* At the end: special */
|
||||||
if (curwp->w_doto != 0) {
|
if (curwp->w_doto != 0) {
|
||||||
logwrite( "bug: linsert") ;
|
writestr( "bug: linsert") ;
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
if ((lp2 = lalloc(n)) == NULL) /* Allocate new line */
|
if ((lp2 = lalloc(n)) == NULL) /* Allocate new line */
|
||||||
@ -418,8 +420,10 @@ int lover( char *ostr) {
|
|||||||
(tmpc == '\n' ? lnewline() : lowrite(tmpc));
|
(tmpc == '\n' ? lnewline() : lowrite(tmpc));
|
||||||
|
|
||||||
/* Insertion error? */
|
/* Insertion error? */
|
||||||
if( status != TRUE)
|
if( status != TRUE) {
|
||||||
return logger( status, "%%Out of memory while overwriting") ;
|
writestr( "%Out of memory while overwriting") ;
|
||||||
|
return status ;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
15
log.c
15
log.c
@ -3,25 +3,24 @@
|
|||||||
static void logdump( const char *buf, ...) {
|
static void logdump( const char *buf, ...) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void (*logwrite)( const char *, ...) = logdump ;
|
void (*writefmt)( const char *, ...) = logdump ;
|
||||||
|
|
||||||
static boolean logit( boolean retcode, const char *buf, ...) {
|
void writestr( const char *str) {
|
||||||
return retcode ;
|
writefmt( "%s", str) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean (*logger)( boolean, const char *, ...) = logit ;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* tell the user that this command is illegal while we are in
|
* tell the user that this command is illegal while we are in
|
||||||
* VIEW (read-only) mode
|
* VIEW (read-only) mode
|
||||||
*/
|
*/
|
||||||
boolean rdonly( void) {
|
boolean rdonly( void) {
|
||||||
return logger( FALSE, "%B(Key illegal in VIEW mode)");
|
writefmt( "%B(Key illegal in VIEW mode)") ;
|
||||||
|
return FALSE ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
boolean resterr( void) {
|
boolean resterr( void) {
|
||||||
return logger( FALSE, "%B(That command is RESTRICTED)");
|
writefmt( "%B(That command is RESTRICTED)") ;
|
||||||
|
return FALSE ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
8
log.h
8
log.h
@ -1,8 +1,8 @@
|
|||||||
#include "retcode.h"
|
#include "retcode.h"
|
||||||
|
|
||||||
|
extern void (*writefmt)( const char *, ...) ;
|
||||||
|
|
||||||
|
void writestr( const char *str) ;
|
||||||
|
|
||||||
boolean rdonly( void) ;
|
boolean rdonly( void) ;
|
||||||
boolean resterr( void) ;
|
boolean resterr( void) ;
|
||||||
|
|
||||||
extern void (*logwrite)( const char *, ...) ;
|
|
||||||
extern boolean (*logger)( boolean, const char *, ...) ;
|
|
||||||
|
|
||||||
|
21
main.c
21
main.c
@ -130,11 +130,6 @@ static void usage( void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static boolean mllog( boolean retcode, const char *buf, ...) {
|
|
||||||
mlwrite( buf) ;
|
|
||||||
return retcode ;
|
|
||||||
}
|
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
int c = -1; /* command character */
|
int c = -1; /* command character */
|
||||||
@ -187,8 +182,7 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
/* Initialize the editor. */
|
/* Initialize the editor. */
|
||||||
vtinit(); /* Display */
|
vtinit(); /* Display */
|
||||||
logwrite = mlwrite ;
|
writefmt = mlwrite ;
|
||||||
logger = mllog ;
|
|
||||||
edinit("main"); /* Buffers, windows */
|
edinit("main"); /* Buffers, windows */
|
||||||
varinit(); /* user variables */
|
varinit(); /* user variables */
|
||||||
|
|
||||||
@ -324,11 +318,11 @@ int main(int argc, char **argv)
|
|||||||
/* Deal with startup gotos and searches */
|
/* Deal with startup gotos and searches */
|
||||||
if (gotoflag && searchflag) {
|
if (gotoflag && searchflag) {
|
||||||
update(FALSE);
|
update(FALSE);
|
||||||
mlwrite("(Can not search and goto at the same time!)");
|
writestr( "(Can not search and goto at the same time!)") ;
|
||||||
} else if (gotoflag) {
|
} else if (gotoflag) {
|
||||||
if (gotoline(TRUE, gline) == FALSE) {
|
if (gotoline(TRUE, gline) == FALSE) {
|
||||||
update(FALSE);
|
update(FALSE);
|
||||||
mlwrite("(Bogus goto argument)");
|
writestr( "(Bogus goto argument)") ;
|
||||||
}
|
}
|
||||||
} else if (searchflag) {
|
} else if (searchflag) {
|
||||||
if (forwhunt(FALSE, 0) == FALSE)
|
if (forwhunt(FALSE, 0) == FALSE)
|
||||||
@ -400,9 +394,9 @@ int main(int argc, char **argv)
|
|||||||
n = n * 10 + (c - '0');
|
n = n * 10 + (c - '0');
|
||||||
}
|
}
|
||||||
if ((n == 0) && (mflag == -1)) /* lonely - */
|
if ((n == 0) && (mflag == -1)) /* lonely - */
|
||||||
mlwrite("Arg:");
|
writestr( "Arg:") ;
|
||||||
else
|
else
|
||||||
mlwrite("Arg: %d", n * mflag);
|
writefmt( "Arg: %d", n * mflag) ;
|
||||||
|
|
||||||
c = getcmd(); /* get the next key */
|
c = getcmd(); /* get the next key */
|
||||||
}
|
}
|
||||||
@ -415,7 +409,7 @@ int main(int argc, char **argv)
|
|||||||
f = TRUE;
|
f = TRUE;
|
||||||
n = 4; /* with argument of 4 */
|
n = 4; /* with argument of 4 */
|
||||||
mflag = 0; /* that can be discarded. */
|
mflag = 0; /* that can be discarded. */
|
||||||
mlwrite("Arg: 4");
|
writestr( "Arg: 4") ;
|
||||||
while (((c = getcmd()) >= '0' && c <= '9') || c == reptc
|
while (((c = getcmd()) >= '0' && c <= '9') || c == reptc
|
||||||
|| c == '-') {
|
|| c == '-') {
|
||||||
if (c == reptc)
|
if (c == reptc)
|
||||||
@ -444,8 +438,7 @@ int main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
n = 10 * n + c - '0';
|
n = 10 * n + c - '0';
|
||||||
}
|
}
|
||||||
mlwrite("Arg: %d",
|
writefmt( "Arg: %d", (mflag >= 0) ? n : (n ? -n : -1)) ;
|
||||||
(mflag >= 0) ? n : (n ? -n : -1));
|
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* Make arguments preceded by a minus sign negative and change
|
* Make arguments preceded by a minus sign negative and change
|
||||||
|
6
region.c
6
region.c
@ -74,7 +74,7 @@ int copyregion(int f, int n)
|
|||||||
++loffs;
|
++loffs;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
logwrite("(region copied)");
|
writestr( "(region copied)") ;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -171,7 +171,7 @@ int getregion(struct region *rp)
|
|||||||
long bsize;
|
long bsize;
|
||||||
|
|
||||||
if (curwp->w_markp == NULL) {
|
if (curwp->w_markp == NULL) {
|
||||||
logwrite("No mark set in this window");
|
writestr( "No mark set in this window") ;
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
if (curwp->w_dotp == curwp->w_markp) {
|
if (curwp->w_dotp == curwp->w_markp) {
|
||||||
@ -213,6 +213,6 @@ int getregion(struct region *rp)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
logwrite("Bug: lost mark");
|
writestr( "Bug: lost mark") ;
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
3
search.c
3
search.c
@ -984,7 +984,8 @@ static int replaces(int kind, int f, int n)
|
|||||||
curwp->w_flag |= WFMOVE;
|
curwp->w_flag |= WFMOVE;
|
||||||
|
|
||||||
case BELL: /* abort! and stay */
|
case BELL: /* abort! and stay */
|
||||||
return logger( FALSE, "Aborted!") ;
|
writestr( "Aborted!") ;
|
||||||
|
return FALSE ;
|
||||||
|
|
||||||
default: /* bitch and beep */
|
default: /* bitch and beep */
|
||||||
TTbeep();
|
TTbeep();
|
||||||
|
10
word.c
10
word.c
@ -428,7 +428,7 @@ int fillpara(int f, int n)
|
|||||||
if (curbp->b_mode & MDVIEW) /* don't allow this command if */
|
if (curbp->b_mode & MDVIEW) /* don't allow this command if */
|
||||||
return rdonly(); /* we are in read only mode */
|
return rdonly(); /* we are in read only mode */
|
||||||
if (fillcol == 0) { /* no fill column set */
|
if (fillcol == 0) { /* no fill column set */
|
||||||
logwrite("No fill column set");
|
writestr( "No fill column set") ;
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
#if PKCODE
|
#if PKCODE
|
||||||
@ -527,14 +527,14 @@ int justpara(int f, int n)
|
|||||||
if (curbp->b_mode & MDVIEW) /* don't allow this command if */
|
if (curbp->b_mode & MDVIEW) /* don't allow this command if */
|
||||||
return rdonly(); /* we are in read only mode */
|
return rdonly(); /* we are in read only mode */
|
||||||
if (fillcol == 0) { /* no fill column set */
|
if (fillcol == 0) { /* no fill column set */
|
||||||
logwrite("No fill column set");
|
writestr( "No fill column set") ;
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
justflag = TRUE;
|
justflag = TRUE;
|
||||||
leftmarg = curwp->w_doto;
|
leftmarg = curwp->w_doto;
|
||||||
if (leftmarg + 10 > fillcol) {
|
if (leftmarg + 10 > fillcol) {
|
||||||
leftmarg = 0;
|
leftmarg = 0;
|
||||||
logwrite("Column too narrow");
|
writestr( "Column too narrow") ;
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -719,8 +719,8 @@ int wordcount(int f, int n)
|
|||||||
else
|
else
|
||||||
avgch = 0;
|
avgch = 0;
|
||||||
|
|
||||||
logwrite("Words %D Chars %D Lines %d Avg chars/word %f",
|
writefmt( "Words %D Chars %D Lines %d Avg chars/word %f",
|
||||||
nwords, nchars, nlines + 1, avgch);
|
nwords, nchars, nlines + 1, avgch) ;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user