Re: make_ctags: use -I option to ignore pg_node_attr macro - Mailing list pgsql-hackers
From | Tatsuo Ishii |
---|---|
Subject | Re: make_ctags: use -I option to ignore pg_node_attr macro |
Date | |
Msg-id | 20221012.222603.1209235348946415695.t-ishii@sranhm.sra.co.jp Whole thread Raw |
In response to | Re: make_ctags: use -I option to ignore pg_node_attr macro (Alvaro Herrera <alvherre@alvh.no-ip.org>) |
Responses |
Re: make_ctags: use -I option to ignore pg_node_attr macro
Re: make_ctags: use -I option to ignore pg_node_attr macro Re: make_ctags: use -I option to ignore pg_node_attr macro |
List | pgsql-hackers |
>> I tried to apply the v2 patch approach to make_etags but noticed that >> make_ctags and make_etags have quite a few duplicate codes, that would >> bring maintenance headache. I think we could merge make_etags into >> make_ctags, then add "-e" option (or whatever) to make_ctags so that >> it generates tags files for emacs if the option is specified. > > If we're going to do this, then I suggest that make_etags should become > a symlink to make_ctags, and behave as if -e is given when called under > that name. What I had in my mind was making make_etags a script just exec make_ctags (with -e option). But I don't have strong preference. Symlink is ok for me too. >> +tags_file=tags > >> +rm -f ./$tags_file > > I think $tags_file should include the leading ./ bit, to reduce > confusion. Ok. > However ... hmm ... > >> find . \( -name 'CVS' -prune \) -o \( -name .git -prune \) -o -type d -print | >> while read DIR >> -do [ "$DIR" != "." ] && ln -f -s `echo "$DIR" | sed 's;/[^/]*;/..;g'`/tags "$DIR"/tags >> +do [ "$DIR" != "." ] && ln -f -s `echo "$DIR" | sed 's;/[^/]*;/..;g'`/$tags_file "$DIR"/$tags_file >> done > > ... does this create a tags symlink on each directory? This seems > strange to me, I don't know the original author's intention for this but I think it makes use of the tag file in emacs a little bit easier. Emacs confirms for the first time the default location of tags file under the same directory where the source file resides. I can just hit return key if there's a symlink of tags. If we do not create the symlink, we have to specify the directory where the tags file was originally created, which is a little bit annoying. > but I admit the hack I keep in my .vim/vimrc looks even > more strange: > > : let $CSCOPE_DB=substitute(getcwd(), "^\\(.*/pgsql/source/ [^/]*\\)/.*", "\\1", "") > : let &tags=substitute(getcwd(), "^\\(.*/pgsql/source/[^/]*\\)/.*", "\\1", "") . "/tags" > > Not sure which is worse. Having dozens of identically named symlinks > doesn't strike me as a great arrangement though. I would definitely not > use make_ctags if this is unavoidable. I see both scripts do likewise > currently. Well, I often visit different tags file for different development projects (for example Pgpool-II) and I don't want to have fixed location of tags file in emacs setting. For this reason make_etags's approach is acceptable for me. Best reagards, -- Tatsuo Ishii SRA OSS LLC English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp
pgsql-hackers by date: