From owner-freebsd-hackers@freebsd.org Tue Nov 8 09:18:19 2016 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2BC98C36D3D for ; Tue, 8 Nov 2016 09:18:19 +0000 (UTC) (envelope-from j.deboynepollard-newsgroups@ntlworld.com) Received: from know-smtprelay-omc-1.server.virginmedia.net (know-smtprelay-omc-1.server.virginmedia.net [80.0.253.65]) by mx1.freebsd.org (Postfix) with ESMTP id 95CF0F1B for ; Tue, 8 Nov 2016 09:18:17 +0000 (UTC) (envelope-from j.deboynepollard-newsgroups@ntlworld.com) Received: from [192.168.1.100] ([86.10.211.13]) by know-smtprelay-1-imp with bizsmtp id 5MJG1u0090HtmFq01MJGLk; Tue, 08 Nov 2016 09:18:16 +0000 X-Originating-IP: [86.10.211.13] X-Spam: 0 X-Authority: v=2.1 cv=beuWK77B c=1 sm=1 tr=0 a=SB7hr1IvJSWWr45F2gQiKw==:117 a=SB7hr1IvJSWWr45F2gQiKw==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=N659UExz7-8A:10 a=2rVjqWD_AAAA:8 a=pMdQXerZ3W1E7PntnhwA:9 a=pILNOxqGKmIA:10 a=IJuWuSD6ecgA:10 a=-FEs8UIgK8oA:10 a=NWVoK91CQyQA:10 a=ULaUcM2Ibn9MdPUUwucP:22 Subject: Re: Improved manual page for ul(1) To: FreeBSD Hackers , NetBSD Users References: <20161106190144.GL91607@kduck.kaduk.org> <87e90ef8-05d2-1480-47ce-cc228fb3fd36@NTLWorld.com> From: Jonathan de Boyne Pollard Message-ID: Date: Tue, 8 Nov 2016 09:17:53 +0000 User-Agent: Mozilla/5.0 (Windows NT 6.0; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: <87e90ef8-05d2-1480-47ce-cc228fb3fd36@NTLWorld.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Nov 2016 09:18:19 -0000 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