user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
* [PATCH] hlmod: update for highlight 3.51 API change
@ 2019-09-24 20:05 Alyssa Ross
  2019-09-26  1:59 ` Eric Wong
  0 siblings, 1 reply; 7+ messages in thread
From: Alyssa Ross @ 2019-09-24 20:05 UTC (permalink / raw)
  To: meta; +Cc: Alyssa Ross, Amitai Schleier

Quoting Amitai Schleier, who made this same change in ikiwiki[1],
where lots of the public-inbox highlight code comes from:

> As of 3.51, searchFile() is no longer provided in highlight's Perl
> bindings (at least on NetBSD and OS X, as built from pkgsrc). This
> leaves us falling through to getConfDir(), which has been gone
> rather longer.
>
> From highlight git, it appears searchFile() and getFiletypesConfPath()
> both originated in the 3.14 release. The latter is still available in
> 3.51, and returns the same result searchFile() used to. Switch to it.

So, this should still be compatible with the version of highlight.pm in
Debian, but add support for newer versions as well.

[1]: commit 4d06df9583e6c4145f8c6fc2fd51d7894c0b85ce

Cc: Amitai Schleier <schmonz-web-ikiwiki@schmonz.com>
---
 lib/PublicInbox/HlMod.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/PublicInbox/HlMod.pm b/lib/PublicInbox/HlMod.pm
index 36e3110..1d7a460 100644
--- a/lib/PublicInbox/HlMod.pm
+++ b/lib/PublicInbox/HlMod.pm
@@ -20,7 +20,7 @@ use PublicInbox::Hval qw(src_escape ascii_html);
 my $hl;

 sub _parse_filetypes ($) {
-	my $ft_conf = $_[0]->searchFile('filetypes.conf') or
+	my $ft_conf = $_[0]->getFiletypesConfPath('filetypes') or
 				die 'filetypes.conf not found by highlight';
 	open my $fh, '<', $ft_conf or die "failed to open($ft_conf): $!";
 	local $/;
--
2.22.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-10-08 22:00 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-24 20:05 [PATCH] hlmod: update for highlight 3.51 API change Alyssa Ross
2019-09-26  1:59 ` Eric Wong
2019-09-26 13:18   ` Konstantin Ryabitsev
2019-09-26 15:07     ` Alyssa Ross
2019-10-08 21:53     ` [PATCH] TODO: add an item for Python pygments Eric Wong
2019-10-08 22:00       ` Konstantin Ryabitsev
2019-09-26 15:08   ` [PATCH] hlmod: update for highlight 3.51 API change Alyssa Ross

Code repositories for project(s) associated with this public inbox

	https://80x24.org/public-inbox.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).