[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Unexpected behaviour of GTAGSLIBPATH
|
From: |
Shigio YAMAGUCHI |
|
Subject: |
Re: Unexpected behaviour of GTAGSLIBPATH |
|
Date: |
Fri, 28 Feb 2020 15:46:43 +0900 |
> /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年2月28日(金) 12:27 Mandar Mitra <address@hidden>:
>
> 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 always
> 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 dummy
> project with no files at all does not work).
>
> Suggestion: if there are other users like me who expect this behaviour, you
> could consider changing the behaviour + documentation of GTAGSLIBPATH from
>
> ----- 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
> ´GTAGS´ 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 ´GTAGS´ is
> targeted in the retrieval, this variable is ignored when -r or -s
> is specified.
> ---------------------------------------------------------------------------
>
> Thanks again,
> -mandar.
>
>
> > 2020年2月27日(木) 23:50 Mandar Mitra <address@hidden>:
> > >
> > > I'd be grateful for any suggestions regarding where I may be goofing up
> > > below.
> > >
> > > xps12$ export GTAGSLIBPATH=/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!
> >
> >
> >
>
--
Shigio YAMAGUCHI <address@hidden>
PGP fingerprint:
26F6 31B4 3D62 4A92 7E6F 1C33 969C 3BE3 89DD A6EB