From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stephen Berman via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#69384: 30.0.50; :align-to and bidi-paragraph-direction interaction Date: Sun, 25 Feb 2024 18:17:35 +0100 Message-ID: <874jdw1n0w.fsf@gmx.net> References: <87a5no1pka.fsf@gmx.net> <86o7c4wkwb.fsf@gnu.org> Reply-To: Stephen Berman Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9600"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 69384@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Feb 25 18:26:14 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1reIGU-0002FP-AM for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 25 Feb 2024 18:26:14 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1reIFw-0000iA-MP; Sun, 25 Feb 2024 12:25:40 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1reIFu-0000he-N4 for bug-gnu-emacs@gnu.org; Sun, 25 Feb 2024 12:25:38 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1reIFu-0005Vv-BZ for bug-gnu-emacs@gnu.org; Sun, 25 Feb 2024 12:25:38 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1reIGI-0005uB-MH for bug-gnu-emacs@gnu.org; Sun, 25 Feb 2024 12:26:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stephen Berman Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 25 Feb 2024 17:26:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69384 X-GNU-PR-Package: emacs Original-Received: via spool by 69384-submit@debbugs.gnu.org id=B69384.170888192222568 (code B ref 69384); Sun, 25 Feb 2024 17:26:02 +0000 Original-Received: (at 69384) by debbugs.gnu.org; 25 Feb 2024 17:25:22 +0000 Original-Received: from localhost ([127.0.0.1]:32813 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1reIFd-0005rm-HC for submit@debbugs.gnu.org; Sun, 25 Feb 2024 12:25:22 -0500 Original-Received: from mout.gmx.net ([212.227.17.22]:37665) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1reIDa-0005kQ-IW for 69384@debbugs.gnu.org; Sun, 25 Feb 2024 12:23:15 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=s31663417; t=1708881763; x=1709486563; i=stephen.berman@gmx.net; bh=4x/Z+KXfpj8VESQ3FxrvlW8bNon/8ciIw3Qx8xM7hQ0=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References: Date; b=HDky6Y3h08ht3DdSGWP81NPfkZ3ZaeJA6GjoCLmFk0xu7y1wC3S/ux85wuV6k8Ka fHOYSkQma8wwsVY5h8kLSJjGH+AbqgV+BqXzFWvIU2QBhg8ad/EVcCb7ELNboP50F 3B7/R9UMcQvAy4h3Ssy78HEozByNBaFJim9+05fYxsmmbJHngkeIjq65ErBJYeeLl +mA5O68maA+8qeVBG3QkShdiGCeR8yO5ZcVlVlDeFFSWRZRkG5Z6m7sv2eNiHf5so Hjfofbvk2veP9RvGW+PVHMl1xkdK/pZXlo1SRn3KvrG6vIFvSCF/TuDbSn1BrmBe+ ZcSMljjmiue2sRyslw== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Original-Received: from strobelfs2 ([94.134.95.138]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MMGRK-1rNASE1WaM-00JLbn; Sun, 25 Feb 2024 18:17:36 +0100 In-Reply-To: <86o7c4wkwb.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 25 Feb 2024 18:47:48 +0200") X-Provags-ID: V03:K1:D845eMrVsLxTHVL7Gzk2jdlYAYNpWxlKvgA0NkCF5pNCjmEwdGh 3Q09+ANM3IvlQiT0lAuD0zSNjhEOF0uNZq9FwW4VEBXE++GNliIs38AjrH9WONWwM7Lg70G ZYStGc6l/8c1sUL3rtQE6dQ6FvXUd6AusqiZY2yOXmls50XkXnpOCtvGkVHTBlLt+kVkvOw BKr+CW+ENQHLnKJgQMpMg== UI-OutboundReport: notjunk:1;M01:P0:SRa2SISoHnA=;IuAjzOXKX0pI7pDbkvCF3IbU/Bb gsXRtuC969ISW1dBwLVCll6n9nAS69mh5fy8chwnLMhyR775nnsANYUMTFrSeopjT9e6Bs4o7 O5Y3kB3LZ1XelXE/0zf1mfNXhHHvJTYv/15w9PkWLDPHcdTc+WX7KAMH9ZHc/RNz0HlASBWPI PhHj2KyXfxcMam84MXf/FQ0R97VmBiUuJkhA+ahhsMUsALWz1k4shZ+yJyP2xJmMRVz6Hw9FA ntCeA+sevLxzmbRtrSUxST12NF+NuItkdSDz9DL0h+EfUDOGPwoTvY5FixYQ0IlMjIGjWW/WY PD/ZcHTv4+ezrJcGHe85Oecu4GelJeF40gdo4uok7NYlSzUhX5NJUn5NNwr2ag1xEOfX5xhFn JHBetRPQHsAeBdfwJUVGqwmRDhcl2qcD2TfqmSrCviOmzsH4I1arf1N6NkX3B7p7vvuBo5BQL OXGhH8ZsvKna+WaZIcw5dOatPG5AQXGRSKjnzoDO0QTGEAmwPt9Ozr/FeJppFi1IO5JVeJGsl dYaNvuo1pAtHNLOzt2VNrfYagYD2l5jxVzIEW5mxDy1FgbkFHJ6rQQjyf5N2WhRcw1207gAlY IJ6BDygq4OliL9+P0eh6HToN4HXmkfKOYn7coNiwIbPpStH2p1TEGqNPGI4X8gHmtKJXO4WVZ k9N10/I5wnaEtfl6tE2VRrHQyXsxSW95D5nrXOzC6gokTupQKCdkXdNpg3rZ7t7Y/lvHtxcJu MbWwm3I0R7NANRju0kbGKWzHMTLMU4Ig0NPv2UrIY/LG7EEEQttxMWS7tI6/3J738pyRSpH+ X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:280628 Archived-At: On Sun, 25 Feb 2024 18:47:48 +0200 Eli Zaretskii wrote: >> Date: Sun, 25 Feb 2024 17:22:45 +0100 >> From: Stephen Berman via "Bug reports for GNU Emacs, >> the Swiss army knife of text editors" >> >> In a buffer that contains bidirectional text, setting >> bidi-paragraph-direction to 'left-to-right aligns the RTL text with the >> left margin like the LTR text; see the first sexp below and the top >> buffer in the attached screenshot. > > Yes, and that's what you should expect. That's what > bidi-paragraph-direction set to left-to-right means: the base > paragraph direction of every paragraph in this buffer will be LTR. If > you think this is a bug or unexpected, please tell why. No, this is indeed what I expected (see below for elaboration). >> Another alternative to get this alignment is to leave >> bidi-paragraph-direction at its default value of nil and use a space >> display specification with a suitable value for the :align-to property, >> but this requires a calculation that seems to depend at least on the >> font used and the values of `window-width' and `string-width' for the >> string used (or the corresponding pixel-width values); see the second >> sexp below and the middle buffer in the attached screenshot. > > Yes, because in a RTL paragraph, columns are counted from the right > edge of the window. So this again is the expected behavior, and if > you consider that unexpected, please explain why. This is also what I expected. But it would be nice if there were an easier way to calculate the value of :align-to (I looked in the Elisp manual but didn't find anything that would give me the value 0.75 I found by trial and error). >> It's also possible to avoid this calculation and use an :align-to value >> of 0 in combination with setting bidi-paragraph-direction to >> 'left-to-right; > > What is the purpose of using ":align-to 0"? what do you think is the > semantics of that and your expectations? I wanted to align to the first column (0) in LTR order, for which it's necessary set bidi-paragraph-direction to 'left-to-right. The resulting alignment is what I wanted and expected, but the broken shaping is not. >> see the third sexp below and the bottom buffer in the >> attached screenshot. However, as the screenshot shows, this last >> alternative breaks Arabic text shaping, at least for the fonts I tried > > I will look into the shaping problem, but in general 'display' specs > do affect bidirectional display; see the end of the node "Specified > Space" in the ELisp manual. > > Still, I don't think I understand what are you reporting as a bug > here. Please clarify. Sorry for not being clearer in my report: the bug is the broken shaping with the combination of setting bidi-paragraph-direction and using :align-to; the first two examples were meant to show that using these individually also works. But I gather from your reply that I've misunderstood what :align-to set to 0 means; can you enlighten me? Steve Berman