- if (exists $config{tohighlight}) {
- foreach my $file (split /, /, $config{tohighlight}) {
+ eval q{use highlight};
+ if (highlight::DataDir->can('new')) {
+ $data_dir=new highlight::DataDir();
+ $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('searchFile') ) {
+ # 3.18 +
+ $config{filetypes_conf}=
+ $data_dir -> searchFile("filetypes.conf");
+ } 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()) {
+ foreach my $file (split ' ', $config{tohighlight}) {