Ben Fritz wrote:

> On Wednesday, December 11, 2013 7:38:31 AM UTC-6, Bram Moolenaar wrote:
> > Christian Brabandt wrote:
> > 
> > > On Mo, 09 Dez 2013, Bram Moolenaar wrote:
> > > > 
> > > > Christian Brabandt wrote:
> > > > 
> > > > > Bram,
> > > > > I use an uppercase mark to access a blowfish encrypted file. I
> > > > > therefore :bwipe that buffer when I'm done with this file.
> > > > > Unfortunately, I can't use the uppercase mark again, to reload
> > > > > that file, Vim throws E92 error.
> > > > > 
> > > > > Attached patch fixes it and includes a test.
> > > > 
> > > > Seems useful.  However, why not only :bdelete the buffer?  What
> > > > remains behind that :bwipe does get rid of?
> > > 
> > > I didn't want to leave behind any way to see what buffers where loaded.
> > 
> > Ehm, but your patch keeps the mark, so you leave that behind.
> > That more or less indicates you were editing that file.
> > 
> > > > What if someone relies on :bwipe clearing the mark?  E.g., when it's a
> > > > temp file with a weird name that you don't want to accidentally jump
> > > > back to?
> > > 
> > > Is this really a problem, that someone wipes a buffer and relies on the 
> > > fact, that going back to that mark errors out? One should rather use 
> > > :delmark or use setpos() function in that case.
> > 
> > No, when one edits text in a temp file, you just :bwipe it to avoid
> > going back to that file in any way. 
> 
> I think I'll chime in here even though I don't actually use uppercase
> marks very often, nor even do I call :bwipe very often.
> 
> If I were to set an uppercase mark, I would actually be quite
> surprised if :bwipe got rid of it. In my mind, lowercase marks are
> associated with a buffer, but uppercase marks are associated with a
> *file*. From the help:
> 
>                                               *'* *'a* *`* *`a*
> '{a-z}  `{a-z}                Jump to the mark {a-z} in the current buffer.
> 
>                                               *'A* *'0* *`A* *`0*
> '{A-Z0-9}  `{A-Z0-9}  To the mark {A-Z0-9} in the file where it was set (not
>                       a motion command when in another file).  {not in Vi}
> 
> This seems to make a distinction between buffer and file, for example.
> 
> This is supported by the fact that you don't even need to have the
> file in the buffer list to use an upper case mark. Consider:
> 
> > vim file1.txt
> mA
> :qa
> > vim file2.txt
> 'A
> 
> Assuming default values for 'viminfo', this will bring up file1.txt in
> your Vim, even though Vim has no buffer for file1.txt.
> 
> I always viewed :bwipe on a buffer, then re-editing that file, as
> equivalent to exiting Vim and re-editing that file. In this case,
> without Christian's patch, that breaks.
> 
> Now, since lowercase marks are associated with the *buffer* and not
> the *file*, I would in fact expect :bwipe to zap those. But like
> Christian I view uppercase marks as a bookmark to a file, I don't view
> them as a buffer-jumping tool. So a buffer wiping command would
> confuse me by zapping my file bookmark.

OK, if we look at this way, that the user must have intentionally set the
upper case mark in the file, then keeping that mark when wiping out the
buffer makes sense.

-- 
The 50-50-90 rule: Anytime you have a 50-50 chance of getting
something right, there's a 90% probability you'll get it wrong.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
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/groups/opt_out.

Raspunde prin e-mail lui