Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ojCqb-0006GK-Ib for pgsql-hackers@arkaria.postgresql.org; Fri, 14 Oct 2022 05:03:01 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ojCqZ-0002ro-EN for pgsql-hackers@arkaria.postgresql.org; Fri, 14 Oct 2022 05:02:59 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ojCqZ-0002r9-4x for pgsql-hackers@lists.postgresql.org; Fri, 14 Oct 2022 05:02:59 +0000 Received: from ml.sraoss.co.jp ([66.11.59.17] helo=osspc26.sraoss.co.jp) by magus.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ojCqV-0000yY-K1 for pgsql-hackers@postgresql.org; Fri, 14 Oct 2022 05:02:58 +0000 Received: from sranhm.sraoss.co.jp (unknown [192.168.174.164]) by osspc26.sraoss.co.jp (Postfix) with ESMTP id 4A7222F000A2; Fri, 14 Oct 2022 14:02:35 +0900 (JST) Received: from yugon-CFSV7-1 (unknown [192.168.176.2]) by sranhm.sraoss.co.jp (Postfix) with SMTP id 7D6B9341723; Fri, 14 Oct 2022 14:02:53 +0900 (JST) Date: Fri, 14 Oct 2022 14:02:53 +0900 From: Yugo NAGATA To: Tatsuo Ishii Cc: alvherre@alvh.no-ip.org, pgsql-hackers@postgresql.org Subject: Re: make_ctags: use -I option to ignore pg_node_attr macro Message-Id: <20221014140253.ac151da048dffe0070da4d58@sraoss.co.jp> In-Reply-To: <20221013.153509.1827806601518605961.t-ishii@sranhm.sra.co.jp> References: <20221012.222603.1209235348946415695.t-ishii@sranhm.sra.co.jp> <20221012142440.u2kmre2yp6p4fyr4@alvherre.pgsql> <20221013.153509.1827806601518605961.t-ishii@sranhm.sra.co.jp> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Multipart=_Fri__14_Oct_2022_14_02_53_+0900_zMD4nVFd1MmiuZP2" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --Multipart=_Fri__14_Oct_2022_14_02_53_+0900_zMD4nVFd1MmiuZP2 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Thu, 13 Oct 2022 15:35:09 +0900 (JST) Tatsuo Ishii wrote: > > OK, that sounds good then. I would make a feature request to have a > > switch that supresses creation of these links, then. > > Ok, I have added "-n" option to make_ctags so that it skips to create > the links. > > Also I have changed make_etags so that it exec make_ctags, which seems > to be the consensus. Thank you for following up my patch. I fixed the patch to allow use both -e and -n options together. Regards, Yugo Nagata > > Best reagards, > -- > Tatsuo Ishii > SRA OSS LLC > English: http://www.sraoss.co.jp/index_en/ > Japanese:http://www.sraoss.co.jp -- Yugo NAGATA --Multipart=_Fri__14_Oct_2022_14_02_53_+0900_zMD4nVFd1MmiuZP2 Content-Type: text/x-diff; name="v5_make_ctags.patch" Content-Disposition: attachment; filename="v5_make_ctags.patch" Content-Transfer-Encoding: 7bit diff --git a/src/tools/make_ctags b/src/tools/make_ctags index 912b6fafac..8062ff2d3e 100755 --- a/src/tools/make_ctags +++ b/src/tools/make_ctags @@ -1,12 +1,37 @@ #!/bin/sh -# src/tools/make_ctags +# src/tools/make_ctags [-e] [-n] +# If -e is specified, generate tags files for emacs. +# If -n is specified, don't create symbolic links of tags file. +usage="$0 [-e][-n]" +if [ $# -gt 2 ];then + echo $usage + exit 1 +fi + +mode= +no_symlink= +tags_file=tags + +while [ $# -gt 0 ] +do + if [ $1 = "-e" ];then + mode="-e" + tags_file=TAGS + elif [ $1 = "-n" ];then + no_symlink=yes + else + echo $usage + exit 1 + fi + shift +done command -v ctags >/dev/null || \ { echo "'ctags' program not found" 1>&2; exit 1; } trap "ret=$?; rm -rf /tmp/$$; exit $ret" 0 1 2 3 15 -rm -f ./tags +rm -f ./$tags_file IS_EXUBERANT="" ctags --version 2>&1 | grep Exuberant && IS_EXUBERANT="Y" @@ -34,9 +59,17 @@ then FLAGS="--c-kinds=+dfmstuv" else FLAGS="-dt" fi +# Use -I option to ignore a macro +if [ "$IS_EXUBERANT" ] +then IGNORE_IDENTIFIES="-I pg_node_attr+" +else IGNORE_IDENTIFIES= +fi + # this is outputting the tags into the file 'tags', and appending -find `pwd`/ -type f -name '*.[chyl]' -print | - xargs ctags -a -f tags "$FLAGS" +find `pwd`/ \( -name tmp_install -prune -o -name tmp_check -prune \) \ + -o \( -name "*.[chly]" -o -iname "*makefile*" -o -name "*.mk" -o -name "*.in" \ + -o -name "*.sql" -o -name "*.p[lm]" \) -type f -print | + xargs ctags $mode -a -f $tags_file "$FLAGS" "$IGNORE_IDENTIFIES" # Exuberant tags has a header that we cannot sort in with the other entries # so we skip the sort step @@ -45,10 +78,13 @@ find `pwd`/ -type f -name '*.[chyl]' -print | if [ ! "$IS_EXUBERANT" ] then LC_ALL=C export LC_ALL - sort tags >/tmp/$$ && mv /tmp/$$ tags + sort $tags_file >/tmp/$$ && mv /tmp/$$ $tags_file fi -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 -done +# create symblink links +if [ ! "$no_symlink" ];then + 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_file "$DIR"/$tags_file + done +fi diff --git a/src/tools/make_etags b/src/tools/make_etags index 9288ef7b14..afc57e3e89 100755 --- a/src/tools/make_etags +++ b/src/tools/make_etags @@ -1,16 +1,6 @@ #!/bin/sh - # src/tools/make_etags -command -v etags >/dev/null || \ - { echo "'etags' program not found" 1>&2; exit 1; } - -rm -f ./TAGS - -find `pwd`/ -type f -name '*.[chyl]' -print | - xargs etags --append -o TAGS - -find . \( -name CVS -prune \) -o \( -name .git -prune \) -o -type d -print | -while read DIR -do [ "$DIR" != "." ] && ln -f -s `pwd`/TAGS "$DIR" -done +cdir=`dirname $0` +dir=`(cd $cdir && pwd)` +exec $dir/make_ctags -e $* --Multipart=_Fri__14_Oct_2022_14_02_53_+0900_zMD4nVFd1MmiuZP2--