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

Re: loss of tags

Expand Messages
  • Benji Fisher
    Why not either let s:taglist = taglist() to save the tags before switching windows or wincmd p Do something with taglist() wincmd p so that you return to the
    Message 1 of 4 , Jun 12, 2013
    • 0 Attachment
           Why not either

      let s:taglist = taglist()

      to save the tags before switching windows or

      wincmd p
      " Do something with taglist()
      wincmd p

      so that you return to the right window before issuing the taglist() command.

           Variants:  s:taglist could be a Dictionary, keyed on the buffer name or number.  If you save the buffer number, then you can switch to the right buffer even if there are more window-switching commands than you have told us about.

           IWBNI taglist() accepted an optional buffer identifier.

      HTH  --Benji Fisher


      On Tue, Jun 11, 2013 at 9:33 PM, Charles Campbell <Charles.E.Campbell@...> wrote:
      Hello!

      I'm putting together a script that

        * reads a log file which contains procedure names and line numbers
        * uses taglist() to obtain a filename associated with a procedure name

      The relevant script:

            exe s:prcwin."wincmd w"
           " an echomsg shows that taglist() can obtain a filename associated with a procedure name here
            exe "sil! e! ".fnameescape(proc["filename"])
           " an echomsg here shows that taglist() comes up empty

      So, clearly the editing of a file causes a loss of the tags.  (btw, I used the same filename in both echomsg s)

       * how can I prevent that loss of tags from occurring?
       * or how can I get vim to re-read that tags file?

      Thanks!
      Chip Campbell


      --
      --
      You received this message from the "vim_use" 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_use" group.
      To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
      For more options, visit https://groups.google.com/groups/opt_out.



      --
      --
      You received this message from the "vim_use" 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_use" group.
      To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
      For more options, visit https://groups.google.com/groups/opt_out.
       
       
    • Charles Campbell
      ... Hello! Interesting idea... It seems to me that there s a bug involved with vim losing the tags database it had loaded. I wish there was a way to get
      Message 2 of 4 , Jun 14, 2013
      • 0 Attachment
        Benji Fisher wrote:
        > Why not either
        >
        > let s:taglist = taglist()
        >
        > to save the tags before switching windows or
        >
        > wincmd p
        > " Do something with taglist()
        > wincmd p
        >
        > so that you return to the right window before issuing the taglist()
        > command.
        >
        > Variants: s:taglist could be a Dictionary, keyed on the buffer
        > name or number. If you save the buffer number, then you can switch to
        > the right buffer even if there are more window-switching commands than
        > you have told us about.
        >
        > IWBNI taglist() accepted an optional buffer identifier.
        >
        > HTH --Benji Fisher
        >
        Hello!

        Interesting idea...
        It seems to me that there's a bug involved with vim losing the tags
        database it had loaded. I wish there was a way to get reload tags, anyway.

        I'll look into saving the output of taglist(".*") and working with
        that. The output of taglist() is a List, not a Dictionary, so I'll need
        to convert it. Another issue: taglist() takes regular expressions, so
        one can use

        proc holds a string...
        taglist(proc.".*") and get a list of tags which match proc.*; ie. do
        regular expression matching. I'll have to check to see if the tags
        database is still retained by a window.

        I'll need to figure out how to do that, too.

        Regards, and thank you,
        Chip Campbell



        --
        --
        You received this message from the "vim_use" 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_use" group.
        To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
        For more options, visit https://groups.google.com/groups/opt_out.
      • Nikolay Pavlov
        On Jun 15, 2013 12:30 AM, Charles Campbell ... command. ... name or number. If you save the buffer number, then you can switch
        Message 3 of 4 , Jun 14, 2013
        • 0 Attachment


          On Jun 15, 2013 12:30 AM, "Charles Campbell" <Charles.E.Campbell@...> wrote:
          >
          > Benji Fisher wrote:
          >>
          >>      Why not either
          >>
          >> let s:taglist = taglist()
          >>
          >> to save the tags before switching windows or
          >>
          >> wincmd p
          >> " Do something with taglist()
          >> wincmd p
          >>
          >> so that you return to the right window before issuing the taglist() command.
          >>
          >>      Variants:  s:taglist could be a Dictionary, keyed on the buffer name or number.  If you save the buffer number, then you can switch to the right buffer even if there are more window-switching commands than you have told us about.
          >>
          >>      IWBNI taglist() accepted an optional buffer identifier.
          >>
          >> HTH  --Benji Fisher
          >>
          > Hello!
          >
          > Interesting idea...
          > It seems to me that there's a bug involved with vim losing the tags database it had loaded.  I wish there was a way to get reload tags, anyway.
          >
          > I'll look into saving the output of taglist(".*") and working with that.  The output of taglist() is a List, not a Dictionary, so I'll need to convert it.  Another issue: taglist() takes regular expressions, so one can use
          >
          >    proc holds a string...
          >    taglist(proc.".*") and get a list of tags which match proc.*; ie. do regular expression matching.  I'll have to check to see if the tags database is still retained by a window.
          >
          > I'll need to figure out how to do that, too.
          >
          > Regards, and thank you,
          >
          > Chip Campbell

          Can't say whether this database is hold anywhere, but I did not find any caching when exploring taglist() code. It just always reads tags files.

          > --
          > --
          > You received this message from the "vim_use" 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_use" group.
          > To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
          > For more options, visit https://groups.google.com/groups/opt_out.
          >
          >

          --
          --
          You received this message from the "vim_use" 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_use" group.
          To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+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.