Re: [RFC] Variable substitution in gtags.conf

Hideki IWAMOTO <[email protected]>
Newsgroups gmane.comp.gnu.global.bugs
Message-ID <[email protected]>
Hi. Yamaguchi san.

 In thre current implementation, "gtags --config=name" expands  variables, but "gtags --config" does not.
Is this an intention?

$ gtags --config=gtags_parser
fortran:/home/iwamoto/global/lib/gtags/exuberant-ctags.la,pascal:/home/iwamoto/global/lib/gtags/exuberant-ctags.la,c#:/home/iwamoto/global/lib/gtags/exuberant-ctags.la,lisp:/home/iwamoto/global/lib/gtags/exuberant-ctags.la,scheme:/home/iwamoto/global/lib/gtags/exuberant-ctags.la,awk:/home/iwamoto/global/lib/gtags/exuberant-ctags.la,ruby:/home/iwamoto/global/lib/gtags/exuberant-ctags.la,perl:/home/iwamoto/global/lib/gtags/exuberant-ctags.la,python:/home/iwamoto/global/lib/gtags/exuberant-ctags.la,vim:/home/iwamoto/global/lib/gtags/exuberant-ctags.la,sh:/home/iwamoto/global/lib/gtags/exuberant-ctags.la

$ gtags --config
:skip=HTML/,HTML.pub/,tags,TAGS,ID,y.tab.c,y.tab.h,gtags.files,cscope.files,cscope.out,cscope.po.out,cscope.in.out,SCCS/,RCS/,CVS/,CVSROOT/,{arch}/,autom4te.cache/,*.orig,*.rej,*.bak,*~,#*#,*.swp,*.tmp,*_flymake.*,*_flymake:langmap=c\:.c.h,yacc\:.y,asm\:.s.S,java\:.java,cpp\:.c++.cc.hh.cpp.cxx.hxx.hpp.C.H,php\:.php.php3.phtml:langmap=fortran\:.f.for.f77.f90.f95,pascal\:.p.pas,c#\:.cs,lisp\:.l.el.lisp,scheme\:.scm:langmap=awk\:.awk,ruby\:.rb,perl\:.pl,python\:.py,vim\:.vim,sh\:.sh:ctagslib=$libdir/gtags/exuberant-ctags.la:gtags_parser=fortran\:$ctagslib:gtags_parser=pascal\:$ctagslib:gtags_parser=c#\:$ctagslib:gtags_parser=lisp\:$ctagslib:gtags_parser=scheme\:$ctagslib:gtags_parser=awk\:$ctagslib:gtags_parser=ruby\:$ctagslib:gtags_parser=perl\:$ctagslib:gtags_parser=python\:$ctagslib:gtags_
 parser=vim\:$ctagslib:gtags_parser=sh\:$ctagslib:HTAGS_OPTIONS=-aDfFIos --line-number=5 --table-list --disable-idutils --colorize-warned-line --no-order-list:



On Mon, 23 Nov 2015 15:39:19 +0900
Shigio YAMAGUCHI <[email protected]> wrote:

> Hi,
> I'm thinking enabling variable substitution in gtags.conf.
> It is simillar to sh(1).
> 
> '$name' is replaced with the value of variable 'name'.
> 
> Example1: Making meaning clear
> 
> [gtags.conf]
> +-------------------------------------------
> |default:tc=definitions:tc=main\
> |definitions:\
> | fgcolor=32:\
> | bgcolor=44:
> |main:\
> | :GREP_COLOR='${fgcolor};${bgcolor};4':
> 
> $ gtags --conf=fgcolor
> 32
> $ gtags --conf=bgcolor
> 44
> $ gtags --conf=GREP_COLOR
> '32;44;4'
> 
> Example2: Removal of repeats of same definition
> 
> [gtags.conf]
> +-------------------------------------------
> |default:library=/usr/local/lib/gtags/exuberant-ctags.la:\
> |       :gtags_parser=C\:$library:\
> |       :gtags_parser=C++\:$library:
> 
> $ gtags --conf=gtags_parser
> C:/usr/local/lib/gtags/exuberant-ctags.la,C++:/usr/local/lib/gtags/
> exuberant-ctags.la
> 
> Is it useful?
> Is there any problem?
> 
> Regards,
> Shigio
> 
> 
> -- 
> Shigio YAMAGUCHI <[email protected]>
> PGP fingerprint: D1CB 0B89 B346 4AB6 5663  C4B6 3CA5 BBB3 57BE DDA3

-- 
  <[email protected]>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.