Re: make_ctags: use -I option to ignore pg_node_attr macro

From: Tatsuo Ishii <ishii(at)sraoss(dot)co(dot)jp>
To: alvherre(at)alvh(dot)no-ip(dot)org
Cc: ishii(at)sraoss(dot)co(dot)jp, nagata(at)sraoss(dot)co(dot)jp, pgsql-hackers(at)postgresql(dot)org
Subject: Re: make_ctags: use -I option to ignore pg_node_attr macro
Date: 2022-10-12 13:26:03
Message-ID: 20221012.222603.1209235348946415695.t-ishii@sranhm.sra.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2022-10-12 13:26:35 Re: shadow variables - pg15 edition
Previous Message Ian Lawrence Barwick 2022-10-12 13:02:40 Re: doc: add entry for pg_get_partkeydef()