On 2023/02/08 9:49, Tatsuo Ishii wrote:
I am not sure if this is good way to check if ctags supports "-e" or not.
+ then ctags --version 2>&1 | grep -- -e >/dev/null
Perhaps, "--help" might be intended rather than "--version" to check
supported options?
Yeah, that was my mistake.
Even so, ctags would have other option whose name contains
"-e" than Emacs support, so this check could end in a wrong result. Therefore,
it seems to me that it is better to check immediately if etags is available
in case that we don't have Exuberant-type ctags.
That makes sense.
Attached is the v2 patch.
Thanks for the patch!
With the patch, I got the following error when executing make_etags..
$ ./src/tools/make_etags
etags: invalid option -- 'e'
Try 'etags --help' for a complete list of options.
sort: No such file or directory
+ if [ $? != 0 -a -z "$ETAGS_EXISTS" ]
+ then echo "'ctags' does not support emacs mode and etags does not
exist" 1>&2; exit 1
+ fi
This code can be reached after "rm -f ./$TAGS_FILE" is executed in make_ctags.
But we should check whether the required program has been already installed
and exit immediately if not, before modifying anything?
This is the comment for the commit d1e2a380cb. I found that make_etags with
an invalid option reported the following usage message mentioning make_ctags
(not make_etags). Isn't this confusing?
$ ./src/tools/make_etags -a
Usage: /.../make_ctags [-e][-n]
Regards,
--
Fujii Masao
Advanced Computing Technology Center
Research and Development Headquarters
NTT DATA CORPORATION