workaround broken groff man page config

Fixes #2673
This commit is contained in:
Kurtis Rader 2016-10-19 13:35:30 -07:00
parent 3eb7a8fa09
commit 345950ac1b
3 changed files with 19 additions and 2 deletions

View File

@ -650,6 +650,7 @@ install-force: all install-translations | show-datadir show-sysconfdir show-extr
$v $(INSTALL) -m 755 -d $(DESTDIR)$(datadir)/fish
$v $(INSTALL) -m 755 -d $(DESTDIR)$(datadir)/fish/completions
$v $(INSTALL) -m 755 -d $(DESTDIR)$(datadir)/fish/functions
$v $(INSTALL) -m 755 -d $(DESTDIR)$(datadir)/fish/groff
$v $(INSTALL) -m 755 -d $(DESTDIR)$(datadir)/fish/man/man1
$v $(INSTALL) -m 755 -d $(DESTDIR)$(datadir)/fish/tools
$v $(INSTALL) -m 755 -d $(DESTDIR)$(datadir)/fish/tools/web_config
@ -674,6 +675,7 @@ install-force: all install-translations | show-datadir show-sysconfdir show-extr
$(INSTALL) -m 644 $$i $(DESTDIR)$(datadir)/fish/functions/; \
done;
@echo "Installing $(bo)man pages$(sgr0)";
$v $(INSTALL) -m 644 share/groff/* $(DESTDIR)$(datadir)/fish/groff/
$v for i in $(wildcard share/man/man1/*.1); do \
$(INSTALL) -m 644 $$i $(DESTDIR)$(datadir)/fish/man/man1/; \
done;

View File

@ -39,10 +39,11 @@ function __fish_print_help --description "Print help message for the specified f
set cols (math $cols - 4) # leave a bit of space on the right
set rLL -rLL=$cols[1]n
end
set -lx GROFF_TMAC_PATH $__fish_datadir/groff
if test -e "$__fish_datadir/man/man1/$item.1"
set help (nroff -man -c -t $rLL "$__fish_datadir/man/man1/$item.1" ^/dev/null)
set help (nroff -c -man -mfish -t $rLL "$__fish_datadir/man/man1/$item.1" ^/dev/null)
else if test -e "$__fish_datadir/man/man1/$item.1.gz"
set help (gunzip -c "$__fish_datadir/man/man1/$item.1.gz" ^/dev/null | nroff -man -c -t $rLL ^/dev/null)
set help (gunzip -c "$__fish_datadir/man/man1/$item.1.gz" ^/dev/null | nroff -c -man -mfish -t $rLL ^/dev/null)
end
# The original implementation trimmed off the top 5 lines and bottom 3 lines

14
share/groff/fish.tmac Normal file
View File

@ -0,0 +1,14 @@
.\" This is needed on systems that ship with groff versions older than 1.20;
.\" such as macOS up thru Sierra (10.12). See fish issue #2673.
.\"
.\" For UTF-8, map some characters conservatively for the sake
.\" of easy cut and paste.
.
.if '\*[.T]'utf8' \{\
. rchar \- - ' `
.
. char \- \N'45'
. char - \N'45'
. char ' \N'39'
. char ` \N'96'
.\}