From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michael Heerdegen Newsgroups: gmane.emacs.bugs Subject: bug#21012: 25.0.50; eww: last char of a line sometimes not fully visible Date: Wed, 08 Jul 2015 22:24:21 +0200 Message-ID: <87wpya5rey.fsf@web.de> References: <87twteh65g.fsf@web.de> <83d202v2m2.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1436387121 19635 80.91.229.3 (8 Jul 2015 20:25:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 8 Jul 2015 20:25:21 +0000 (UTC) Cc: 21012@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Jul 08 22:25:10 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZCvu1-00049j-Fe for geb-bug-gnu-emacs@m.gmane.org; Wed, 08 Jul 2015 22:25:09 +0200 Original-Received: from localhost ([::1]:36771 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZCvu0-0008Cz-Kb for geb-bug-gnu-emacs@m.gmane.org; Wed, 08 Jul 2015 16:25:08 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42010) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZCvtx-0008C6-KQ for bug-gnu-emacs@gnu.org; Wed, 08 Jul 2015 16:25:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZCvtu-0004AC-CM for bug-gnu-emacs@gnu.org; Wed, 08 Jul 2015 16:25:05 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:43062) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZCvtu-0004A0-9H for bug-gnu-emacs@gnu.org; Wed, 08 Jul 2015 16:25:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1ZCvtt-0000jl-U0 for bug-gnu-emacs@gnu.org; Wed, 08 Jul 2015 16:25:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Michael Heerdegen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 08 Jul 2015 20:25:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 21012 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 21012-submit@debbugs.gnu.org id=B21012.14363870732797 (code B ref 21012); Wed, 08 Jul 2015 20:25:01 +0000 Original-Received: (at 21012) by debbugs.gnu.org; 8 Jul 2015 20:24:33 +0000 Original-Received: from localhost ([127.0.0.1]:44508 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZCvtQ-0000j2-Rt for submit@debbugs.gnu.org; Wed, 08 Jul 2015 16:24:33 -0400 Original-Received: from mout.web.de ([212.227.15.3]:57337) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZCvtO-0000im-K5 for 21012@debbugs.gnu.org; Wed, 08 Jul 2015 16:24:31 -0400 Original-Received: from drachen.dragon ([2.207.84.166]) by smtp.web.de (mrweb002) with ESMTPSA (Nemesis) id 0MXYnu-1ZYUjm0X82-00WUsn; Wed, 08 Jul 2015 22:24:24 +0200 In-Reply-To: <83d202v2m2.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 08 Jul 2015 23:03:17 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-Provags-ID: V03:K0:O6XTfO8gweUVP+NHy31jQep0H3/lO5l8ROxor0vVgXDSMkfI73A rJm4VycLk4rytKj+0prYLyermEwD6YyawC0VUZ9j1JmsypytM90YbyaJ5JwiP59s9IqxrsS q1F2H9+WxC3iAsB5R5pWHYassP1OQ7cqDWoMGt8UFNzEQdwmm2fZhnfc3X5SkaRfJ62zYNy fbFwIk1day7VgBwDlp3CA== X-UI-Out-Filterresults: notjunk:1;V01:K0:7tECuc7JsSU=:vq4oLoRsBfvGOgR7+bQJIv CaSpYjYgnn3pF+wGF1d4ohYwi9JbQsa37GvYtctN9cOSqbz9I+feKfdRGTAeJEbsnWT9Pjd0E xLqLKiiYu+FLU2E7+or1TF8F2T+e1GUKxW3/Kxt2+0BqjS0+xKBm+5sq3pwNGScbMWYRjT2dM YH2+Opv0gLG6MsZEY9wHvnNTyB/Ui9FaWWDA1GWgHIs8aYI42QbVqLVD1JKtJ//Xbe5scaxsQ HOV+XCaaIBDuHGPfd+YDhDKmCNXpFYEAC/rdiU2afigji85sUdiCyahmDD5lQBfcjI7T2pPyt ejDLx5a5+Kr6ac7RJEb597BINO7tHeCgmvAvyTlo9+pSjOaP1Deow8+P7twEBL5iZboCuO9eM EhNFo5aWspmSbhFatlduvOJza71FOewrYteL9d/VN9k1u+6GazW8qtykQ7Rntz5CZqPx1o0jW Qk7TvrxSH994ky7HnMII58Bj3LZu7kJs4CGTwz6yBwngqkrOO8BGT6krGkFI0kWFmSFtAxtxR l5MwLwOfo5CzPskwhTI2wII1V+SP0JNzYlE+0neqR1EQWDdlBTZqckTAfNi4sO68ygM9+o3H1 WqQpl+eVz/1qp9XxZzS6Fn56UcN0JmYJ9+Q/J+GFtQJQ0Op/IkrDKlzQt9bvV+VPGcYRpM3cI QaRR1Z4wh3eYvg7E6vXOvXDZQypB0XnZlKYpPocP4NEWbdN7qlk1l4C4q4WwJa4/dQ4A= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.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-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:104837 Archived-At: Eli Zaretskii writes: > Is the partially-visible character always the last character on that > line, before the hard newline? >From what I saw - yes, but I'm not if "always" is correct. > > (- (window-pixel-width) (* (frame-fringe-width) 2)) > > > > is not the available width for text, it is a larger value including > > scroll bars etc. > > Do you understand why the value of frame-fringe-width is multiplied by > 2? I guess because the window is assumed to have two fringes. > I think that using window-body-width is indeed better here. It will, > for example, account for display margins. Yes, I think the author of shr just tried to reinvent it. > > --8<---------------cut here---------------start------------->8--- > > (defun shr-vertical-motion (column) > > (if (not shr-use-fonts) > > (move-to-column column) > > (unless (eolp) > > (forward-char 1)) > > (vertical-motion (cons (/ column (frame-char-width)) 0)) ; <-- here > > (unless (eolp) > > (forward-char 1)))) > > --8<---------------cut here---------------end--------------->8--- > > > > This function is used, among other places, to decide where to break > > lines in `shr-fill-line'. > > > > Probably (/ column (frame-char-width)) can be too large if you are > > unlucky. > > Sorry, I don't follow. Can you elaborate on when this could happen? Note that in the shr-use-fonts -> t case, COLUMN is in pixels. (/ column (frame-char-width)) is IMO an estimated value of "real" columns to advance. But if there are many wide characters, this can be too large. > > For testing I tried with this version: > > > > --8<---------------cut here---------------start------------->8--- > > (defun shr-vertical-motion (column) > > (if (not shr-use-fonts) > > (move-to-column column) > > (unless (eolp) > > (forward-char 1)) > > (end-of-visual-line))) > > --8<---------------cut here---------------end--------------->8--- > > > > This seems to fix this issue (together with the first change), > > I don't see how this could be right, unless you only tested it with > text that is rendered using a single font. move-to-column goes to the > [...] I think you looked at the wrong `if' branch...? What I changed was to use `end-of-visual-line', which I hope is more accurate than (vertical-motion (cons (/ column (frame-char-width)) 0)) for finding the right point for breaking the line. Michael.