On Mon, Nov 23, 2015 at 1:12 PM, Nikolay Pavlov <[email protected]> wrote:
> Consider the following script:
>
>     vim -u NONE -i /tmp/foo.viminfo -c 'help :command' -c 'setlocal
> buflisted' -c 'set viminfo='\''0,%' -c 'qa'
>
> This will result in the following contents in foo.viminfo:
>
>     # This viminfo file was generated by Vim 7.4.
>     # You may edit it if you're careful!
>
>     # Value of 'encoding' when this file was written
>     *encoding=latin1
>
>
>     # hlsearch on (H) or off (h):
>     ~H
>     # Last Search Pattern:
>     ~mSle0~/*:command*
>
>     # Registers:
>
>     # File marks:
>     '0  1173  23  ~/.local-vim/share/vim/vim74/doc/map.txt
>
>     # Jumplist (newest first):
>     -'  1173  23  ~/.local-vim/share/vim/vim74/doc/map.txt
>     -'  1  0  ~/.local-vim/share/vim/vim74/doc/map.txt
>
>     # Buffer list:
>     %~/.local-vim/share/vim/vim74/doc/map.txt 1173 23
>
>     # History of marks within files (newest to oldest):
>
>     > ~/.local-vim/share/vim/vim74/doc/map.txt
>     " 1173 23
>
> As you see there is map.txt in buffer list which is the help buffer (I did
> not change &buftype). But according to the documentation help buffers are
> not saved. I would suggest to fix the documentation:
>
> diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
> index 48793a9..9538ef9 100644
> --- a/runtime/doc/options.txt
> +++ b/runtime/doc/options.txt
> @@ -7991,9 +7991,9 @@ A jump table for the options with a short description
> can be found at |Q_op|.
>   % When included, save and restore the buffer list.  If Vim is
>   started with a file name argument, the buffer list is not
>   restored.  If Vim is started without a file name argument, the
> - buffer list is restored from the viminfo file.  Buffers
> - without a file name and buffers for help files are not written
> - to the viminfo file.
> + buffer list is restored from the viminfo file.  Quickfix
> + ('buftype'), unlisted ('buflisted'), unnamed and buffers on
> + removable media (|viminfo-r|) are not saved.
>   When followed by a number, the number specifies the maximum
>   number of buffers that are stored.  Without a number all
>   buffers are stored.

The proposed change is more precise, and remains correct even for
users who would have the weird notion of toggling 'buflisted' on for a
helpfile, but for non-technical-minded users, especially newbies, it
can be less clear. Helpfiles are something everyone encounters early
on and which are normally unlisted. Other normally unlisted buffers
are those opened by the netrw plugin for displaying directories, and I
certainly wouldn't advise you to set 'buflisted' on one of the latter;
I bet that Dr. Chip's whole netrw-related software relies on its
settings not being changed behind its back by malicious users.

Conversely, I'd bet that a newbie seeing a mention of "quickfix and
unlisted buffers" wouldn't understand what that means except (and
maybe not even) after following the hotlinks to read attentively the
documentation on 'buftype' and 'buflisted'. He probably wouldn't
understand from that documentation that (by default) help buffers and
netrw directory buffers are unlisted, since the help for 'buflisted'
doesn't mention them.

Best regards,
Tony.

-- 
-- 
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

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui