From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#69384: 30.0.50; :align-to and bidi-paragraph-direction interaction Date: Sun, 25 Feb 2024 21:45:43 +0200 Message-ID: <86cyskwcns.fsf@gnu.org> References: <87a5no1pka.fsf@gmx.net> <86o7c4wkwb.fsf@gnu.org> <874jdw1n0w.fsf@gmx.net> <86h6hwwip1.fsf@gnu.org> <87v86cz9g0.fsf@gmx.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10775"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 69384@debbugs.gnu.org To: Stephen Berman Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Feb 25 20:47:00 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 1reKSh-0002Z8-UT for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 25 Feb 2024 20:46:59 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1reKSO-0001JR-8o; Sun, 25 Feb 2024 14:46: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 1reKSN-0001JH-5o for bug-gnu-emacs@gnu.org; Sun, 25 Feb 2024 14:46: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 1reKSL-0006vg-TT for bug-gnu-emacs@gnu.org; Sun, 25 Feb 2024 14:46:37 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1reKSk-0004bY-Eu for bug-gnu-emacs@gnu.org; Sun, 25 Feb 2024 14:47: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: Sun, 25 Feb 2024 19:47: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.170889038217569 (code B ref 69384); Sun, 25 Feb 2024 19:47:02 +0000 Original-Received: (at 69384) by debbugs.gnu.org; 25 Feb 2024 19:46:22 +0000 Original-Received: from localhost ([127.0.0.1]:42944 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1reKS5-0004ZH-I6 for submit@debbugs.gnu.org; Sun, 25 Feb 2024 14:46:22 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:51908) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1reKS3-0004Yq-6R for 69384@debbugs.gnu.org; Sun, 25 Feb 2024 14:46:19 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1reKRY-0006Yv-A7; Sun, 25 Feb 2024 14:45:48 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=a2e0k4HK1Ih0Y8/TekPI31UobtwSytOusFU9J8I8o5U=; b=D6yZNNNti5JXYjfI+2qz gdhWVyI3tWC9tv6mWm2jCJr2nri3QvZ8mR3t0GHNANJaxa6C+YzO8/At0/DYth9eVLwMyvgy79hL9 qvdrMTG4R5UZdyJUZpQFC3hxatW+dqg+L6Nwhoyar17eY8Jvo6WYN0eCE9+EqJyLXR7+zxKIALgh0 bRJBE7tzUnu3Y20wDPgZN8iPh3g8nlHPRBKmgUOV45A0wervswxsl6gveDCGoyitWqueCmc+xz9me ErISvtFsjBrJuEVGLcNG1l3knJBFDCapUi8KaU+YfOyNvgkBc57GwIXkEnte+ux1hksyobRbamga8 Qa1aOiSiSg6DYg==; In-Reply-To: <87v86cz9g0.fsf@gmx.net> (message from Stephen Berman on Sun, 25 Feb 2024 19:26:55 +0100) 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:280642 Archived-At: > From: Stephen Berman > Cc: 69384@debbugs.gnu.org > Date: Sun, 25 Feb 2024 19:26:55 +0100 > > On Sun, 25 Feb 2024 19:35:22 +0200 Eli Zaretskii wrote: > > > 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. Sorry, this is still too vague. What do you mean by "RTL text aligned with LTR text"? "aligned" in what way and sense? How about an example of text showing what you want to do? To avoid strange effects of bidi reordering, please use lower-case letters to represent LTR text and upper-case letters to represent RTL text. > > 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. Please don't talk about column numbers in this context, because it's confusing: in RTL text columns are counted from the right. "Leftmost column", by contrast, is clear. > >> 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. Exactly. > 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. You should be able to do that without tweaking bidi-paragraph-direction, since :align-to can use the 'left' and 'right' positions. For example: (let* ((a "السّلام عليكم") (b "Hello") (buf (get-buffer-create "Test3"))) (with-current-buffer buf (erase-buffer) (insert (propertize " " 'display `(space :align-to (- right 20))) a "\n\n" b) (switch-to-buffer buf))) (Except that it looks like 'left' and 'right' are reversed in this case, probably a bug.) You can also use 'text' to stand for the width of the text-area of a window.