Retest gflags and limit implementation details to eval.

This commit is contained in:
Renaud 2015-01-10 16:23:19 +08:00
parent f8c405f501
commit a634ae5087
3 changed files with 12 additions and 8 deletions

11
eval.c
View File

@ -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? */

7
eval.h
View File

@ -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) ;

2
main.c
View File

@ -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