Date: Tue, 8 Nov 2016 09:17:53 +0000 From: Jonathan de Boyne Pollard <J.deBoynePollard-newsgroups@NTLWorld.com> To: FreeBSD Hackers <freebsd-hackers@freebsd.org>, NetBSD Users <netbsd-users@NetBSD.org> Subject: Re: Improved manual page for ul(1) Message-ID: <ef226887-41c6-f803-e2c1-ee7f7c274c1f@NTLWorld.com> In-Reply-To: <87e90ef8-05d2-1480-47ce-cc228fb3fd36@NTLWorld.com> References: <c576068d-3aac-596c-ae7b-d3c855e2a88b@NTLWorld.com> <20161106190144.GL91607@kduck.kaduk.org> <87e90ef8-05d2-1480-47ce-cc228fb3fd36@NTLWorld.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Jonathan de Boyne Pollard: > And more interesting is whether less could be fixed to make groff's > overstrikes work. Or groff fixed to not need overstrikes for things > that can be done in Unicode ... > It turns out that this is the man command limiting things. Again. It's hardwiring -Tascii even if it detects a UTF-8 character locale. I'm experimenting with this preliminary patch, applied on top of the patch at http://jdebp.eu./Softwares/nosh/italics-in-manuals.html#FreeBSD . The preliminary results are encouraging, although I haven't yet tried an ISO8859-1 locale on a Latin-1 terminal. A UTF-8 locale produces Unicode bullets on a UTF-8 terminal, and an ASCII locale produces the old overstrikes on an ASCII terminal. OpenBSD's man actually supports a -T option outright. That's also worth thinking about. --- usr.bin/man/man.sh.patch1 2016-05-16 14:26:03.474372847 +0100 +++ usr.bin/man/man.sh 2016-11-08 08:40:50.406495179 +0000 @@ -316,23 +316,23 @@ # device flag (-T) we have to pass to eqn(1) and groff(1). Then, # setup the pipeline of commands based on the user's request. + # I don't pretend to know this; I'm just copying from the + # previous version of man(1). + case "$man_charset" in + KOI8-R) nroff_dev="koi8-r" ;; + ISO8859-1) nroff_dev="latin1" ;; + ISO8859-15) nroff_dev="latin1" ;; + UTF-8) nroff_dev="utf8" ;; + *) nroff_dev="ascii" ;; + esac + + NROFF="$NROFF -T$nroff_dev" + EQN="$EQN -T$nroff_dev" + # If the manpage is from a particular charset, we need to setup nroff # to properly output for the correct device. case "${manpage}" in *.${man_charset}/*) - # I don't pretend to know this; I'm just copying from the - # previous version of man(1). - case "$man_charset" in - KOI8-R) nroff_dev="koi8-r" ;; - ISO8859-1) nroff_dev="latin1" ;; - ISO8859-15) nroff_dev="latin1" ;; - UTF-8) nroff_dev="utf8" ;; - *) nroff_dev="ascii" ;; - esac - - NROFF="$NROFF -T$nroff_dev" - EQN="$EQN -T$nroff_dev" - # Iff the manpage is from the locale and not just the charset, # then we need to define the locale string. case "${manpage}" in @@ -351,9 +351,7 @@ eval "$tool=\${${tool}_$l:-\$$tool}" done ;; - *) NROFF="$NROFF -Tascii" - EQN="$EQN -Tascii" - ;; + *) ;; esac if [ -z "$MANCOLOR" ] && [ -z "$MANITALIC" ]; then
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?ef226887-41c6-f803-e2c1-ee7f7c274c1f>