version 1.58, 2008/06/12 01:58:44 |
version 1.59, 2008/06/13 18:41:57 |
|
|
PF init_fcn = NULL; |
PF init_fcn = NULL; |
int o, i, nfiles; |
int o, i, nfiles; |
int nobackups = 0; |
int nobackups = 0; |
|
struct buffer *bp; |
|
|
while ((o = getopt(argc, argv, "nf:")) != -1) |
while ((o = getopt(argc, argv, "nf:")) != -1) |
switch (o) { |
switch (o) { |
|
|
(void)load(cp); |
(void)load(cp); |
#endif /* !NO_STARTUP */ |
#endif /* !NO_STARTUP */ |
|
|
|
/* |
|
* Create scratch buffer now, killing old *init* buffer. |
|
* This causes *scratch* to be created and made curbp, |
|
* ensuring default modes are inherited from the startup |
|
* file correctly |
|
*/ |
|
|
|
if ((bp = bfind("*init*", FALSE)) != NULL) |
|
killbuffer(bp); |
|
|
|
/* Force FFOTHARG=1 so that this mode is enabled, not simply toggled */ |
|
if (init_fcn) |
|
init_fcn(FFOTHARG, 1); |
|
|
if (nobackups) |
if (nobackups) |
makebkfile(FFARG, 0); |
makebkfile(FFARG, 0); |
|
|
|
|
if (readin(cp) != TRUE) |
if (readin(cp) != TRUE) |
killbuffer(curbp); |
killbuffer(curbp); |
else { |
else { |
|
/* Ensure enabled, not just toggled */ |
if (init_fcn_name) |
if (init_fcn_name) |
init_fcn(0, 1); |
init_fcn(FFOTHARG, 1); |
nfiles++; |
nfiles++; |
} |
} |
} |
} |
|
|
|
|
/* |
/* |
* Initialize default buffer and window. |
* Initialize default buffer and window. |
|
* Initially, buffer is named *init*. This is changed later |
|
* to *scratch* after the startup files are read. |
*/ |
*/ |
static void |
static void |
edinit(PF init_fcn) |
edinit(PF init_fcn) |
|
|
struct mgwin *wp; |
struct mgwin *wp; |
|
|
bheadp = NULL; |
bheadp = NULL; |
bp = bfind("*scratch*", TRUE); /* Text buffer. */ |
bp = bfind("*init*", TRUE); /* Text buffer. */ |
wp = new_window(bp); |
wp = new_window(bp); |
if (wp == NULL) |
if (wp == NULL) |
panic("Out of memory"); |
panic("Out of memory"); |
|
|
wp->w_linep = wp->w_dotp = bp->b_headp; |
wp->w_linep = wp->w_dotp = bp->b_headp; |
wp->w_ntrows = nrow - 2; /* 2 = mode, echo. */ |
wp->w_ntrows = nrow - 2; /* 2 = mode, echo. */ |
wp->w_flag = WFMODE | WFFULL; /* Full. */ |
wp->w_flag = WFMODE | WFFULL; /* Full. */ |
|
|
if (init_fcn) |
|
init_fcn(0, 1); |
|
} |
} |
|
|
/* |
/* |