From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#32536: displayed width of man pages Date: Thu, 27 Dec 2018 22:54:44 +0200 Organization: LINKOV.NET Message-ID: <87o9964rmz.fsf@mail.linkov.net> References: <878t4t70zb.fsf@himinbjorg.adminart.net> <87imzfj1he.fsf@mail.linkov.net> <83muor6khd.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1545945815 23466 195.159.176.226 (27 Dec 2018 21:23:35 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 27 Dec 2018 21:23:35 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) Cc: 32536@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Dec 27 22:23:31 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gcd7q-00061B-Ip for geb-bug-gnu-emacs@m.gmane.org; Thu, 27 Dec 2018 22:23:30 +0100 Original-Received: from localhost ([127.0.0.1]:55315 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gcd9x-0000br-0A for geb-bug-gnu-emacs@m.gmane.org; Thu, 27 Dec 2018 16:25:41 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:48513) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gcd9N-0008V5-GO for bug-gnu-emacs@gnu.org; Thu, 27 Dec 2018 16:25:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gcd9K-00009D-9X for bug-gnu-emacs@gnu.org; Thu, 27 Dec 2018 16:25:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:54841) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gcd9K-00008g-2z for bug-gnu-emacs@gnu.org; Thu, 27 Dec 2018 16:25:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gcd9J-0005gX-L9 for bug-gnu-emacs@gnu.org; Thu, 27 Dec 2018 16:25:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 27 Dec 2018 21:25:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 32536 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 32536-submit@debbugs.gnu.org id=B32536.154594586121755 (code B ref 32536); Thu, 27 Dec 2018 21:25:01 +0000 Original-Received: (at 32536) by debbugs.gnu.org; 27 Dec 2018 21:24:21 +0000 Original-Received: from localhost ([127.0.0.1]:39574 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gcd8f-0005ep-2E for submit@debbugs.gnu.org; Thu, 27 Dec 2018 16:24:21 -0500 Original-Received: from cichlid.maple.relay.mailchannels.net ([23.83.214.36]:29481) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gcd8c-0005ee-Je for 32536@debbugs.gnu.org; Thu, 27 Dec 2018 16:24:20 -0500 X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 59B855E3324; Thu, 27 Dec 2018 21:24:17 +0000 (UTC) Original-Received: from pdx1-sub0-mail-a68.g.dreamhost.com (unknown [100.96.30.62]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 186AF5E36BE; Thu, 27 Dec 2018 21:24:17 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from pdx1-sub0-mail-a68.g.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.16.2); Thu, 27 Dec 2018 21:24:17 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Slimy-Zesty: 46fb69236290c352_1545945857237_2329731907 X-MC-Loop-Signature: 1545945857237:3536680676 X-MC-Ingress-Time: 1545945857236 Original-Received: from pdx1-sub0-mail-a68.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a68.g.dreamhost.com (Postfix) with ESMTP id B6C267FD0D; Thu, 27 Dec 2018 13:24:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=linkov.net; bh=DHXeFEwysx15A3AjyiNjdEMnSH8=; b= j0sbYtwXzo7d4qIhPkkO06SVlUjwlDQ1XGsFAkRRP752dzfwEELKA5m/Z6tjnF3J ldguzdDdkscLkkR8yuJW+Ah9GKtB6Dbe/zhpVDP30SLbu65DCWiZb1SVKKkrfq8/ 7tRpwCmU8i77RRAOm5On/BcNOB5hR54rPbtZFTzs1mY= Original-Received: from mail.jurta.org (m91-129-108-193.cust.tele2.ee [91.129.108.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a68.g.dreamhost.com (Postfix) with ESMTPSA id 562D17FCFE; Thu, 27 Dec 2018 13:24:14 -0800 (PST) X-DH-BACKEND: pdx1-sub0-mail-a68 In-Reply-To: <83muor6khd.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 27 Dec 2018 17:46:22 +0200") X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: -100 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedtledrtdefgdekkecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucggtfgfnhhsuhgsshgtrhhisggvpdfftffgtefojffquffvnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvffuohhfffgjkfgfgggtsehttdertddtredtnecuhfhrohhmpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqnecukfhppeeluddruddvledruddtkedrudelfeenucfrrghrrghmpehmohguvgepshhmthhppdhhvghlohepmhgrihhlrdhjuhhrthgrrdhorhhgpdhinhgvthepledurdduvdelrddutdekrdduleefpdhrvghtuhhrnhdqphgrthhhpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqpdhmrghilhhfrhhomhepjhhurhhisehlihhnkhhovhdrnhgvthdpnhhrtghpthhtohepvghlihiisehgnhhurdhorhhgnecuvehluhhsthgvrhfuihiivgeptd X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 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: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:153930 Archived-At: >> +(defcustom Man-width-min 40 >> [...] >> +If the calculated width is smaller than the minimum width, the value >> +of this variable has no effect. >> [...] >> +(defcustom Man-width-max 80 >> [...] >> +If the calculated width is smaller than the maximum width, the value >> +of this variable has no effect. > > I suspect some typo(s) in these doc strings, perhaps due to > copy/pasta, because the penultimate sentence of each of them makes no > sense to me, certainly when taken together with the other doc string. > If I'm wrong, and there's no error here, please explain what you > meant. Yes, one of them is wrong. The doc string of Man-width-min should be changed to: If the calculated width is larger than the minimum width, the value of this variable has no effect. >> +(defun Man-columns () >> + (let ((width (cond >> + ((and (integerp Man-width) (> Man-width 0)) >> + Man-width) >> + (Man-width >> + (let ((window (get-buffer-window nil t))) >> + (frame-width (and window (window-frame window))))) >> + (t >> + (window-width (get-buffer-window nil t)))))) >> + (when (and (integerp Man-width-max) >> + (> Man-width-max 0)) >> + (setq width (min width Man-width-max))) >> + (when (and (integerp Man-width-min) >> + (> Man-width-min 0)) >> + (setq width (max width Man-width-min))) >> + width)) > > Careful here: both window-width (why not use its official name, btw?) Sorry, I don't understand what is the official name? > and frame-width are insensitive to the size of the font used to > display the man page: they both measure in "canonical" column units. > Maybe this is not a significant problem (and I realize the old code > also worked like that), but perhaps the doc strings of the two new > options should mention this fact, lest the user will be surprised. > >> + (setenv "COLUMNS" (number-to-string Man-columns))) > > Here, for example, the 'man' program will interpret COLUMNS at face > value, and will produce lines of that many characters; but if the size > of thefont used to display the man page is significantly different > from the frame's default font, those lines might be wider or narrower > than the window/frame. It seems this calculation works only for monospace fonts. > Finally, I think this warrants a NEWS entry and perhaps also an update > for the manual. Will do after the final patch.