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: Sat, 11 Jul 2015 14:02:42 +0200 Message-ID: <87380usxzx.fsf@web.de> References: <87twteh65g.fsf@web.de> <83d202v2m2.fsf@gnu.org> <87wpya5rey.fsf@web.de> <83a8v6ukbe.fsf@gnu.org> <834mlduyz8.fsf@gnu.org> <87egkh3xl3.fsf@web.de> <83pp40blcq.fsf@gnu.org> <874mlcgoka.fsf@web.de> <83bnfkb1rs.fsf@gnu.org> <87pp40nlnj.fsf@web.de> <838uaoax9a.fsf@gnu.org> <87fv4vsxc4.fsf@web.de> <837fq7c0n6.fsf@gnu.org> <87h9pbzuq1.fsf@web.de> <834mlbbyi0.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1436616200 29498 80.91.229.3 (11 Jul 2015 12:03:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 11 Jul 2015 12:03:20 +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 Sat Jul 11 14:03:11 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 1ZDtUs-0007ht-V5 for geb-bug-gnu-emacs@m.gmane.org; Sat, 11 Jul 2015 14:03:11 +0200 Original-Received: from localhost ([::1]:47801 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZDtUs-0000ca-60 for geb-bug-gnu-emacs@m.gmane.org; Sat, 11 Jul 2015 08:03:10 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37141) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZDtUn-0000bt-Rg for bug-gnu-emacs@gnu.org; Sat, 11 Jul 2015 08:03:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZDtUk-0007Kh-LC for bug-gnu-emacs@gnu.org; Sat, 11 Jul 2015 08:03:05 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:45210) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZDtUk-0007KT-I5 for bug-gnu-emacs@gnu.org; Sat, 11 Jul 2015 08:03:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1ZDtUk-0001Cl-Bf for bug-gnu-emacs@gnu.org; Sat, 11 Jul 2015 08:03: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: Sat, 11 Jul 2015 12:03:02 +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.14366161744619 (code B ref 21012); Sat, 11 Jul 2015 12:03:02 +0000 Original-Received: (at 21012) by debbugs.gnu.org; 11 Jul 2015 12:02:54 +0000 Original-Received: from localhost ([127.0.0.1]:46656 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZDtUc-0001CR-7M for submit@debbugs.gnu.org; Sat, 11 Jul 2015 08:02:54 -0400 Original-Received: from mout.web.de ([212.227.17.11]:62686) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZDtUa-0001CD-ET for 21012@debbugs.gnu.org; Sat, 11 Jul 2015 08:02:53 -0400 Original-Received: from drachen.dragon ([109.45.61.138]) by smtp.web.de (mrweb103) with ESMTPSA (Nemesis) id 0MTy9d-1ZMWJB0EwT-00Qg7B; Sat, 11 Jul 2015 14:02:44 +0200 In-Reply-To: <834mlbbyi0.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 10 Jul 2015 22:31:35 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-Provags-ID: V03:K0:03Yp5ZHVbYGRk/csX/gnNoGBvuDuxElPduDFitnh/j+84xtKiZa gu96+BvLvgR1n0keuwtVcbyZ8TPLYRCd7qYL6ZQa/slngwQL4tgCWUwy1MkY8Kgre2QFvzB xDkDMYfryiZYrKmGDKBecHcjOH65lghG2EvMTScdvSEgqqFMuIQjxu6pCsVrpIzy3/tRlWD UImERp4IGwkrqGp+BgpAQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:Cni3ZNXMVcM=:Knb0r78o0EbfdbeXHHsYvA a9X8BgE/g5BO30URonZQJ9LOSeuXQxA5CTNSCdkHKfiEjJRbsd/5FbdW1gudd62ocBdqfWJ1b dD7tQ30+aDtmgbDe196f1Y9e7KqD4AyijNwN0lsUZV9ruyyP5BXxO58SwbuMScd3KQCLmQeb3 8CAbmvyKidjm+yNlYm5dT90jAWItN6oPF5vtCJBTPF6Cc4QKoNB2OH8BoydxNSxUvhs3frL3T HErLekBIcMsuZjNLlApMX4tlNEOBihmaQ2OEQOo1SynMC5EbSvRmn1r1Q4SfRalQeRNRw6WoN mB44o77GFt6nd5wKwP6h1z6Z3a5cbrQHpXW1mf/eqJ45Qy37xrO97GB6PFN49xW/vYNUSrWZr +ZOwq3YzaBkUww36tV8q2i3uZmgUczYLRich8DoZ+2WbpKUmQ50awwsDwUpSJIu6GOz4vdv8J 5E5i56oVWPxPnhvQwzEJAQTlg6gJsNLlmvzP1Z1zKlYHAcTNOay/m6NVi3k2YaD4Ohvx8y6aL e1Wt9KOHw71UE0H4Y/aZRZ08yDLf2tvlpxIAnUxdxTcof/pFWAhclrbsJt8Z3W+nvNs/Mrkxr 5IYWI+q3qMh4F01lxSmLPvUY4BPli1nASLXb77YgzkstwpgVWmyCtRU3nrZPJ0/MLyXanBrpp RKhj086a6GAGltdkHzUcI009XkA13UVsuBuyw5WFL4+++QQJ+DB8jcfzjoEvvuJwPXaI= 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:104909 Archived-At: --=-=-= Content-Type: text/plain Eli Zaretskii writes: > It should be possible, in principle, to write something similar to > posn-at-point that would not depend on the text being visible, or > rewrite posn-at-point to free it from this limitation, but we don't > have such a function at this time. Maybe we should. Of course would that be useful, not only for this issue. But I guess it would be a lot of work. I try now what you suggested, subtracting one more column width when calculating `shr-internal-width'. I.e., I subtract one more `frame-char-width' now. Looks good so far. I'll use it for some time and tell you what I think. So, here is what I'm testing, based on your first patch: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=shr-02.patch --- a/lisp/net/shr.el +++ b/lisp/net/shr.el @@ -222,10 +222,29 @@ DOM should be a parse tree as generated by (if (not shr-use-fonts) shr-width (* shr-width (frame-char-width)))) + ;; We need to adjust the available + ;; width for when the user disables + ;; the fringes, which will cause the + ;; display engine usurp one column for + ;; the continuation glyph. (if (not shr-use-fonts) - (- (window-width) 2) - (- (window-pixel-width) - (* (frame-fringe-width) 2)))))) + (- (window-body-width) 1 + (if (and (null shr-width) + (or (zerop + (fringe-columns 'right)) + (zerop + (fringe-columns 'left)))) + 0 + 1)) + (- (window-body-width nil t) + (* 2 (frame-char-width)) + (if (and (null shr-width) + (or (zerop + (fringe-columns 'right)) + (zerop + (fringe-columns 'left)))) + (* (frame-char-width) 2) + 0)))))) (shr-descend dom) (shr-fill-lines start (point)) (shr-remove-trailing-whitespace start (point)) @@ -439,8 +458,18 @@ size, and full-buffer size." (with-temp-buffer (let ((shr-indentation 0) (shr-start nil) - (shr-internal-width (- (window-pixel-width) - (* (frame-fringe-width) 2)))) + (shr-internal-width (- (window-body-width nil t) + (* 2 (frame-char-width)) + ;; Adjust the window width for when + ;; the user disables the fringes, + ;; which causes the display engine + ;; usurp one coplumn for the + ;; continuation glyph. + (if (and (null shr-width) + (or (zerop (fringe-columns 'right)) + (zerop (fringe-columns 'left)))) + (* (frame-char-width) 2) + 0)))) (shr-insert text) (buffer-string))))) @@ -620,7 +649,9 @@ size, and full-buffer size." ;; There's no breakable point, so we give it up. (let (found) (goto-char bp) - (unless shr-kinsoku-shorten + ;; Don't overflow the window edge, even if + ;; shr-kinsoku-shorten is nil. + (unless (or shr-kinsoku-shorten (null shr-width)) (while (setq found (re-search-forward "\\(\\c>\\)\\| \\|\\c<\\|\\c|" (line-end-position) 'move))) @@ -632,9 +663,12 @@ size, and full-buffer size." ;; Don't put kinsoku-bol characters at the beginning of a line, ;; or kinsoku-eol characters at the end of a line. (cond - (shr-kinsoku-shorten + ;; Don't overflow the window edge, even if shr-kinsoku-shorten + ;; is nil. + ((or shr-kinsoku-shorten (null shr-width)) (while (and (not (memq (preceding-char) (list ?\C-@ ?\n ? ))) - (shr-char-kinsoku-eol-p (preceding-char))) + (or (shr-char-kinsoku-eol-p (preceding-char)) + (shr-char-kinsoku-bol-p (following-char)))) (backward-char 1)) (when (setq failed (<= (point) start)) ;; There's no breakable point that doesn't violate kinsoku, --=-=-= Content-Type: text/plain Thanks, Michael. --=-=-=--