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 19:26:55 +0100 Message-ID: <87v86cz9g0.fsf@gmx.net> References: <87a5no1pka.fsf@gmx.net> <86o7c4wkwb.fsf@gnu.org> <874jdw1n0w.fsf@gmx.net> <86h6hwwip1.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="12929"; 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 19:33:10 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 1reJJE-00034j-Tg for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 25 Feb 2024 19:33:09 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1reJIm-0006ZY-PS; Sun, 25 Feb 2024 13:32: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 1reJIl-0006ZA-5P for bug-gnu-emacs@gnu.org; Sun, 25 Feb 2024 13:32:39 -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 1reJIk-0007Z8-ST for bug-gnu-emacs@gnu.org; Sun, 25 Feb 2024 13:32:38 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1reJJ9-0000p1-A5 for bug-gnu-emacs@gnu.org; Sun, 25 Feb 2024 13:33:03 -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 18:33:03 +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.17088859573060 (code B ref 69384); Sun, 25 Feb 2024 18:33:03 +0000 Original-Received: (at 69384) by debbugs.gnu.org; 25 Feb 2024 18:32:37 +0000 Original-Received: from localhost ([127.0.0.1]:37411 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1reJIi-0000nF-1D for submit@debbugs.gnu.org; Sun, 25 Feb 2024 13:32:36 -0500 Original-Received: from mout.gmx.net ([212.227.17.20]:33611) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1reJIe-0000mj-4i for 69384@debbugs.gnu.org; Sun, 25 Feb 2024 13:32:34 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=s31663417; t=1708885921; x=1709490721; i=stephen.berman@gmx.net; bh=OClpnInhrj906G/08sDvN/qhTst87Og2wfCe5OOR7+g=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References: Date; b=kKKlqcebBtkc0+NTJgaKcqWCpsRcq6vA1DZsUS1tSJJFnmN8uYyOldZS2Yl5qr88 S5Noq7ZtqQJ1a4Hf+uYnD2o1Qekor1ALla1Bz5W0JJXf/xvCSwGSzkUZE4EZFAxKX SbIbz6Clen2d+3tYDlw/MUY1QnGB+rLPJgtSQwMjk7U012ESKR+fzqQX9Lo1xWrjw Q/EeNS1/qa35C7HJkx52dbtT5iHidwxnqgwstzutVfKEimNC9WB3P6WbH9cBxMP0c +LTMWPAHvwFvJCGc8L6O2tDzIruBUQTbSs27TfrlwKmUrE0SErpRFrBKNwR1CJBU3 vERmVIxf6+bjk/Ww2A== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Original-Received: from strobelfs2 ([94.134.95.138]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1Mz9Z5-1qiEeK3Gdv-00wA1G; Sun, 25 Feb 2024 19:26:55 +0100 In-Reply-To: <86h6hwwip1.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 25 Feb 2024 19:35:22 +0200") X-Provags-ID: V03:K1:PXgPQT5hWEwPStnlThp6/6PKyoamH2TlzChdac23CA0R6NA8S6O Y3UprVeSvvhn/o8XKJXpbOoqn2W/aBh4ypUuBu3Es6XJthPP+hviw1DTqXCpC/QNTMY6tz1 Nfmf6p7DcgN/CxDsdqf5Ey84AAmtz0MtgmsGJVPLDddoF0XoVeSuWi5H6dl9CHz435xyC8a 3Dz1fjwbkgO+8CHI3ZuOA== UI-OutboundReport: notjunk:1;M01:P0:2DRAkxBglCA=;gHBcAiJbOk3jGYX1s3UJjxHFEso 7BiWYPSYFN6n3nb5WTR6K/DTpqdVoJ85wCTGUD2JXlVF7ZzsZyf7VFk+sYh6oQTcDS/wx9Egy wRRj3Q9D66MbKYsq9Nuy14IJLj+NpnqCXx5CmxqhI/hSj7e1X4mDOvK9fPhW1PPwXxBT736g8 R2WewxxmejVrQQkCZJwfDigi0MU6anDxXI5v2QZz/EsnFVb1sV+cu8S3SEz8+LStxRNwdKshN /pVTHO5YWRRI+660mLrscEUe6hbS9f6p+x/nn9VXU/9RqwMT5YdW9Hxpm+Ay62ZFogWQ3A4C+ uzR3cTxbvL/3w/vZC77zWmXJdWT6CNa+mQwN2pEkgS5AZOCjGeMhO1puzlAnecItmGyzOP76G 9fZDzQwt/TPBnll8pn0fkd+MM7wJgVwZEj5U/9M2rKj6eQUcIkYcyi7FzduB7x4JtyVE8/m/z jF09Xg8m4v+Rjar7G49oVMIktl1TVWwvyU9wKlFpdLGZfaDEPTg2r1j8/3i080cMRcucDBuPn kMrrQwe2Tit6oQ65bEQhHoGSsGsQlNlz39rljf+8A0aCf+SW1T99Ipz+Lr6ncRIPdxyS49P77 eU+cUSWB4CAUVU5XswQpxosGXeXytoGazG7pX/GoEpA1OWGzcnbuDPSuCm3UFbEe9E/nwf3TD 2hdjh94zM5aXAyd7JGUiorz7U8xgn/6qf3DTN68nYgtjqIG9yNawj2GK7FVYr6VD1Adb0cKHp nbQkEVH+pui8RLNFGErY068ICq+3bqUxa5cmY4oZ5OMV2K2mjfjrBgEfnG0sBxl65vGqWirF 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:280633 Archived-At: On Sun, 25 Feb 2024 19:35:22 +0200 Eli Zaretskii wrote: >> From: Stephen Berman >> Cc: 69384@debbugs.gnu.org >> Date: Sun, 25 Feb 2024 18:17:35 +0100 >> >> >> 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 proper= ty, >> >> 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 th= e >> >> string used (or the corresponding pixel-width values); see the secon= d >> >> 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). > > I don't understand well enough what were you trying to achieve, so I > cannot suggest how to do that. I want to display RTL text aligned with LTR text; the buffer contains mainly LTR text. Currently just setting bidi-paragraph-direction to 'left-to-right is sufficient for aligning at column 0, but I may want to align to some column in the middle of the window, which I why I tried using :align-to and found calculating the needed value cumbersome. >> >> It's also possible to avoid this calculation and use an :align-to va= lue >> >> 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 resultin= g >> alignment is what I wanted and expected, but the broken shaping is not. > > What do you mean by "first column (0) in LTR order"? D|o you mean the > leftmost column in the visual order? something else? Yes, column 0 as in a buffer containing only LTR text. >> > 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 > > OK, I will look into that when I have time. Thanks. >> 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? > > It's supposed to be a no-op, of course. Exactly like in the strict > LTR unidirectional text. What else can it mean? I now realize I shouldn't have used :align-to 0 for this case, since setting bidi-paragraph-direction to 'left-to-right already gives the desired column-0 alignment. It's for alignment to a columns > 0 that :align-to in combination with bidi-paragraph-direction could be useful, if the value of :align-to were easy to use, e.g. simply to to align the RTL text to LTR-column 20 (instead of having to do some trial-and-error calculation). But the broken shaping thwarts that. Steve Berman