From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: emacs-27 30a7ee5: Fix Arabic shaping when eww/shr fill the text to be rendered Date: Fri, 05 Jun 2020 17:20:43 +0300 Message-ID: <83y2p1a91g.fsf@gnu.org> References: <20200605075722.16213.57047@vcs0.savannah.gnu.org> <20200605075724.3C52120A26@vcs0.savannah.gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="31611"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Jun 05 16:21:36 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jhDE0-00087h-33 for ged-emacs-devel@m.gmane-mx.org; Fri, 05 Jun 2020 16:21:36 +0200 Original-Received: from localhost ([::1]:41364 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jhDDz-0005WS-6U for ged-emacs-devel@m.gmane-mx.org; Fri, 05 Jun 2020 10:21:35 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46780) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jhDDK-00055P-5T for emacs-devel@gnu.org; Fri, 05 Jun 2020 10:20:54 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:37460) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jhDDJ-0008A8-Eq; Fri, 05 Jun 2020 10:20:53 -0400 Original-Received: from [176.228.60.248] (port=4618 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jhDDI-0002sL-MJ; Fri, 05 Jun 2020 10:20:53 -0400 In-Reply-To: (message from Stefan Monnier on Fri, 05 Jun 2020 09:58:57 -0400) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:251901 Archived-At: > From: Stefan Monnier > Cc: emacs-devel@gnu.org > Date: Fri, 05 Jun 2020 09:58:57 -0400 > > > Fix Arabic shaping when eww/shr fill the text to be rendered > > * src/hbfont.c (hbfont_shape): Don't use DIRECTION if the current > > buffer has bidi reordering disabled. (Bug#41005) > [...] > > - if (!NILP (direction)) > > + if (!NILP (direction) > > + /* If they bind bidi-display-reordering to nil, the DIRECTION > > + they provide is meaningless, and we should let HarfBuzz guess > > + the real direction. */ > > + && !NILP (BVAR (current_buffer, bidi_display_reordering))) > > Hmm... so indeed I see that SHR binds `bidi-display-reordering`. Yes, it does. But the problem is more general, so the fix is not just a kludge to fix what shr does. As the comment explains. > Isn't that a problem, since its docstring says: > > [...] > Setting this to nil is intended for use in debugging the display code. > [...] It's "do like I say, not like I do" ;-) > Can we change SHR so it doesn't bind this var? I didn't see any better way at the time. Shr's naïve filling algorithm cannot cope with the complexity of RTL text in an LTR paragraph, when a long line has been continued. Maybe it's even entirely impossible to DTRT in Lisp in these cases. But if you or someone else have ideas, please describe them.