Re: E676 error in Vim7 when writing contents of a 'nofile' buffer to a file
----- Original Message -----
From: "Bram Moolenaar" <Bram@...>
To: "Stahlman Family" <brettstahlman@...>
Cc: "A. J. Mechelynck" <antoine.mechelynck@...>; <vim@...>
Sent: Thursday, March 31, 2005 2:12 AM
Subject: Re: E676 error in Vim7 when writing contents of a 'nofile' buffer
to a file
> Brett Stahlman wrote:
>> I believe the apparent bug/unexpected behavior, which I originally
>> reported, is due to the following code (a bit later in buf_write()):
>> (pseudo code only...)
>> else if (reset_changed && whole)
>> if(!(did_cmd = apply_autocommands_exarg(EVENT_BUFWRITECMD, ...)
>> nofile_err = TRUE;
>> The problem is that this logic requires BUFWRITECMD autocommands not
>> just for acwrite buffer but also for nofile buffer. Help does not
>> suggest that BUFWRITECMD autocommands need to be defined for 'nofile'
>> Help on 'buftype' states the following for both nofile and acwrite
>> The buffer is not to be written to disk, ":w" doesn't work (":w
>> filename" does work though).
>> It appears that even with the patch, the claim in parentheses is
> This looks like an older Vim 7. The code now looks like this:
Ah. My mistake. I am indeed using an older Vim 7. I'll download the latest.
> else if (reset_changed && whole)
> if (!(did_cmd = apply_autocmds_exarg(EVENT_BUFWRITECMD,
> sfname, sfname, FALSE, curbuf, eap)))
> if (overwriting && bt_nofile(curbuf))
> nofile_err = TRUE;
> The "overwriting" flag is set for ":w" but not for ":w filename".
> hundred-and-one symptoms of being an internet addict:
> 37. You start looking for hot HTML addresses in public restrooms.
> /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
> /// Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/
> \\\ Project leader for A-A-P -- http://www.A-A-P.org
> \\\ Buy LOTR 3 and help AIDS victims -- http://ICCF.nl/lotr.html ///