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

Re: need help with tags - SOLVED (sort of)

Expand Messages
  • wfdudley
    I decided that the problem has to be in the EXINIT string, since that is the only difference in the accounts that don t work, and my account. I find that if I
    Message 1 of 6 , Aug 2, 2010
      I decided that the problem has to be in the EXINIT string, since that is
      the only difference in the accounts that don't work, and my account.

      I find that if I set EXINIT to "ic" EXINIT="set ic", then tags works.

      I can't explain this. The case of the tags in my tags file is exactly the
      same case as the symbols referenced in the source code.

      Bill Dudley


      On 8/2/10, wfdudley <wfdudley@...> wrote:
      > Tony,
      >
      > Thanks for the reply.
      >
      > Actually, I'm not talking specifically about C tags, since I'm writing in
      > perl.
      > Years ago I wrote a program called ptags that will create a valid tags file
      > from a bunch of perl scripts, and I use that to navigate around in my
      > Perl source.
      >
      > I actually PREFER running vim in vi compatibility mode, because I really
      > dislike
      > all the features in vim -- they really make my life difficult, as vim often
      > does
      > surprising things that I don't expect because of all the "features".
      > Vi is quite
      > powerful enough. For example, if I want to edit two files at the same time,
      > I
      > just open TWO xterms. Novel, eh? Accidentally hitting :N instead of :n in
      > vi
      > doesn't do anything surprising, but in VIM, I get an annoying split
      > screen. Ugh.
      >
      > But I digress. Absent in your email was an answer to my question. WHY
      > won't
      > vim read the tags file when any other user runs it (and they DON'T HAVE my
      > EXINIT string). When I do ":set tags" (as either myself of another user), I
      > get
      > the same answer: "tags=./tags,./TAGS,tags,TAGS". So that isn't the
      > problem.
      >
      > So I'll ask again.
      >
      > Is there ANYWAY for me to get vim to TELL ME why it cannot find a tag, that
      > is
      > plainly there, that tag file is in the cwd, the source is in the cwd,
      > and there is NO
      > special .vimrc file or EXINIT string?
      >
      > Thanks to anybody who can shed some light on this.
      >
      > Bill Dudley
      >
      > P.S. At one time, I got so annoyed at vim's incompatibie "compatiblity
      > mode" that
      > I compiled the source code to OLD vi and ran that for several years,
      > until it went
      > away during a machine upgrade.
      >
      >
      > On 7/30/10, Tony Mechelynck <antoine.mechelynck@...> wrote:
      >> On 30/07/10 22:24, dud wrote:
      >>> Hi,
      >>>
      >>> I'm running version 7.2.245 on an Ubuntu server.
      >>>
      >>> I've been a vi user since the 1980's and use the tags feature
      >>> extensively.
      >>>
      >>> My coworker cannot get tags to work in vim. Any tag he tries returns:
      >>>
      >>> E426: tag not found:<subroutine name here>
      >>>
      >>> I can reproduce this by logging in as a different user than myself.
      >>> Something
      >>> is magical about my environment that allows tags to work for me but no
      >>> one
      >>> else.
      >>>
      >>> The conditions are:
      >>>
      >>> I'm "in" the directory where the source is, as well as where the tags
      >>> file is.
      >>>
      >>> The tags file is 644, read by world.
      >>>
      >>> The source files are 644, read by world.
      >>>
      >>> How can I debug what the problem is?
      >>>
      >>> Why can't vim find the tag even though it's right there in the tags
      >>> file?
      >>>
      >>> How can I ask vim what it's "path" is for finding the tags file? I
      >>> can't find that in the help.
      >>> :set all doesn't show anything like a list of locations to search for
      >>> tags.
      >>> If I set verbose to 99, I see vim trying all kinds of stupid places
      >>> for the tags file,
      >>> except the current directory.
      >>>
      >>> I do not have a .vimrc or .exrc, just this in my .profile:
      >>>
      >>> EXINIT="set ai sm magic ic sw=4 cedit= export EXINIT
      >>>
      >>> Thanks,
      >>> Bill Dudley
      >>>
      >>
      >> I suppose you mean C tags. For them to work, the tags file must have
      >> been created (preferably by Exuberant ctags) and Vim must be able to
      >> find it.
      >>
      >> By default, Vim looks for the tags file in the current directory (which
      >> will be shown in answer to the :pwd command) and in the directory of the
      >> current file. If you want to search other locations (such as the parent
      >> directories of the current file's directory) you will have to tweak the
      >> 'tags' option yourself.
      >>
      >> Note also that if your coworker has 'autochdir' set (which I don't
      >> recommend) the current directory will always be changed to the directory
      >> of the current file, which means that only one of the two "typical"
      >> locations of the tags file will be searched.
      >>
      >> With only an EXINIT environment variable, there are many nice features
      >> of Vim which you won't see. In particular, it will put you in
      >> 'compatible' mode, some plugins will simply not work, and with the
      >> values you have set, you won't even get filetype-specific behaviour. I
      >> recommend to remove that EXINIT variable and to write the following into
      >> a file named ~/.vimrc
      >>
      >> runtime vimrc_example.vim
      >> set autoindent
      >> set ignorecase showmatch
      >> set magic
      >> set shiftwidth=4
      >>
      >> If later you want more customizations, you will add them to this file,
      >> usually after the call to vimrc_example.vim (but if you want to change
      >> the menu and messages language, you must do it before instead). For
      >> instance, to be able to edit files containing any kind of weird
      >> characters you might add
      >>
      >> if has('multi_byte')
      >> " if the required capabilities are not available,
      >> " we cannot use them
      >> " is the OS locale already Unicode?
      >> " if not, prepare to change
      >> if &encoding !~? '^u'
      >> " but first, avoid jamming keyboard input
      >> if &termencoding == ""
      >> let &termencoding = &encoding
      >> endif
      >> set encoding=utf-8
      >> endif
      >> " set a Ā«reasonableĀ» heuristic to determine
      >> " the 'fileencoding of existing files
      >> set fileencodings=ucs-bom,utf-8,default,latin1
      >> " the following two settings are optional
      >> " create new files in UTF-8
      >> setglobal fileencoding=utf-8
      >> " create new Unicode files with Byte-Order mark
      >> setglobal bomb
      >> " Note: certain files, including anything starting #!
      >> " must have 'nobomb' instead (using :setlocal),
      >> " or be created in some non-Unicode 'fileencoding'
      >> " such as e.g. Latin1.
      >> endif
      >>
      >> or to use a font of your choice in gvim (the GUI version of Vim) you
      >> would add something like what is shown under :help setting-guifont
      >>
      >>
      >> Best regards,
      >> Tony.
      >> --
      >> Proposed Additions to the PDP-11 Instruction Set:
      >>
      >> PI Punch Invalid
      >> POPI Punch Operator Immediately
      >> PVLC Punch Variable Length Card
      >> RASC Read And Shred Card
      >> RPM Read Programmers Mind
      >> RSSC reduce speed, step carefully (for improved accuracy)
      >> RTAB Rewind tape and break
      >> RWDSK rewind disk
      >> RWOC Read Writing On Card
      >> SCRBL scribble to disk - faster than a write
      >> SLC Search for Lost Chord
      >> SPSW Scramble Program Status Word
      >> SRSD Seek Record and Scar Disk
      >> STROM Store in Read Only Memory
      >> TDB Transfer and Drop Bit
      >> WBT Water Binary Tree
      >>
      >

      --
      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
    • Charles Campbell
      ... I wonder if you re getting vim confused as to whether you have a ctags-style tags file or an emacs-style TAGS file. Regards, Chip Campbell -- You received
      Message 2 of 6 , Aug 2, 2010
        wfdudley wrote:
        > I decided that the problem has to be in the EXINIT string, since that is
        > the only difference in the accounts that don't work, and my account.
        >
        > I find that if I set EXINIT to "ic" EXINIT="set ic", then tags works.
        >
        > I can't explain this. The case of the tags in my tags file is exactly the
        > same case as the symbols referenced in the source code.
        >
        > Bill Dudley

        I wonder if you're getting vim confused as to whether you have a
        ctags-style tags file or an emacs-style TAGS file.

        Regards,
        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
      • wfdudley
        I didn t even know emacs HAD tags support. I just copied the format of a file output by ctags for my ptags output. What s the difference in formats? dud ... --
        Message 3 of 6 , Aug 2, 2010
          I didn't even know emacs HAD tags support.

          I just copied the format of a file output by ctags for my ptags output.

          What's the difference in formats?

          dud



          On 8/2/10, Charles Campbell <Charles.E.Campbell@...> wrote:
          > wfdudley wrote:
          >> I decided that the problem has to be in the EXINIT string, since that is
          >> the only difference in the accounts that don't work, and my account.
          >>
          >> I find that if I set EXINIT to "ic" EXINIT="set ic", then tags works.
          >>
          >> I can't explain this. The case of the tags in my tags file is exactly the
          >> same case as the symbols referenced in the source code.
          >>
          >> Bill Dudley
          >
          > I wonder if you're getting vim confused as to whether you have a
          > ctags-style tags file or an emacs-style TAGS file.
          >
          > Regards,
          > 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 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
        • Charles Campbell
          ... I admit that I haven t bothered to determine what emac s TAGS format is; I note that it has some control characters in it (see man etags). One obvious
          Message 4 of 6 , Aug 2, 2010
            wfdudley wrote:
            > I didn't even know emacs HAD tags support.
            >
            > I just copied the format of a file output by ctags for my ptags output.
            >
            > What's the difference in formats?
            >

            I admit that I haven't bothered to determine what emac's TAGS format is;
            I note that it has some control characters in it (see man etags). One
            obvious difference is that ctags produces <tags> files and etags
            produces <TAGS> files. You can determine if your vim has emacs-tags
            support by:

            :version (and looking for +emacs_tags in the output)

            or by typing

            :echo has("emacs_tags")

            So, are your tags files <tags> or <TAGS>? Still, I have +emacs_tags
            support with the vim I've compiled, but regular tags work for both
            <tags> and <TAGS>, so I'm not sure that this is the kernel of your problem.

            Regards,
            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
          • wfdudley
            My tags file is called tags , because I copied the output of ctags. I have no idea why set ai would cause this feature to start working, but it does. Bill
            Message 5 of 6 , Aug 2, 2010
              My tags file is called "tags", because I copied the output of ctags.

              I have no idea why "set ai" would cause this feature to start working, but
              it does.

              Bill Dudley


              On 8/2/10, Charles Campbell <Charles.E.Campbell@...> wrote:
              > wfdudley wrote:
              >> I didn't even know emacs HAD tags support.
              >>
              >> I just copied the format of a file output by ctags for my ptags output.
              >>
              >> What's the difference in formats?
              >>
              >
              > I admit that I haven't bothered to determine what emac's TAGS format is;
              > I note that it has some control characters in it (see man etags). One
              > obvious difference is that ctags produces <tags> files and etags
              > produces <TAGS> files. You can determine if your vim has emacs-tags
              > support by:
              >
              > :version (and looking for +emacs_tags in the output)
              >
              > or by typing
              >
              > :echo has("emacs_tags")
              >
              > So, are your tags files <tags> or <TAGS>? Still, I have +emacs_tags
              > support with the vim I've compiled, but regular tags work for both
              > <tags> and <TAGS>, so I'm not sure that this is the kernel of your problem.
              >
              > Regards,
              > 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 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
            • Tony Mechelynck
              ... There is one important effect of ignorecase on Vim s tags subsystem s behaviour, and here it is: when using a sorted tags file and binary search to make
              Message 6 of 6 , Aug 6, 2010
                On 02/08/10 17:27, wfdudley wrote:
                > I decided that the problem has to be in the EXINIT string, since that is
                > the only difference in the accounts that don't work, and my account.
                >
                > I find that if I set EXINIT to "ic" EXINIT="set ic", then tags works.
                >
                > I can't explain this. The case of the tags in my tags file is exactly the
                > same case as the symbols referenced in the source code.
                >
                > Bill Dudley
                >
                >

                There is one important effect of 'ignorecase' on Vim's tags subsystem's
                behaviour, and here it is: when using a sorted tags file and binary
                search to make tags finding faster, the tags file must be sorted
                case-folded (b between A and C) if 'ignorecase' is on, it must be sorted
                on ASCII value (a after Z) if 'ignorecase' is off. If the file uses the
                wrong sort order you must tell Vim not to use binary search.

                The tags file can contain a header line indicating whether it is
                unsorted, ASCII-sorted or casefold-sorted. Of course, if you re-sort the
                file, the flag in that line must be changed.

                See :help 'tagbsearch' for details.


                Best regards,
                Tony.
                --
                I'll grant thee random access to my heart,
                Thoul't tell me all the constants of thy love;
                And so we two shall all love's lemmas prove
                And in our bound partition never part.
                -- Stanislaw Lem, "Cyberiad"

                --
                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
              Your message has been successfully submitted and would be delivered to recipients shortly.