Re: Unexpected behaviour of GTAGSLIBPATH
Shigio YAMAGUCHI <[email protected]> Fri, 28 Feb 2020 15:46:43 +0900
| Newsgroups | gmane.comp.gnu.global.general |
|---|---|
| Message-ID | <CADJmJYohudcd56_SqhEFoZk-XSmsK9rSYgk-as67ov49EseO4Q@mail.gmail.com> |
> /usr/bin/global "$@" 2> /dev/null || (cd $global_home; /usr/bin/global -a=
"$@")
If your target is GTAGSLIBPATH, how about a more direct approach which
does not require dummy project such as:
[libsearch]
-------------------------------------------------------------------
#!/bin/sh
for d in `echo "$GTAGSLIBPATH" | sed -e 's/^:/.:/' -e 's/:$/:./' \
-e 's/::/:.:/' -e 's/:/ /g'`
do
(cd $d && global -a "$@")
done
-------------------------------------------------------------------
> library functions. If the given symbol is not found in the CURRENT
> project,
That word was missing. I will fix it.
Thank you!
2020=E5=B9=B42=E6=9C=8828=E6=97=A5(=E9=87=91) 12:27 Mandar Mitra <mandar.mi=
[email protected]>:
>
> Shigio YAMAGUCHI wrote (Fri, Feb 28, 2020 at 07:39:43AM +0900):
> > Hello,
> > Probably because there are no tag files there.
> > Global(1) must always be run in any project.
>
> Ok, thank you. In order to get around the restriction that global must al=
ways be run in a project, I'm using the following hack for now:
>
> /usr/bin/global "$@" 2> /dev/null || (cd $global_home; /usr/bin/global -a=
"$@")
>
> $global_home is a dummy project with one empty file called dummy.c (a dum=
my project with no files at all does not work).
>
> Suggestion: if there are other users like me who expect this behaviour, y=
ou could consider changing the behaviour + documentation of GTAGSLIBPATH fr=
om
>
> ----- Existing -----
> GTAGSLIBPATH
> If this variable is set, it is used as the path to search for
> library functions. If the given symbol is not found in the
> project, global also searches in these paths. Since only
> =C2=B4GTAGS=C2=B4 is targeted in the retrieval, this variable is=
ignored
> when -r or -s is specified.
> -------------------------------------------------------------------------=
--
>
> to
>
> ----- Suggested -----
> GTAGSLIBPATH
> If this variable is set, it is used as the path to search for
> library functions. If the given symbol is not found in the CURRENT
> project, OR IF GLOBAL IS NOT BEING RUN FROM WITHIN ANY PROJECT,
> global also searches in these paths. Since only =C2=B4GTAGS=C2=B4 =
is
> targeted in the retrieval, this variable is ignored when -r or -s
> is specified.
> -------------------------------------------------------------------------=
--
>
> Thanks again,
> -mandar.
>
>
> > 2020=E5=B9=B42=E6=9C=8827=E6=97=A5(=E6=9C=A8) 23:50 Mandar Mitra <manda=
[email protected]>:
> > >
> > > I'd be grateful for any suggestions regarding where I may be goofing =
up below.
> > >
> > > xps12$ export GTAGSLIBPATH=3D/home/mandar/ir/smart/src
> > > xps12$ echo $GTAGSLIBPATH
> > > /home/mandar/ir/smart/src
> > > xps12$ global -i textloc
> > > h/textloc.h
> > > xps12$ pwd
> > > /home/mandar/ir/smart/src
> > > xps12$ cd
> > > xps12$ global -i textloc
> > > global: GTAGS not found.
> > > xps12$
> > >
> > > Why can global not find the GTAGS file when I run the last command?
> > >
> > > Thanks!
> >
> >
> >
>
--=20
Shigio YAMAGUCHI <[email protected]>
PGP fingerprint:
26F6 31B4 3D62 4A92 7E6F 1C33 969C 3BE3 89DD A6EB