On 14/08/10 17:13, James Vega wrote:
On Sat, Aug 14, 2010 at 02:41:04PM +0200, Bram Moolenaar wrote:

I wrote:

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.

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

I can reproduce it.  Strange that nobody noticed until now.

I'll fix it ASAP.

It was most likely introduced by patch 7.2.132, sent out March 5 2009.

This patch should fix it, please verify it doesn't introduce any new
problems:

That fixes the error message, but not the issue with the other buffer
that I mentioned.

   $ printf "foo\n">  mary
   $ vim -u NONE -i NONE existingfile
   :r mary
   :ls!
     1 %a + "existingfile"                 line 2
     2u#    "mary"                         line 1

   $ vim -u NONE -i NONE -N
   :r mary
   :ls!
     1 %a + "[No Name]"                    line 2
     2u#    "mary"                         line 1

This only happens in 'nocompatible' mode or if there is an existing
buffer loaded.


I think it is intentional:

"If a filename is given with ":r", it becomes the alternate file." (insert.txt line 1846, sub |inserting-file|). You can't have an alternate file which doesn't appear in ":ls!". Note that the file is unlisted though (as shown by the "u" left of its name), an ordinary ":ls" won't show it.

The fact that there is a buffer name and number doesn't necessarily mean that that buffer is loaded into Vim, just that Vim "remembers something" about that file.


Best regards,
Tony.
--
What I tell you three times is true.

--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Raspunde prin e-mail lui