File tree Expand file tree Collapse file tree 3 files changed +62
-3
lines changed Expand file tree Collapse file tree 3 files changed +62
-3
lines changed Original file line number Diff line number Diff line change @@ -830,7 +830,7 @@ Option File Options
830830
831831``--optlib-dir=[+]<directory> ``
832832 Add an optlib *<directory> * to or reset the optlib path list.
833- By default, the optlib path list is empty .
833+ See "` Default optlib path list`_" about the default elements for optlib path list .
834834
835835optlib Options
836836~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -2203,6 +2203,19 @@ Preloading option files
22032203
22042204 ``*.ctags `` files in a directory are loaded in alphabetical order.
22052205
2206+ Default optlib path list
2207+ ~~~~~~~~~~~~~~~~~~~~~~~~
2208+
2209+ ``$XDG_CONFIG_HOME/ctags ``, or ``$HOME/.config/ctags `` if
2210+ ``$XDG_CONFIG_HOME `` is not defined
2211+ (on other than MS Windows)
2212+
2213+ ``$HOME/.ctags.d ``
2214+
2215+ ``$HOMEDRIVE$HOMEPATH/ctags.d `` (on MS Windows only)
2216+
2217+ These directories are parts of the optlib path list by default.
2218+ See "`Option File Options `_" about the optlib path list.
22062219
22072220SEE ALSO
22082221--------
Original file line number Diff line number Diff line change @@ -3808,14 +3808,47 @@ extern void readOptionConfiguration (void)
38083808 parseConfigurationFileOptions ();
38093809}
38103810
3811+ static stringList * optlibPathListNew (struct preloadPathElt * pathList )
3812+ {
3813+ stringList * appended = stringListNew ();
3814+
3815+ for (size_t i = 0 ; pathList [i ].path != NULL || pathList [i ].makePath != NULL ; ++ i )
3816+ {
3817+ struct preloadPathElt * elt = pathList + i ;
3818+ preloadMakePathFunc maker = elt -> makePath ;
3819+ const char * path = elt -> path ;
3820+
3821+ if (!elt -> isDirectory )
3822+ continue ;
3823+
3824+ if (elt -> stage == OptionLoadingStageCurrentDir )
3825+ continue ;
3826+
3827+ if (maker )
3828+ path = maker (elt -> path , elt -> extra );
3829+
3830+ if (path == NULL )
3831+ continue ;
3832+
3833+ vString * vpath ;
3834+ if (path == elt -> path )
3835+ vpath = vStringNewInit (path );
3836+ else
3837+ vpath = vStringNewOwn ((char * )path );
3838+ stringListAdd (appended , vpath );
3839+ }
3840+
3841+ return appended ;
3842+ }
3843+
38113844/*
38123845* Option initialization
38133846*/
38143847
38153848extern void initOptions (void )
38163849{
38173850 OptionFiles = stringListNew ();
3818- OptlibPathList = stringListNew ( );
3851+ OptlibPathList = optlibPathListNew ( preload_path_list );
38193852
38203853 verbose ("Setting option defaults\n" );
38213854 installHeaderListDefaults ();
Original file line number Diff line number Diff line change @@ -830,7 +830,7 @@ Option File Options
830830
831831``--optlib-dir=[+]<directory>``
832832 Add an optlib *<directory>* to or reset the optlib path list.
833- By default, the optlib path list is empty .
833+ See "`Default optlib path list`_" about the default elements for optlib path list .
834834
835835optlib Options
836836~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -2203,6 +2203,19 @@ Preloading option files
22032203
22042204 ``*.ctags`` files in a directory are loaded in alphabetical order.
22052205
2206+ Default optlib path list
2207+ ~~~~~~~~~~~~~~~~~~~~~~~~
2208+
2209+ ``$XDG_CONFIG_HOME/ctags``, or ``$HOME/.config/ctags`` if
2210+ ``$XDG_CONFIG_HOME`` is not defined
2211+ (on other than MS Windows)
2212+
2213+ ``$HOME/.ctags.d``
2214+
2215+ ``$HOMEDRIVE$HOMEPATH/ctags.d`` (on MS Windows only)
2216+
2217+ These directories are parts of the optlib path list by default.
2218+ See "`Option File Options`_" about the optlib path list.
22062219
22072220SEE ALSO
22082221--------
You can’t perform that action at this time.
0 commit comments