From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#22250: 25.0.50; Eww fails to break RTL paragraph Date: Thu, 31 Dec 2015 17:26:11 +0200 Message-ID: <83h9iybpws.fsf@gnu.org> References: <8760zj3dvr.fsf@justinian.i-did-not-set--mail-host-address--so-tickle-me> <83twn3g0ac.fsf@gnu.org> <8760zjbi9s.fsf@justinian.turtle-trading.net> <83k2nzfdt9.fsf@gnu.org> <87twn2il10.fsf@justinian.turtle-trading.net> <83bn9afqfz.fsf@gnu.org> <87k2nyigmh.fsf@justinian.turtle-trading.net> <8360zifmsk.fsf@gnu.org> <8737umi7xw.fsf@justinian.turtle-trading.net> <83io3hdwwg.fsf@gnu.org> <87a8ot9dqb.fsf@justinian.turtle-trading.net> <83poxpc6hz.fsf@gnu.org> <87y4cc996q.fsf@justinian.turtle-trading.net> <83a8ordg0d.fsf@gnu.org> <87io3fptzl.fsf@justinian.turtle-trading.net> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1451575587 2402 80.91.229.3 (31 Dec 2015 15:26:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 31 Dec 2015 15:26:27 +0000 (UTC) Cc: 22250@debbugs.gnu.org, larsi@gnus.org To: Benjamin Riefenstahl Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Dec 31 16:26:16 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 1aEf7I-00045T-Eq for geb-bug-gnu-emacs@m.gmane.org; Thu, 31 Dec 2015 16:26:16 +0100 Original-Received: from localhost ([::1]:56036 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aEf7E-0002tF-MQ for geb-bug-gnu-emacs@m.gmane.org; Thu, 31 Dec 2015 10:26:12 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37209) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aEf78-0002sY-I3 for bug-gnu-emacs@gnu.org; Thu, 31 Dec 2015 10:26:10 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aEf74-0005lL-R3 for bug-gnu-emacs@gnu.org; Thu, 31 Dec 2015 10:26:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:44271) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aEf74-0005lH-NL for bug-gnu-emacs@gnu.org; Thu, 31 Dec 2015 10:26:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84) (envelope-from ) id 1aEf74-0001pD-GQ for bug-gnu-emacs@gnu.org; Thu, 31 Dec 2015 10:26:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 31 Dec 2015 15:26:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22250 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: confirmed Original-Received: via spool by 22250-submit@debbugs.gnu.org id=B22250.14515755617008 (code B ref 22250); Thu, 31 Dec 2015 15:26:02 +0000 Original-Received: (at 22250) by debbugs.gnu.org; 31 Dec 2015 15:26:01 +0000 Original-Received: from localhost ([127.0.0.1]:51873 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aEf70-0001ot-6w for submit@debbugs.gnu.org; Thu, 31 Dec 2015 10:26:01 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:46163) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aEf6v-0001od-4q for 22250@debbugs.gnu.org; Thu, 31 Dec 2015 10:25:56 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aEf6l-0005e8-Bv for 22250@debbugs.gnu.org; Thu, 31 Dec 2015 10:25:48 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:59294) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aEf6Z-0005dB-1f; Thu, 31 Dec 2015 10:25:31 -0500 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2261 helo=HOME-C4E4A596F7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1aEf6Y-0003mm-Ad; Thu, 31 Dec 2015 10:25:30 -0500 In-reply-to: <87io3fptzl.fsf@justinian.turtle-trading.net> (message from Benjamin Riefenstahl on Wed, 30 Dec 2015 21:22:06 +0100) 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-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:111061 Archived-At: > From: Benjamin Riefenstahl > Cc: 22250@debbugs.gnu.org, larsi@gnus.org > Date: Wed, 30 Dec 2015 21:22:06 +0100 > > > I'll need a clear test case to look into this. > > Try the attached patch. It reverts parts of Lars' fix and adds a debug > message to shr-vertical-motion. > > For a base-line test, execute > > ./emacs -Q -nw --eval '(eww "https://odoacer.turtle-trading.net/abc-abc-abc-abc-abc-abc-abc-abc-abc-abc-abc-abc-abc-abc-test.html")' > > Once the page is loaded, press "G RET". This second load reproduces the > problem for me. I get this protocol in the message buffer: > > Contacting host: odoacer.turtle-trading.net:443 > bpd: right-to-left pt: 1 hscroll: 0 > bpd: right-to-left pt: 97 hscroll: 0 > bpd: right-to-left pt: 193 hscroll: 0 > bpd: right-to-left pt: 289 hscroll: 0 > Contacting host: odoacer.turtle-trading.net:443 > bpd: right-to-left pt: 1 hscroll: 57 > bpd: right-to-left pt: 153 hscroll: 57 > bpd: right-to-left pt: 305 hscroll: 57 > > The first run is as I expected. The second run has point at 1 and > hscroll at 57 (this is in a terminal, that's why the actual number is > different from before). According to my logic that should not be > possible. When the point is at 1, then hscroll should be 0 otherwise > point would not be visible. Unless some intermediate state is > permissible. But than shr could not rely on hscroll and therefore not > on vertical-motion. > > Now as a second experiment, remove the ";" from bidi-paragraph-direction > in shr-insert-document. Repeat the test. Now the result should look > correct. Somehow bidi-paragraph-direction does make a difference. No, it's not bidi-paragraph-direction, at least not directly. The problem is that shr-fill-lines needs to start in a window that is not scrolled horizontally, because otherwise vertical-motion will move to a wrong place (it interprets the column in its argument to be relative to its left edge). When EWW doesn't clear the previous value of bidi-paragraph-direction, the message "Loading URL ..." that is displayed when you type "G RET" is inserted into a buffer with a right-to-left paragraph direction, and bidi-display-reordering was not yet set to nil, so inserting that message with such a long URL causes the window to auto-hscroll. So when shr-insert-document is called, and resets bidi-display-reordering, the window is already hscrolled, and filling lines misbehaves. I fixed that now by forcing zero hscroll on the window before the line-filling starts. I guess we can now close this bug? Thanks.