+ eval q{use highlight};
+ if (highlight::DataDir->can('new')) {
+ $data_dir=new highlight::DataDir();
+ if ( $data_dir->can('initSearchDirectories') ) {
+ # 4.0+
+ $data_dir -> initSearchDirectories("");
+ } else {
+ # pre-4.0
+ $data_dir -> searchDataDir("");
+ }
+ } else {
+ $data_dir=undef;
+ }
+
+ if (! exists $config{filetypes_conf}) {
+ if (! $data_dir ) {
+ $config{filetypes_conf}= "/etc/highlight/filetypes.conf";
+ } elsif ( $data_dir -> can('getFiletypesConfPath') ) {
+ # 3.14 +
+ $config{filetypes_conf}=
+ $data_dir -> getFiletypesConfPath("filetypes");
+ } else {
+ # 3.9 +
+ $config{filetypes_conf}=
+ $data_dir -> getConfDir() . "/filetypes.conf";
+ }
+ }
+ # note that this is only used for old versions of highlight
+ # where $data_dir will not be defined.
+ if (! exists $config{langdefdir}) {
+ $config{langdefdir}= "/usr/share/highlight/langDefs";
+
+ }
+ if (exists $config{tohighlight} && read_filetypes()) {