Bug#796872: vim: E676 saving a buftype=nofile buffer

Daniel Shahaf d.s at daniel.shahaf.name
Sat Dec 5 09:57:27 UTC 2015

James McCoy wrote on Fri, Dec 04, 2015 at 23:33:22 -0500:
> On Tue, Aug 25, 2015 at 08:57:27AM +0000, Daniel Shahaf wrote:
> >    * What was the outcome of this action?
> > 
> > "E676: No matching autocommands for acwrite buffer"
> > 
> >    * What outcome did you expect instead?
> > 
> > "E382: Cannot write, 'buftype' option is set"
> Hmm.  I think :saveas should be successful here, but the 'nofile'
> setting should be transfered to the alternate buffer that gets created.
> “:saveas foo” should really act like a short-cut for “:w foo” and “:e
> foo”.

I neglected to mention that ":w foobar" at that point gives E382; that's
why I named that particular error as "what I expected to see".  So, more
explicitly, what I "expected" was that :saveas would fail the same way
:w fails at that point.

That expectation is consistent with your "shortcut" viewpoint, but not
with your expectation that :saveas succeed at that point.

I note that ":saveas! foobar" fails as well.  Perhaps ":saveas" should
fail with E382 and ":saveas!" succeed?

More information about the pkg-vim-maintainers mailing list