Loading ...
Sorry, an error occurred while loading the content.

[patch] uppercase marks don't work after bwiping a buffer

Expand Messages
  • Christian Brabandt
    Bram, I use an uppercase mark to access a blowfish encrypted file. I therefore ... use the uppercase mark again, to reload that file, Vim throws E92 error.
    Message 1 of 22 , Dec 8, 2013
    • 0 Attachment
      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.

      Best,
      Christian

      --
      --
      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 vim_dev+unsubscribe@....
      For more options, visit https://groups.google.com/groups/opt_out.
    • Tony Mechelynck
      ... This is intentional (or at least documented), see :help E92: *E92* Buffer {N} not found The buffer you requested does not exist. This can also happen
      Message 2 of 22 , Dec 8, 2013
      • 0 Attachment
        On 08/12/13 20:20, 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.

        This is intentional (or at least documented), see :help E92:

        *E92* >
        Buffer {N} not found

        The buffer you requested does not exist. This can also happen when you have
        wiped out a buffer which contains a mark or is referenced in another way.
        |:bwipeout|


        >
        > Attached patch fixes it and includes a test.
        >
        > Best,
        > Christian
        >

        Best regards,
        Tony.
        --
        "No rational order of divine intelligence unites species. The natural
        ties are genealogical along contingent pathways of history."
        [Stephen Jay Gould, "Dinosaur in a Haystack"]

        --
        --
        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 vim_dev+unsubscribe@....
        For more options, visit https://groups.google.com/groups/opt_out.
      • Christian Brabandt
        Hi Tony! ... It is documented, but I doubt it is intentional. ... Right. That s why I wrote a patch, so that it *doesn t* happen anymore. Best, Christian --
        Message 3 of 22 , Dec 8, 2013
        • 0 Attachment
          Hi Tony!

          On So, 08 Dez 2013, Tony Mechelynck wrote:

          > On 08/12/13 20:20, 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.
          >
          > This is intentional (or at least documented), see :help E92:

          It is documented, but I doubt it is intentional.

          > *E92* >
          > Buffer {N} not found
          >
          > The buffer you requested does not exist. This can also happen when you have
          > wiped out a buffer which contains a mark or is referenced in another way.
          > |:bwipeout|

          Right. That's why I wrote a patch, so that it *doesn't* happen anymore.

          Best,
          Christian
          --
          Warum ich für NeXT und nicht für Windows programmiere?
          Ich könnte ja auch Banken überfallen und in Schulen Drogen
          verkaufen, aber man muß sich ein gewisses Maß an Würde bewahren.
          -- Unbekannte .signature

          --
          --
          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 vim_dev+unsubscribe@....
          For more options, visit https://groups.google.com/groups/opt_out.
        • Bram Moolenaar
          ... Seems useful. However, why not only :bdelete the buffer? What remains behind that :bwipe does get rid of? What if someone relies on :bwipe clearing the
          Message 4 of 22 , Dec 9, 2013
          • 0 Attachment
            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?

            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?


            --
            hundred-and-one symptoms of being an internet addict:
            34. You laugh at people with a 10 Mbit connection.

            /// Bram Moolenaar -- Bram@... -- 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 vim_dev+unsubscribe@....
            For more options, visit https://groups.google.com/groups/opt_out.
          • Christian Brabandt
            Hi Bram! ... I didn t want to leave behind any way to see what buffers where loaded. ... Is this really a problem, that someone wipes a buffer and relies on
            Message 5 of 22 , Dec 9, 2013
            • 0 Attachment
              Hi Bram!

              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.

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

              Best,
              Christian

              --
              --
              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 vim_dev+unsubscribe@....
              For more options, visit https://groups.google.com/groups/opt_out.
            • Manuel Ortega
              ... I m confused. If you preserve the uppercase mark, there *will* be a way to see that it was loaded. It will be in the viminfo file, and visible by doing
              Message 6 of 22 , Dec 10, 2013
              • 0 Attachment
                > On Mo, 09 Dez 2013, Bram Moolenaar wrote:
                > > Christian Brabandt wrote:
                > > > 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.

                I'm confused. If you preserve the uppercase mark, there *will* be a way
                to see that it was loaded.  It will be in the viminfo file, and visible
                by doing :marks.

                For that matter, why not access that file by means other than an
                uppercase mark?  Why not have a mapping or a user-command that opens it?

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

                Surely there should be a way to get rid of *everything* associated with
                a buffer, including uppercase marks.  If :bwipe is not going to be that
                way, than something should take its place.

                -Manny

                --
                --
                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 vim_dev+unsubscribe@....
                For more options, visit https://groups.google.com/groups/opt_out.
              • Christian Brabandt
                ... Indeed. Let s say it differently then. I like to use uppercase as an easy way to access files, regardless of whether those files have been wiped before.
                Message 7 of 22 , Dec 10, 2013
                • 0 Attachment
                  On Wed, December 11, 2013 07:08, Manuel Ortega wrote:
                  >> On Mo, 09 Dez 2013, Bram Moolenaar wrote:
                  >> > Christian Brabandt wrote:
                  >> > > 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.
                  >
                  > I'm confused. If you preserve the uppercase mark, there *will* be a way
                  > to see that it was loaded. It will be in the viminfo file, and visible
                  > by doing :marks.

                  Indeed. Let's say it differently then. I like to use uppercase as an
                  easy way to access files, regardless of whether those files have been
                  wiped before. It's just like bookmarks. It doesn't make sense to have
                  them not available, just because I closed the book before (and one
                  actually loses them). At the same time, I don't want :ls! to be able
                  to show, that a buffer was loaded before, that's why I used :bw

                  > For that matter, why not access that file by means other than an
                  > uppercase mark? Why not have a mapping or a user-command that opens it?

                  As I said, I feel like marks are a perfect way to access files.

                  > Surely there should be a way to get rid of *everything* associated with
                  > a buffer, including uppercase marks. If :bwipe is not going to be that
                  > way, than something should take its place.

                  I see it differently. Wiping closes the buffer completely. But marks
                  are not associated with a buffer, so they should certainly survive. If
                  one doesn't want that, then one can delmark them or even not save the
                  .viminfo file. But I for one would like to have those marks survive
                  several sessions.

                  Best,
                  Christian

                  --
                  --
                  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 vim_dev+unsubscribe@....
                  For more options, visit https://groups.google.com/groups/opt_out.
                • Bram Moolenaar
                  ... Ehm, but your patch keeps the mark, so you leave that behind. That more or less indicates you were editing that file. ... No, when one edits text in a temp
                  Message 8 of 22 , Dec 11, 2013
                  • 0 Attachment
                    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. That works because the file name
                    was only stored in the buffer and it's gone. You don't have to think
                    about where else the name would be stored or what marks point into that
                    file.

                    So, instead of your patch, you could create a command ":WipeBufKeepMark"
                    that uses setpos(). Except that setpos() requires a buffer number...
                    Hmm. Perhaps we should add a way to have setpos() accept a file name?
                    Then you can solve it in Vimscript.

                    --
                    Seen it all, done it all, can't remember most of it.

                    /// Bram Moolenaar -- Bram@... -- 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 vim_dev+unsubscribe@....
                    For more options, visit https://groups.google.com/groups/opt_out.
                  • Ben Fritz
                    ... 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
                    Message 9 of 22 , Dec 11, 2013
                    • 0 Attachment
                      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.

                      --
                      --
                      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 vim_dev+unsubscribe@....
                      For more options, visit https://groups.google.com/groups/opt_out.
                    • Tony Mechelynck
                      ... Save the filename in a VARIABLE_IN_CAPITALS and remember it in the viminfo (with the ! flag set in the viminfo , but not at the end if the r flag is also
                      Message 10 of 22 , Dec 11, 2013
                      • 0 Attachment
                        On 11/12/13 14:38, 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. That works because the file name
                        > was only stored in the buffer and it's gone. You don't have to think
                        > about where else the name would be stored or what marks point into that
                        > file.
                        >
                        > So, instead of your patch, you could create a command ":WipeBufKeepMark"
                        > that uses setpos(). Except that setpos() requires a buffer number...
                        > Hmm. Perhaps we should add a way to have setpos() accept a file name?
                        > Then you can solve it in Vimscript.
                        >

                        Save the filename in a VARIABLE_IN_CAPITALS and remember it in the
                        viminfo (with the ! flag set in the 'viminfo', but not at the end if the
                        r flag is also set). The line number (if it may be other than the latest
                        linenumber for that file) can be remembered the same way in another,
                        related, variable. Instead of setpos() you would then use something like

                        if exists('FILENAME_A') && FILENAME_A != ""
                        \ && filereadable('FILENAME_A')
                        if !exists ('LINENUMBER_A')
                        let LINENUMBER_A = 0
                        endif
                        exe 'e +' . LINENUMBER_A FILENAME_A
                        endif

                        which can, of course, be assigned to a function.

                        Best regards,
                        Tony.
                        --
                        If at first you don't succeed, you must be a programmer.

                        --
                        --
                        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 vim_dev+unsubscribe@....
                        For more options, visit https://groups.google.com/groups/opt_out.
                      • Christian Brabandt
                        ... But you wouldn t waste a precious uppercase mark for a simple temp scratch buffer, which you were unlikely to reuse again anyhow. ... C mon, you are not
                        Message 11 of 22 , Dec 11, 2013
                        • 0 Attachment
                          On Wed, December 11, 2013 14:38, Bram Moolenaar wrote:
                          > No, when one edits text in a temp file, you just :bwipe it to avoid
                          > going back to that file in any way. That works because the file name
                          > was only stored in the buffer and it's gone. You don't have to think
                          > about where else the name would be stored or what marks point into that
                          > file.

                          But you wouldn't waste a precious uppercase mark for a simple temp
                          scratch buffer, which you were unlikely to reuse again anyhow.

                          > So, instead of your patch, you could create a command ":WipeBufKeepMark"
                          > that uses setpos(). Except that setpos() requires a buffer number...
                          > Hmm. Perhaps we should add a way to have setpos() accept a file name?
                          > Then you can solve it in Vimscript.

                          C'mon, you are not telling me, that this is not a bug? It's a simple
                          bug, that an uppercase mark can't be accessed after bwiping a buffer
                          and that should be fixed (and I don't mean to document it).

                          Best,
                          Christian

                          --
                          --
                          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 vim_dev+unsubscribe@....
                          For more options, visit https://groups.google.com/groups/opt_out.
                        • Bram Moolenaar
                          ... 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
                          Message 12 of 22 , Dec 11, 2013
                          • 0 Attachment
                            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 -- Bram@... -- 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 vim_dev+unsubscribe@....
                            For more options, visit https://groups.google.com/groups/opt_out.
                          • Manuel Ortega
                            ... *file*, I would in fact expect :bwipe to zap those. Huh? Lowercase marks are associated with *files*. In the .viminfo file, where the lowercase marks
                            Message 13 of 22 , Dec 11, 2013
                            • 0 Attachment
                              > Now, since lowercase marks are associated with the *buffer* and not the *file*, I would in fact expect :bwipe to zap those. 

                              Huh?  Lowercase marks are associated with *files*.  In the .viminfo file, where the lowercase marks are, each one is associated with a pathname, i.e., a file.  (It's just that in a sense each lowercase mark is associated with more than one file; that doesn't make them assigned to buffers rather than files, though.)

                              If :bwipe should leave uppercase marks intact, it should leave lowercase marks intact too.  Both kinds of marks are for files.

                              But there clearly should be a command to wipe away all the marks associated with a file in one fell swoop.  If :bwipe won't serve that, then something should.

                              -Manny

                              --
                              --
                              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 vim_dev+unsubscribe@....
                              For more options, visit https://groups.google.com/groups/opt_out.
                            • Christian Brabandt
                              Hi Manuel! ... No. Only uppercase marks are stored in .viminfo, lowercase marks are only valid within a current buffer, they don t contain file information.
                              Message 14 of 22 , Dec 11, 2013
                              • 0 Attachment
                                Hi Manuel!

                                On Mi, 11 Dez 2013, Manuel Ortega wrote:

                                > > Now, since lowercase marks are associated with the *buffer* and not the
                                > *file*, I would in fact expect :bwipe to zap those.
                                >
                                > Huh? Lowercase marks are associated with *files*. In the .viminfo file,
                                > where the lowercase marks are, each one is associated with a pathname,
                                > i.e., a file. (It's just that in a sense each lowercase mark is associated
                                > with more than one file; that doesn't make them assigned to buffers rather
                                > than files, though.)

                                No. Only uppercase marks are stored in .viminfo, lowercase marks are
                                only valid within a current buffer, they don't contain file information.

                                > If :bwipe should leave uppercase marks intact, it should leave lowercase
                                > marks intact too. Both kinds of marks are for files.

                                No

                                > But there clearly should be a command to wipe away all the marks associated
                                > with a file in one fell swoop. If :bwipe won't serve that, then something
                                > should.

                                :delmarks A-Z

                                Best,
                                Christian
                                --
                                Am Abend wird man klug
                                Für den vergangenen Tag,
                                Doch niemals klug genug
                                Für den, der kommen mag.
                                -- Friedrich Rückert (Gedichte, Pseudonym: Freimund Raimar)

                                --
                                --
                                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 vim_dev+unsubscribe@....
                                For more options, visit https://groups.google.com/groups/opt_out.
                              • Manuel Ortega
                                ... No. I am now looking at my .viminfo, and there are lowercase marks in it. They live under the section with the heading History of marks within files
                                Message 15 of 22 , Dec 11, 2013
                                • 0 Attachment

                                  > > Now, since lowercase marks are associated with the *buffer* and not the
                                  > *file*, I would in fact expect :bwipe to zap those.
                                  >
                                  > Huh?  Lowercase marks are associated with *files*.  In the .viminfo file,
                                  > where the lowercase marks are, each one is associated with a pathname,
                                  > i.e., a file.  (It's just that in a sense each lowercase mark is associated
                                  > with more than one file; that doesn't make them assigned to buffers rather
                                  > than files, though.)

                                  No. Only uppercase marks are stored in .viminfo, lowercase marks are
                                  only valid within a current buffer, they don't contain file information.


                                  No.  I am now looking at my .viminfo, and there are lowercase marks in it.  They live under the section with the heading "History of marks within files (newest to oldest):"  For instance, I opened my ~/.profile, went to line 166, hit "mb", and then now in viminfo there is now:

                                  > ~/.profile
                                  " 166 0
                                  b 166 0

                                  Lowercase marks find their way into viminfo, and are associated with a file.  They do not vanish when one quits vim, which means they can't be associated "merely" with a buffer, as those don't persist across quittings.  (I'm not using sessions or anything like that).
                                   

                                  > If :bwipe should leave uppercase marks intact, it should leave lowercase
                                  > marks intact too.  Both kinds of marks are for files.

                                  No


                                  Yes. 

                                   
                                  > But there clearly should be a command to wipe away all the marks associated
                                  > with a file in one fell swoop.  If :bwipe won't serve that, then something
                                  > should.

                                  :delmarks A-Z

                                  I said *all* the marks.  ":delmarks A-Za-z0-9" is a pain to type.  And anyway, according to the docs :delmarks only gets rid of the so-called "marks for the current buffer".  If there is such a thing as "buffer-only marks" (and there appear to be no such things), then :delmarks deletes at most them and not ALL marks.  (Or the docs are just wrong).

                                  -Manny

                                  --
                                  --
                                  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 vim_dev+unsubscribe@....
                                  For more options, visit https://groups.google.com/groups/opt_out.
                                • Ben Fritz
                                  ... Lowercase marks are valid only within a single buffer. The :help section I quoted refers specifically to buffers, i.e. Jump to the mark {a-z} in the
                                  Message 16 of 22 , Dec 11, 2013
                                  • 0 Attachment
                                    On Wednesday, December 11, 2013 4:00:22 PM UTC-6, Manuel Ortega wrote:
                                    > > Now, since lowercase marks are associated with the *buffer* and not the *file*, I would in fact expect :bwipe to zap those. 
                                    >
                                    >
                                    > Huh?  Lowercase marks are associated with *files*.

                                    Lowercase marks are valid only within a single buffer. The :help section I quoted refers specifically to buffers, i.e. "Jump to the mark {a-z} in the current buffer."

                                    Uppercase marks are valid anywhere, and will jump to a place in a file regardless of whether that file is currently loaded into a buffer or not. The help specifically refers to files, i.e. "[jump] to the mark {A-Z0-9} in the file where it was set".

                                    That's where I draw the distinction. But if we bring viminfo into this, even the help for viminfo makes a distinction:

                                    "The viminfo file is used to store:
                                    ...
                                    - Marks for several files.
                                    - File marks, pointing to locations in files."

                                    Further down there is a separate section for "viminfo-file-marks" that talks about the uppercase marks and the numbered marks. Just above is a paragraph that talks about "normal" marks, where it talks about manually calling :wviminfo if you want to keep those marks saved when you use :bdelete. This text is missing from the viminfo-file-marks section.

                                    Furthermore, note that the special marks '0 through '9 are NOT currently removed by :bwipe. And those marks are noted in the same help location as manual uppercase marks (:help 'A and :help '0 go to the same place). I'd expect '0 and 'A to act mostly the same, then.

                                    --
                                    --
                                    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 vim_dev+unsubscribe@....
                                    For more options, visit https://groups.google.com/groups/opt_out.
                                  • Christian Brabandt
                                    ... They are not remembered across files. But nevertheless they might end stored in your .viminfo file and that s why you think they are valid across buffers.
                                    Message 17 of 22 , Dec 11, 2013
                                    • 0 Attachment
                                      On Mi, 11 Dez 2013, Manuel Ortega wrote:

                                      > No. I am now looking at my .viminfo, and there are lowercase marks in it.
                                      > They live under the section with the heading "History of marks within
                                      > files (newest to oldest):" For instance, I opened my ~/.profile, went to
                                      > line 166, hit "mb", and then now in viminfo there is now:
                                      >
                                      > > ~/.profile
                                      > " 166 0
                                      > b 166 0

                                      They are not remembered across files. But nevertheless they might end
                                      stored in your .viminfo file and that's why you think they are valid
                                      across buffers.

                                      But that doesn't make mark b valid and magically jump to your
                                      ~/.profile.

                                      > > > But there clearly should be a command to wipe away all the marks
                                      > > associated
                                      > > > with a file in one fell swoop. If :bwipe won't serve that, then
                                      > > something
                                      > > > should.
                                      > >
                                      > > :delmarks A-Z
                                      >
                                      > I said *all* the marks. ":delmarks A-Za-z0-9" is a pain to type. And

                                      It does what you asked for. Clear your 'viminfo' setting and write it,
                                      if you don't want them to persist.

                                      > anyway, according to the docs :delmarks only gets rid of the so-called
                                      > "marks for the current buffer". If there is such a thing as "buffer-only
                                      > marks" (and there appear to be no such things), then :delmarks deletes at
                                      > most them and not ALL marks. (Or the docs are just wrong).

                                      Well, perhaps you want to tweak your 'viminfo' setting. But this has
                                      nothing to do with the proposed patch, we are talking about.

                                      Best,
                                      Christian

                                      --
                                      --
                                      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 vim_dev+unsubscribe@....
                                      For more options, visit https://groups.google.com/groups/opt_out.
                                    • Manuel Ortega
                                      ... But that doesn t make mark b valid and magically jump to your ... I never said it would make b magically jump to my profile if I m currently looking at
                                      Message 18 of 22 , Dec 12, 2013
                                      • 0 Attachment

                                        > No.  I am now looking at my .viminfo, and there are lowercase marks in it.
                                        >  They live under the section with the heading "History of marks within
                                        > files (newest to oldest):"  For instance, I opened my ~/.profile, went to
                                        > line 166, hit "mb", and then now in viminfo there is now:
                                        >
                                        > > ~/.profile
                                        > " 166 0
                                        > b 166 0

                                        They are not remembered across files. But nevertheless they might end
                                        stored in your .viminfo file and that's why you think they are valid
                                        across buffers.
                                        But that doesn't make mark b valid and magically jump to your
                                        ~/.profile.

                                        I never said it would make 'b magically jump to my profile if I'm currently looking at something that isn't my profile.  I said lowercase marks are associated with files.  And each lowercase mark a-z is a mark to a position in...a *file*.  And each lowercase mark a-z is, in viminfo, listed under...a *file*.  Therefore, lowercase marks are associated with files.

                                         
                                        > > > But there clearly should be a command to wipe away all the marks
                                        > > associated
                                        > > > with a file in one fell swoop.  If :bwipe won't serve that, then
                                        > > something
                                        > > > should.
                                        > >
                                        > > :delmarks A-Z
                                        >
                                        > I said *all* the marks.  ":delmarks A-Za-z0-9" is a pain to type.  And

                                        It does what you asked for. Clear your 'viminfo' setting and write it,
                                        if you don't want them to persist.

                                        My point is that there should be a built-in, easy way to clear everything associated with a buffer, including all of the marks that viminfo stores as pointing to positions in the file associated with the buffer.  And one shouldn't have to blast one's entire viminfo to do this. 

                                        > anyway, according to the docs :delmarks only gets rid of the so-called
                                        > "marks for the current buffer".  If there is such a thing as "buffer-only
                                        > marks" (and there appear to be no such things), then :delmarks deletes at
                                        > most them and not ALL marks.  (Or the docs are just wrong).

                                        Well, perhaps you want to tweak your 'viminfo' setting. But this has
                                        nothing to do with the proposed patch, we are talking about.

                                        It has to do with protecting some functionality that your patch will destroy, namely the ability to destroy all marks associated with the :bwiped thing. 

                                        --
                                        --
                                        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 vim_dev+unsubscribe@....
                                        For more options, visit https://groups.google.com/groups/opt_out.
                                      • Ben Fritz
                                        ... They are NOT associated with files though. They are associated with a buffer. The buffer is associated with a file, but you cannot use the marks for that
                                        Message 19 of 22 , Dec 12, 2013
                                        • 0 Attachment
                                          On Thursday, December 12, 2013 1:10:07 PM UTC-6, Manuel Ortega wrote:
                                          > > No.  I am now looking at my .viminfo, and there are lowercase marks in it.
                                          >
                                          >
                                          > >  They live under the section with the heading "History of marks within
                                          >
                                          > > files (newest to oldest):"  For instance, I opened my ~/.profile, went to
                                          >
                                          > > line 166, hit "mb", and then now in viminfo there is now:
                                          >
                                          > >
                                          >
                                          > > > ~/.profile
                                          >
                                          > > " 166 0
                                          >
                                          > > b 166 0
                                          >
                                          >
                                          >
                                          > They are not remembered across files. But nevertheless they might end
                                          >
                                          > stored in your .viminfo file and that's why you think they are valid
                                          >
                                          > across buffers.But that doesn't make mark b valid and magically jump to your
                                          >
                                          > ~/.profile.
                                          >
                                          >
                                          >
                                          > I never said it would make 'b magically jump to my profile if I'm currently looking at something that isn't my profile.  I said lowercase marks are associated with files.  And each lowercase mark a-z is a mark to a position in...a *file*.  And each lowercase mark a-z is, in viminfo, listed under...a *file*.  Therefore, lowercase marks are associated with files.
                                          >

                                          They are NOT associated with files though. They are associated with a buffer. The buffer is associated with a file, but you cannot use the marks for that file unless you have that file in a buffer. The next time you create a buffer for that file, Vim restores the marks from your .viminfo file if you told it to, but you still can't use them if you're in a different buffer. Uppercase marks are different. You can always load a file from an uppercase mark, whether or not you have a buffer for it.

                                          Just under :help :delmarks:

                                          Lowercase marks 'a to 'z are remembered as long as the file remains in the
                                          buffer list. If you remove the file from the buffer list, all its marks are
                                          lost. If you delete a line that contains a mark, that mark is erased.

                                          Lowercase marks can be used in combination with operators. For example: "d't"
                                          deletes the lines from the cursor position to mark 't'. Hint: Use mark 't' for
                                          Top, 'b' for Bottom, etc.. Lowercase marks are restored when using undo and
                                          redo.

                                          Uppercase marks 'A to 'Z include the file name. {Vi: no uppercase marks} You
                                          can use them to jump from file to file. You can only use an uppercase mark
                                          with an operator if the mark is in the current file. The line number of the
                                          mark remains correct, even if you insert/delete lines or edit another file for
                                          a moment. When the 'viminfo' option is not empty, uppercase marks are kept in
                                          the .viminfo file. See |viminfo-file-marks|.

                                          ------------------------------

                                          Here it specifically says lowercase marks are lost when you remove a file from the buffer list.

                                          It says nothing of the sort for uppercase marks, referred to in the same section as "file marks".

                                          :bwipe removing lowercase marks is well documented and intentional. Removing uppercase marks is not documented and probably unintentional.

                                          The way to remove all marks from a buffer, including file marks, is using :delmarks. Otherwise, true file marks should remain. :bwipe doesn't mean "I'm done with this file forever" it just means "I'm done with this file for this edit session."

                                          You can individually turn on and off saving lowercase marks. If ANYTHING AT ALL is in the viminfo option, uppercase marks are preserved. This tells me file marks are meant to be more persistent than the lowercase marks. Right now they are not.

                                          --
                                          --
                                          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 vim_dev+unsubscribe@....
                                          For more options, visit https://groups.google.com/groups/opt_out.
                                        • Manuel Ortega
                                          ... I didn t say that each lowercase mark was valid in every buffer. I said lowercase marks are associated with files. Viminfo contains implicitly (if you
                                          Message 20 of 22 , Dec 12, 2013
                                          • 0 Attachment

                                            On Wed, Dec 11, 2013 at 5:55 PM, Ben Fritz <fritzophrenic@...> wrote:
                                            On Wednesday, December 11, 2013 4:00:22 PM UTC-6, Manuel Ortega wrote:
                                            > > Now, since lowercase marks are associated with the *buffer* and not the *file*, I would in fact expect :bwipe to zap those. 
                                            >
                                            >
                                            > Huh?  Lowercase marks are associated with *files*.

                                            Lowercase marks are valid only within a single buffer. The :help section I quoted refers specifically to buffers, i.e. "Jump to the mark {a-z} in the current buffer."

                                            I didn't say that each lowercase mark was "valid in" every buffer.  I said lowercase marks are associated with files.  Viminfo contains implicitly (if you make some lowercase marks) a mapping from lowercase marks to one or more files.  If that is not an association, I don't know what is.

                                            Uppercase marks are valid anywhere, and will jump to a place in a file regardless of whether that file is currently loaded into a buffer or not. The help specifically refers to files, i.e. "[jump] to the mark {A-Z0-9} in the file where it was set".

                                            Right, I never said otherwise.

                                            I am objecting to the view that :bwipe should preserve the uppercase marks but not the lowercase marks.  I claim no reason has been given for treating them differently.  You made an argument that the lowercase should be deleted and the uppercase should be kept, because (i) lowercase marks are associated with buffers not with files, whereas (ii) uppercase marks are associated purely to files.

                                            I then pointed out that (i) is false.  You and Christian replied, in effect, that "associated with buffers" means "whether or not you can use the mark depends on what buffer you are currently in".

                                            *That* is true, never denied by me, and if you replace (i) with *it* in the above argument, the argument collapses.

                                            Suppose I have a file foo.  Call its buffer "bfoo".  There are some lowercase and uppercase marks associated with foo, and by extension with bfoo.  Upon quitting, Vim records these marks, lower and upper, as belonging to foo (it also records some of the lowercase marks as also belonging to other files, but that's not relevant here).

                                            Now suppose for some reason I want to :bwipe.  Not delete the file foo, but just :bwipe.  If I want to *keep* an uppercase mark to foo, so that I can later return to it at will, why on earth would I automatically want to *lose* the lowercase marks?  After all, it's not as though they can interfere with other lowercase marks once bfoo is bwiped.  Is it to free up some memory?  The memory involved is trivial.  Is it to remove any record that I have been looking at foo (Christian's reason)?  Surely not, as the uppercase mark, which is preserved, contains that information; one would need to blast away the uppercase marks too, as :bwipe currently does.

                                            Further down there is a separate section for "viminfo-file-marks" that talks about the uppercase marks and the numbered marks. Just above is a paragraph that talks about "normal" marks, where it talks about manually calling :wviminfo if you want to keep those marks saved when you use :bdelete. This text is missing from the viminfo-file-marks section.

                                            The distinction made between upper and lower here is totally without relevance to the question of whether :bwipe should delete both/neither/one-but-not-the-other.

                                            (Incidentally, it repeatedly uses phrases like "marks for a file", which helps explain why the claim you made, that marks are not associated with files, sounds bizarre until one realizes that by "associated with buffers" you meant something about when the marks can or can't be invoked.)

                                            Furthermore, note that the special marks '0 through '9 are NOT currently removed by :bwipe. And those marks are noted in the same help location as manual uppercase marks (:help 'A and :help '0 go to the same place). I'd expect '0 and 'A to act mostly the same, then.

                                            Agreed.  It is bizarre that the different kinds of marks are treated differently by :bwipe.  If there is a buffer and there is no corresponding file (bt=nofile, or just not saved yet), then there are no numbered or uppercase marks, and if you make some lowercase marks they should be destroyed by :bwipe.  If on the other hand the buffer does have a corresponding file, then :bwipe leaves the file in place.  If the file is left, I see no reason at all why :bwipe should delete any marks at all.  (Though I stand by my claim that there should be some built-in and easy, argument-free way--perhaps ":destroymarks" to instantly destroy all marks associated with a file).

                                            So either way --- corresponding file or no corresponding file --- :bwipe should not treat the different kinds of marks differently. In the former case, they should all be left alone, and in the latter case, none should survive (probably upper and numbered don't even exist to begin with).

                                            -Manny

                                            --
                                            --
                                            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 vim_dev+unsubscribe@....
                                            For more options, visit https://groups.google.com/groups/opt_out.
                                          • Manuel Ortega
                                            ... It follows from those two things that marks are associated with files. If there is a mapping between marks and buffers, and a mapping between buffers and
                                            Message 21 of 22 , Dec 12, 2013
                                            • 0 Attachment
                                              > > On Thursday, December 12, 2013 1:10:07 PM UTC-6, Manuel Ortega wrote:
                                              > > > I never said it would make 'b magically jump to my profile if I'm
                                              > > > currently looking at something that isn't my profile.  I said
                                              > > > lowercase marks are associated with files.  And each lowercase
                                              > > > mark a-z is a mark to a position in...a *file*.  And each
                                              > > > lowercase mark a-z is, in viminfo, listed under...a *file*.
                                              > > >  Therefore, lowercase marks are associated with files.
                                              > > > 
                                              > > 
                                              > > They are NOT associated with files though. They are associated with
                                              > > a buffer. The buffer is associated with a file, 

                                              It follows from those two things that marks are associated with files.
                                              If there is a mapping between marks and buffers, and a mapping between
                                              buffers and files, then there is a mapping between marks and files.  If
                                              a mapping is not an association I will eat my shorts.

                                              I was objecting to your claim that marks are not associated with files.
                                              They plainly are, I have demonstrated this, and the two things you just
                                              said logically entail it.  I was *not* objecting to your claim that marks
                                              *are* associated with buffers.  It is perfectly consistent for marks to
                                              be associated with buffers and with files.

                                              > > but you cannot use the marks for that file unless you have that file
                                              > > in a buffer. The next time you create a buffer for that file, Vim
                                              > > restores the marks from your .viminfo file if you told it to, but
                                              > > you still can't use them if you're in a different buffer.

                                              None of this shows that marks are not associated with files.  All of
                                              this is merely about the conditions for *using or invoking* a mark that
                                              already exists and is associated with a file.

                                              There is only one disconnect between marks and files, namely when
                                              lowercase marks have been made in a buffer that does not yet have a
                                              corresponding file.  But this situation is not relevant to Christian's
                                              post, wherein he wants to keep an uppercase mark, which implies that
                                              there *is* a file corresponding to his buffer.  And if the disconnect
                                              counts as proof that marks are not associated with files, then it also
                                              counts as proof that bytes are not associated with files---since after
                                              all they can exist in a buffer with no corresponding file.  But if bytes
                                              are not associated with files, then files are not associated with bytes,
                                              since the relation of "being associated with" is symmetric.  And it is
                                              plainly absurd to say that files are not associated with bytes.

                                              > > Just under :help :delmarks:
                                              > > 
                                              > > Lowercase marks 'a to 'z are remembered as long as the file remains
                                              > > in the buffer list.  If you remove the file from the buffer list,
                                              > > all its marks are lost.  If you delete a line that contains a mark,
                                              > > that mark is erased.
                                              > > ------------------------------
                                              > > 
                                              > > Here it specifically says lowercase marks are lost when you remove a
                                              > > file from the buffer list.

                                              Here "lost" only means "not available for use", right?  It does not mean
                                              "and will be deleted from viminfo when it is next written", right?  If
                                              I am right, then the lowercase marks remain associated with a file, and
                                              this passage does nothing at all to show that marks are not associated
                                              with files.  If I am wrong, then it shows only that there is a way to 
                                              disassociate all lowercase marks from a file at once.

                                              I am mystified as to why "one cannot use a mark for a file when there is
                                              no buffer for that file open" is taken to prove that marks are not
                                              associated with files.  It perhaps proves that marks are associated with
                                              buffers, but that is consistent with marks being associated with files.

                                              > > :bwipe doesn't mean "I'm done with this file forever" it just means
                                              > > "I'm done with this file for this edit session."

                                              Exactly, which is why it is bizarre for :bwipe to wipeout the lowercase
                                              marks that are associated with that file.  Maybe when I come back to the
                                              file, I want my lowercase marks that help me jump to different parts of
                                              that file.  I don't know why those should vanish just because "I'm done
                                              with this file for this edit session".

                                              :bwipe should wipe away all lowercase marks when the buffer being wiped
                                              has no associated file.  In this case there are no uppercase or numbered
                                              marks to preserve anyway.  :bwipe should preserve all marks when the
                                              buffer being wiped does have an associated file.

                                              -Manny

                                              --
                                              --
                                              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 vim_dev+unsubscribe@....
                                              For more options, visit https://groups.google.com/groups/opt_out.
                                            • Ben Fritz
                                              ... This I can agree would be useful. I don t actually know why it needs to remove any marks at all. But at least that behavior is documented. I suppose the
                                              Message 22 of 22 , Dec 12, 2013
                                              • 0 Attachment
                                                On Thursday, December 12, 2013 3:13:33 PM UTC-6, Manuel Ortega wrote:
                                                > > > :bwipe doesn't mean "I'm done with this file forever" it just means
                                                >
                                                > > > "I'm done with this file for this edit session."
                                                >
                                                >
                                                > Exactly, which is why it is bizarre for :bwipe to wipeout the lowercase
                                                > marks that are associated with that file.  Maybe when I come back to the
                                                >
                                                > file, I want my lowercase marks that help me jump to different parts of
                                                > that file.  I don't know why those should vanish just because "I'm done
                                                > with this file for this edit session".
                                                >
                                                >
                                                >
                                                > :bwipe should wipe away all lowercase marks when the buffer being wiped
                                                > has no associated file.  In this case there are no uppercase or numbered
                                                > marks to preserve anyway.  :bwipe should preserve all marks when the
                                                >
                                                > buffer being wiped does have an associated file.
                                                >

                                                This I can agree would be useful. I don't actually know why it needs to remove any marks at all. But at least that behavior is documented.

                                                I suppose the workaround for all this is probably the same: write the .viminfo file manually.

                                                Still I don't think the two types of mark are at all alike. File marks are more like bookmarks of files. You use them to quickly jump to a desired file. Lowercase marks are used to mark places in a buffer you're working on right now, to help you keep your place or do quick edits without remembering line numbers. A :bwipe *does* say "I'm done with my changes for now and I don't want to come back for a while". So lowercase marks make some sense to get rid of, since they're for work-in-progress, like the position I've scrolled my browser window to on a long webpage. Uppercase marks are more useful though for "this file is interesting to me and I look at it frequently", like a browser bookmark. When I exit a page in my browser I expect the scroll to get reset because I'm not working on the same thing as before. But I don't expect my bookmark to also get deleted; I will probably revisit this page later.

                                                If you're not done with work-in-progress, it makes sense to keep the buffer in your buffer list, thus you wouldn't want to use :bwipe. But if you're done with work-in-progress on a file you need to edit frequently in different ways, it makes sense to keep a global bookmark while removing all the little work-in-progress positions of interest.

                                                --
                                                --
                                                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 vim_dev+unsubscribe@....
                                                For more options, visit https://groups.google.com/groups/opt_out.
                                              Your message has been successfully submitted and would be delivered to recipients shortly.