From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#5566: 23.1.92; man page header ugly on narrow terminals Date: Fri, 12 Feb 2010 23:57:34 +0200 Organization: JURTA Message-ID: <87d40aw20h.fsf@mail.jurta.org> References: <87tytn621v.fsf@jidanni.org> <87ljeyxo47.fsf@mail.jurta.org> <20100212205915.GU4484@riva.ucam.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1266013362 7616 80.91.229.12 (12 Feb 2010 22:22:42 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 12 Feb 2010 22:22:42 +0000 (UTC) Cc: 5566@debbugs.gnu.org, libwww-facebook-api-perl@packages.debian.org, rfrancoise@debian.org, man-db@packages.debian.org, jidanni@jidanni.org To: Colin Watson Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Feb 12 23:22:38 2010 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Ng3uH-0008DB-RO for geb-bug-gnu-emacs@m.gmane.org; Fri, 12 Feb 2010 23:22:38 +0100 Original-Received: from localhost ([127.0.0.1]:34727 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ng3uH-0004Qm-6K for geb-bug-gnu-emacs@m.gmane.org; Fri, 12 Feb 2010 17:22:37 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Ng3uD-0004Qa-7R for bug-gnu-emacs@gnu.org; Fri, 12 Feb 2010 17:22:33 -0500 Original-Received: from [140.186.70.92] (port=55495 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ng3uC-0004QF-CU for bug-gnu-emacs@gnu.org; Fri, 12 Feb 2010 17:22:32 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Ng3uB-0008Hi-AY for bug-gnu-emacs@gnu.org; Fri, 12 Feb 2010 17:22:32 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:56252) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Ng3uB-0008He-7D for bug-gnu-emacs@gnu.org; Fri, 12 Feb 2010 17:22:31 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1Ng3YR-0005PN-R4; Fri, 12 Feb 2010 17:00:03 -0500 X-Loop: bug-gnu-emacs@gnu.org Resent-From: Juri Linkov Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 12 Feb 2010 22:00:03 +0000 Resent-Message-ID: Resent-Sender: bug-gnu-emacs@gnu.org X-Emacs-PR-Message: followup 5566 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 5566-submit@debbugs.gnu.org id=B5566.126601199220766 (code B ref 5566); Fri, 12 Feb 2010 22:00:03 +0000 Original-Received: (at 5566) by debbugs.gnu.org; 12 Feb 2010 21:59:52 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Ng3YF-0005Ot-HZ for submit@debbugs.gnu.org; Fri, 12 Feb 2010 16:59:51 -0500 Original-Received: from smtp-out4.starman.ee ([85.253.0.6] helo=mx2.starman.ee) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Ng3Xz-0005Og-HY for 5566@debbugs.gnu.org; Fri, 12 Feb 2010 16:59:50 -0500 X-Virus-Scanned: by Amavisd-New at mx2.starman.ee Original-Received: from mail.starman.ee (82.131.93.172.cable.starman.ee [82.131.93.172]) by mx2.starman.ee (Postfix) with ESMTP id E87CC3F40DC; Fri, 12 Feb 2010 23:59:27 +0200 (EET) In-Reply-To: <20100212205915.GU4484@riva.ucam.org> (Colin Watson's message of "Fri, 12 Feb 2010 20:59:15 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.92 (x86_64-pc-linux-gnu) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Fri, 12 Feb 2010 17:00:03 -0500 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:35075 Archived-At: >> 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. > > As I mentioned before, emacs could improve its output and make it more > consistent with typical terminal emulators by displaying X^HY as Y when > X != Y. >From your explanation I gather that for legacy reasons it's unlikely that the groff's output will be fixed any time soon. So below is a patch for man.el that removes these ^H: === modified file 'lisp/man.el' --- lisp/man.el 2010-02-11 20:57:10 +0000 +++ lisp/man.el 2010-02-12 21:56:49 +0000 @@ -1105,6 +1105,11 @@ (defun Man-fontify-manpage () (while (re-search-forward "[-|]\\(\b[-|]\\)+" nil t) (replace-match "+") (put-text-property (1- (point)) (point) 'face 'bold)) + ;; When the header is longer than the manpage name, groff tries to + ;; condense it to a shorter line interspered with ^H. Remove ^H with + ;; their preceding chars (but don't put Man-overstrike-face). (Bug#5566) + (goto-char (point-min)) + (while (re-search-forward ".\b" nil t) (backward-delete-char 2)) (goto-char (point-min)) ;; Try to recognize common forms of cross references. (Man-highlight-references) @@ -1192,6 +1197,11 @@ (defun Man-cleanup-manpage (&optional in )) (goto-char (point-min)) (while (re-search-forward "[-|]\\(\b[-|]\\)+" nil t) (replace-match "+")) + ;; When the header is longer than the manpage name, groff tries to + ;; condense it to a shorter line interspered with ^H. Remove ^H with + ;; their preceding chars (but don't put Man-overstrike-face). (Bug#5566) + (goto-char (point-min)) + (while (re-search-forward ".\b" nil t) (backward-delete-char 2)) (Man-softhyphen-to-minus) (message "%s man page cleaned up" Man-arguments)) -- Juri Linkov http://www.jurta.org/emacs/