From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 Date: Fri, 6 Mar 2015 13:56:04 +0100 Message-ID: From: Giacomo Tesio To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>, 9front@9front.org Content-Type: multipart/alternative; boundary=001a1134598a0930be05109e35bb Subject: [9fans] col.c: one line fix for variable-width font Topicbox-Message-UUID: 4844b766-ead9-11e9-9d60-3106f5b1d025 --001a1134598a0930be05109e35bb Content-Type: text/plain; charset=UTF-8 I gave a look at col.c and found a better fix for the tabs issue. We simply need that col check for the previous char being a space, before adding any tab. That is, at /sys/src/cmd/col.c:251 replace if ((++ncp & 7) == 0 && !xflag) { with if ((++ncp & 7) == 0 && !xflag && *(p-2) == ' ') { This is a better fix that redefining col in /rc/bin/man since this way col correctly replace spaces with tabs when appropriate. It just stops to replace single spaces at positions multiple of 8 with tabs. Giacomo PS: col.c ignores $tabstop. This could be something to add in the man page. Or to fix in col.c (a really trivial fix, btw) --001a1134598a0930be05109e35bb Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
I gave a look at col.c and found a better fix for the tabs= issue.

We simply need that col check for the previous c= har being a space, before adding any tab. That is, at /sys/src/cmd/col.c:25= 1 replace

if ((++ncp & 7) =3D=3D 0 && = !xflag) {

with

if ((+= +ncp & 7) =3D=3D 0 && !xflag && *(p-2) =3D=3D ' = 9;) {=C2=A0

This is a better fix that redefining c= ol in /rc/bin/man since this way col correctly replace spaces with tabs whe= n appropriate. It just stops to replace single spaces at positions multiple= of 8 with tabs.


Giacomo
= PS: col.c ignores $tabstop. This could be something to add in the man page.= Or to fix in col.c (a really trivial fix, btw)
--001a1134598a0930be05109e35bb--