···1-Add the -m option to man's command line to augment the list of paths
2-searched by man. The string "OUT" must be substituted with chawan's $out
3-path after patching.
4The required -m option is only available in the mandoc implementation.
5---- a/adapter/protocol/man
6-+++ b/adapter/protocol/man
7-@@ -75,7 +75,7 @@ EOF
8-9- $section =~ s:([^-\w\200-\377.,])::g;
10- $man =~ s:([^-\w\200-\377.,])::g;
11-- open(F, "GROFF_NO_SGR=1 MAN_KEEP_FORMATTING=1 $MAN $section $man 2> /dev/null |");
12-+ open(F, "GROFF_NO_SGR=1 MAN_KEEP_FORMATTING=1 $MAN -m OUT/share/man $section $man 2> /dev/null |");
13- }
1415- $ok = 0;
000000
···1+Add the -m option to man's command line to augment the list of paths searched by man.
002The required -m option is only available in the mandoc implementation.
3+--- a/adapter/protocol/man.nim
4++++ b/adapter/protocol/man.nim
5+@@ -264,7 +264,7 @@ proc myOpen(cmd: string): tuple[ofile, efile: File] =
00000067+ proc doMan(man, keyword, section: string) =
8+ let sectionOpt = if section == "": "" else: ' ' & quoteShellPosix(section)
9+ let cmd = "MANCOLOR=1 GROFF_NO_SGR=1 MAN_KEEP_FORMATTING=1 " &
10+- man & sectionOpt & ' ' & quoteShellPosix(keyword)
11++ man & sectionOpt & " -m @out@ " & quoteShellPosix(keyword)
12+ let (ofile, efile) = myOpen(cmd)
13+ if ofile == nil: