Subject: Re: bug#22257: 25.0.50; bidi-paragraph-direction is sticky in eww (patch)

From: Lars Ingebrigtsen <[email-masked]>
Date: Mon, 28 Dec 2015 18:13:05 +0100

Benjamin Riefenstahl <[email-masked]> writes:

> When I have visited a page in eww that contains Hebrew text and than
> switch to a non-Hebrew page, bidi-paragraph-direction is still set RTL.
> A simple fix is attached.  The bug will still happen if the LTR page
> does not have an <html> element at all, but we may not care.

I think we do care.  :-)

Does the following fix the problem?  (Included in the Emacs 25 branch in
a jiffy...)

diff --git a/lisp/net/eww.el b/lisp/net/eww.el
index 5755a94..d455577 100644
--- a/lisp/net/eww.el
+++ b/lisp/net/eww.el
@@ -401,6 +401,7 @@ eww-display-html
 	(source (and (null document)
 		     (buffer-substring (point) (point-max)))))
     (with-current-buffer buffer
+      (setq bidi-paragraph-direction 'left-to-right)
       (plist-put eww-data :source source)
       (plist-put eww-data :dom document)
       (let ((inhibit-read-only t)

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no