diff --git a/eval.c b/eval.c index f09c139..6d52ea4 100644 --- a/eval.c +++ b/eval.c @@ -55,7 +55,16 @@ static int gettyp( char *token) ; char outline[ NSTRING] ; /* global string to hold debug line text */ #endif -int gflags = GFREAD ; /* global control flag */ +/* Emacs global flag bit definitions (for gflags). */ +/* if GFREAD is set, current buffer will be set on first file (read in) */ +#define GFREAD 1 + +static int gflags = GFREAD ; /* global control flag */ + +int readfirst_f( void) { + return GFREAD == (gflags & GFREAD) ; +} + int macbug = FALSE ; /* macro debuging flag */ int cmdstatus = TRUE ; /* last command status */ int flickcode = FALSE ; /* do flicker supression? */ diff --git a/eval.h b/eval.h index 710b333..38a0861 100644 --- a/eval.h +++ b/eval.h @@ -10,18 +10,13 @@ extern char outline[] ; /* Global string to hold debug line text. */ #endif - -/* Emacs global flag bit definitions (for gflags). */ - -#define GFREAD 1 - -extern int gflags ; /* global control flag */ extern int macbug ; /* macro debuging flag */ extern int cmdstatus ; /* last command status */ extern int flickcode ; /* do flicker supression? */ extern int rval ; /* return value of a subprocess */ extern long envram ; /* # of bytes current in use by malloc */ +int readfirst_f( void) ; int is_it_cmd( char *token) ; void varinit( void) ; diff --git a/main.c b/main.c index f576afd..0b9a1ec 100644 --- a/main.c +++ b/main.c @@ -318,7 +318,7 @@ int main(int argc, char **argv) /* if there are any files to read, read the first one! */ bp = bfind("main", FALSE, 0); - if (firstfile == FALSE && (gflags & GFREAD)) { + if (firstfile == FALSE && readfirst_f()) { swbuffer(firstbp); zotbuf(bp); } else