From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#31196: 27.0.50; shr sometimes doesn't break lines as it should Date: Tue, 17 Apr 2018 21:25:35 +0300 Message-ID: <834lk93d28.fsf@gnu.org> References: <87sh7trikw.fsf@mouse.gnus.org> <87muy1rcid.fsf@mouse.gnus.org> <837ep53fdj.fsf@gnu.org> <87604praor.fsf@mouse.gnus.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1523989451 7708 195.159.176.226 (17 Apr 2018 18:24:11 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 17 Apr 2018 18:24:11 +0000 (UTC) Cc: 31196@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Apr 17 20:24:06 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 1f8VGw-0001ue-3l for geb-bug-gnu-emacs@m.gmane.org; Tue, 17 Apr 2018 20:24:06 +0200 Original-Received: from localhost ([::1]:54649 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f8VJ2-0001Th-PN for geb-bug-gnu-emacs@m.gmane.org; Tue, 17 Apr 2018 14:26:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60348) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f8VIs-0001Su-Ag for bug-gnu-emacs@gnu.org; Tue, 17 Apr 2018 14:26:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f8VIo-0007R1-9t for bug-gnu-emacs@gnu.org; Tue, 17 Apr 2018 14:26:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:49915) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f8VIo-0007Qj-5d for bug-gnu-emacs@gnu.org; Tue, 17 Apr 2018 14:26:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1f8VIn-0002IS-Sa for bug-gnu-emacs@gnu.org; Tue, 17 Apr 2018 14:26:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 17 Apr 2018 18:26:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 31196 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 31196-submit@debbugs.gnu.org id=B31196.15239895478809 (code B ref 31196); Tue, 17 Apr 2018 18:26:01 +0000 Original-Received: (at 31196) by debbugs.gnu.org; 17 Apr 2018 18:25:47 +0000 Original-Received: from localhost ([127.0.0.1]:57812 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f8VIW-0002Hx-4T for submit@debbugs.gnu.org; Tue, 17 Apr 2018 14:25:47 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:40867) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f8VIP-0002Hg-KH for 31196@debbugs.gnu.org; Tue, 17 Apr 2018 14:25:41 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f8VIF-00075I-IG for 31196@debbugs.gnu.org; Tue, 17 Apr 2018 14:25:32 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:50792) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f8VIF-00075C-EY; Tue, 17 Apr 2018 14:25:27 -0400 Original-Received: from [176.228.60.248] (port=2814 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1f8VIE-0005M4-RU; Tue, 17 Apr 2018 14:25:27 -0400 In-reply-to: <87604praor.fsf@mouse.gnus.org> (message from Lars Ingebrigtsen on Tue, 17 Apr 2018 19:43:00 +0200) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] 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:145508 Archived-At: > From: Lars Ingebrigtsen > Cc: 31196@debbugs.gnu.org > Date: Tue, 17 Apr 2018 19:43:00 +0200 > > >> (- (window-body-width nil t) > >> (* 2 (frame-char-width)) > >> (if (and (null shr-width) > >> (not (shr--have-one-fringe-p))) > >> (* (frame-char-width) 2) > >> 0)) > >> > >> This kludge is how shr computes how many pixels the window has > >> horizontally. > > > > Why is that a kludge? > > Well, perhaps not a kludge, but very complicated for something you'd > think would be a metric that's more easily available. The metric is indeed easily available: that's what window-body-width returns. But how can it know what will you do with the metric? The fact that you want to account for one or two fringes etc. is something specific to the application, no? > And it seems to be 1 pixel wrong. :-) Is it wrong, or are you counting pixels as in 0, 1, ... N, assuming that the Nth pixel is still in the window?