Article View: comp.sources.bugs
Article #791Minor problem with quick-exit in microEMACS 3.8i
From: Greg Franks
Date: Tue, 30 Jun 1987 13:13
Date: Tue, 30 Jun 1987 13:13
84 lines
3256 bytes
3256 bytes
Here is a context diff of a minor irratant in the quick-exit function in
microEMACS 3.8i. Normally, if quick-exit fails (mainly because a buffer
does not have an associated file), microEMACS will print out an error
message and remain in the original buffer (with some peculiar side
effects if I recall). This change will cause microEMACS to switch to
the buffer that caused the fault.
*** /ss/greg/tmp/main.c Tue Jun 30 09:04:29 1987
--- main.c Tue Jun 30 09:05:38 1987
***************
*** 1082,1087
{
register BUFFER *bp; /* scanning pointer to buffers */
register int status;
bp = bheadp;
while (bp != NULL) {
--- 1082,1088 -----
{
register BUFFER *bp; /* scanning pointer to buffers */
register int status;
+ register BUFFER *old; /* original buffer */ /*rgf*/
old = curbp; /*rgf*/
bp = bheadp;
***************
*** 1083,1088
register BUFFER *bp; /* scanning pointer to buffers */
register int status;
bp = bheadp;
while (bp != NULL) {
if ((bp->b_flag&BFCHG) != 0 /* Changed. */
--- 1084,1090 -----
register int status;
register BUFFER *old; /* original buffer */ /*rgf*/
+ old = curbp; /*rgf*/
bp = bheadp;
while (bp != NULL) {
if ((bp->b_flag&BFCHG) != 0 /* Changed. */
***************
*** 1089,1095
&& (bp->b_flag&BFINVS) == 0) { /* Real. */
curbp = bp; /* make that buffer cur */
mlwrite("[Saving %s]\n",bp->b_fname);
! if ((status = filesave(f, n)) != TRUE)
return(status);
}
bp = bp->b_bufp; /* on to the next buffer */
--- 1091,1099 -----
&& (bp->b_flag&BFINVS) == 0) { /* Real. */
curbp = bp; /* make that buffer cur */
mlwrite("[Saving %s]\n",bp->b_fname);
! if ((status = filesave(f, n)) != TRUE) {
! curbp = old; /* Switch to bogus */ /*rgf*/
! swbuffer( bp ); /* buffer. */ /*rgf*/
return(status);
}
}
***************
*** 1091,1096
mlwrite("[Saving %s]\n",bp->b_fname);
if ((status = filesave(f, n)) != TRUE)
return(status);
}
bp = bp->b_bufp; /* on to the next buffer */
}
--- 1095,1101 -----
curbp = old; /* Switch to bogus */ /*rgf*/
swbuffer( bp ); /* buffer. */ /*rgf*/
return(status);
+ }
}
bp = bp->b_bufp; /* on to the next buffer */
}
--
Greg Franks (613) 725-5411 "Vermont ain't flat"
{net-land}!utzoo!dciem!nrcaer!xios!greg
(Other paths will undoubtably work too - your mileage will vary)
Technical Details
Message-ID:
<325@xios.XIOS.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!dciem!nrcaer!xios!gregShow Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: arc1-ca.pugleaf.net!utzoo!dciem!nrcaer!xios!greg From: greg@xios.XIOS.UUCP (Greg Franks) Newsgroups: comp.sources.bugs Subject: Minor problem with quick-exit in microEMACS 3.8i Message-ID: <325@xios.XIOS.UUCP> Date: Tue, 30-Jun-87 09:13:32 EDT Article-I.D.: xios.325 Posted: Tue Jun 30 09:13:32 1987 Date-Received: Sat, 4-Jul-87 08:31:31 EDT Reply-To: greg@xios.UUCP (Greg Franks) Distribution: world Organization: XIOS Systems Corporation, Ottawa, Ontario, Canada Lines: 84