bug#5566: 23.1.92; man page header ugly on narrow terminals

Juri Linkov juri at jurta.org
Fri Feb 12 19:20:18 UTC 2010

> Here is a complicated bug that involves several packages, and produces
> "WWW::Facebook::API::^HUI^Hsn^Het^Hr..." (^H's visible too)
> on one's emacs screen.
> # su - nobody #(LC_ALL=C etc. too.)
> $ HOME=/tmp emacs-snapshot -nw
> M-x man WWW::Facebook::API::Intl (from libwww-facebook-api-perl package)
> on a wide enough terminal, gives a nice
> WWW::Facebook::API::Intl(3pm)        User Contributed Perl Documentation       WWW::Facebook::API::Intl(3pm)
> however, if the screen is only as wide as the below, this is what one sees:
> WWW::Facebook::API::^HUI^Hsn^Het^Hrl(^HC3^Hop^Hnm^Ht)^Hributed Perl Docu^H
> Similarly under X-windows. If one just uses xterm and no emacs, one gets
> WWW::Facebook::API:UserlContributed Perl DoWWW::Facebook::API::Intl(3pm)
> which at least doesn't have the visible ^H stuff.
> $ man -w WWW::Facebook::API::Friends
> /usr/share/man/man3/WWW::Facebook::API::Friends.3pm.gz
> where we see the line at question...

This looks like a bug in `man' from the package `man-db'.  When the
header line is longer than the preferred output width (defined by
`MANWIDTH' or `COLUMNS'), the header line becomes a mess where letters
from original header are interleaved with ^H characters.

This is reproducible with any sufficiently long manpage name
and a shell command like `COLUMNS=50 MAN_KEEP_FORMATTING=1
man HTML::TokeParser::Simple::Token::ProcessInstruction | cat -v`.

Emacs doesn't process such `man' output.  `Man-fontify-manpage' removes
^H's only when the character before ^H is the same as the character after ^H:

    (while (re-search-forward "\\(.\\)\\(\b+\\1\\)+" nil t)
      (replace-match "\\1")
      (put-text-property (1- (point)) (point) 'face Man-overstrike-face))

But in this case the characters before ^H and after ^H are different.

Juri Linkov

More information about the pkg-perl-maintainers mailing list