On Fri, Aug 13, 2010 at 04:30:58PM -0700, Gary Johnson wrote:
> In a directory containing a simple text file named 'mary', execute
> the following:
> 
>     $ vim -u NONE -i NONE
>     :r mary
> 
> The result is the following two error messages:
> 
>     E812: Autocommands changed buffer or buffer name
>     E484: Can't open file mary
> 
> I don't know what autocommand that could be since I started Vim
> without plugins and :scriptnames shows nothing.

The check that's failing in fileio.c:readfile is

  729         if (!read_stdin && (curbuf != old_curbuf
  730                 || (using_b_ffname && (old_b_ffname != curbuf->b_ffname))
  731                 || (using_b_fname && (old_b_fname != curbuf->b_fname))))
  732         {
  733             EMSG(_(e_auchangedbuf));

Both using_b_ffname and using_b_fname are true since sfname and
curbuf->b_ffname/curbuf->b_fname are NULL at the start of the function.

  329     int     using_b_ffname = (fname == curbuf->b_ffname)
  330                                               || (sfname == 
curbuf->b_ffname);
  331     int     using_b_fname = (fname == curbuf->b_fname)
  332                                                || (sfname == 
curbuf->b_fname);

> This works without error if Vim is started in 'noncompatible' mode
> or when using Vim 6.3.

It works without error when using 'nocompatible', but you end up with
the following buffers:

    :ls!
      1 %a + "[No Name]"                    line 1
      2u#    "mary"                         line 1

Buffer 1 contains a blank line and then the contents of mary below it
(as expected after a :read command).  While buffer 2 (which shouldn't
exist at all) is as if you had run ":e mary".

-- 
James
GPG Key: 1024D/61326D40 2003-09-02 James Vega <[email protected]>

Attachment: signature.asc
Description: Digital signature

Raspunde prin e-mail lui