bug-global
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Universal Ctags: Don't read config files; New 'ctagsoptfile' configu


From: Olivier Certner
Subject: Re: Universal Ctags: Don't read config files; New 'ctagsoptfile' configuration variable
Date: Wed, 19 Apr 2023 14:56:32 +0200

Hi,

> Could you write a description about this variable for the
> CONFIGURATION section of gtags(1)?  Could you explain the format of
> 'ctags-gtags.conf'?

'ctags-gtags.conf' is just a configuration file for Universal Ctags. It lists 
flags accepted by the program, one per line (see ctags(1)).

See also the new text in 'gtags(1)' in the attached patch.
 
> Should we use a file? How about putting the contents of the file
> directly into a variable (may be 'ctagsopt')?

Since this Universal Ctags configuration is specific to Global, having it in 
Global's configuration file certainly makes sense.

But having the file alternative can be seen as simpler: You just have to 
copy/paste the lines you want to keep from your "normal" Universal Ctags 
configuration in the specific 'ctags-gtags.conf' (or whatever name you choose) 
and can then keep experimenting in this file without touching Global's config. 
I went with the file implementation for this reason and also because it was the 
simplest to do.

So I've kept 'ctagsoptfile' and added 'ctagsopt'. See the new attached patch: 
It adds both 'ctagsoptfile' and 'ctagsopt', allowing merging of 'ctagsopt' 
lines (with '\n') and discarding empty ones, and provides documentation for 
these new variables and also 'ctagscom' (which was not documented).

> What are '--option' and '--option-maybe'? Which command's options?

These are flags to Universal Ctags (see ctags(1)). The first makes the program 
read a configuration file and error out if no such file exists. 
'--option-maybe' can be used to ignore such errors, but I would prefer we don't 
use it.

As for the attached patch, I went with the pedestrian way of doing string and 
argument manipulations. Surely could I have used 'strbuf' or created another 
abstraction, simplifying the code (and making it less efficient; not that it 
matters in this case), but this was not my initial approach. I have very little 
time now, so I won't be able to implement and test any large changes. If you 
want to clean up the code with abstractions, you'll have to do it on your own. 
But I'm still available for questions and support.

As for tests, I tested all possible combinations, as well as Windows' argument 
preparation code this time. So the patch should be as safe as it can be. The 
only lacking verification is to compile and run the plugins on an actual 
Windows machine.

Thanks and regards.

-- 
Olivier Certner

Attachment: universal_ctags-v2.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]