From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Joost Kremers Newsgroups: gmane.emacs.help Subject: Re: Is there a way to force the directionality of a line of text in the GUI? Date: Tue, 15 Nov 2022 12:13:10 +0100 Message-ID: <87sfiktpt2.fsf@fastmail.fm> References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19222"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.8.3; emacs 28.1.91 Cc: help-gnu-emacs@gnu.org To: Evan Aad Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Tue Nov 15 12:34:28 2022 Return-path: Envelope-to: geh-help-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 1ouuCv-0004cr-84 for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 15 Nov 2022 12:34:27 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ouuCS-0002r7-Sn; Tue, 15 Nov 2022 06:33:56 -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 1ouuCQ-0002qu-TH for help-gnu-emacs@gnu.org; Tue, 15 Nov 2022 06:33:54 -0500 Original-Received: from wout2-smtp.messagingengine.com ([64.147.123.25]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ouuCP-0006Eu-4I for help-gnu-emacs@gnu.org; Tue, 15 Nov 2022 06:33:54 -0500 Original-Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id 130093200A5B; Tue, 15 Nov 2022 06:33:50 -0500 (EST) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Tue, 15 Nov 2022 06:33:50 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.fm; h= cc:cc:content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm1; t=1668512029; x=1668598429; bh=epD6IWt2Ro 9J7w2/AmzPJtNXorNoflPlMWPivxpzSCU=; b=EHblkalCa3+7hOTciwyd/Sz5gh qGdP1jLlvNSJaYjagk44rmBrpXuHII/pTeLjKdFDx9oOBvpM0A7iVDejrPvl3XQp tpLlqAKpNjJKJOHhOqavf9XloMNZf5hykkWiIDmRc4fyWVGpSLAH/vFz8Y/5VEkJ Ae07dQYW+QmzendsQucLMPkpzXYmliYfZbzfTBwqfI0EuZAnyW9Mx2LNv7jqBPDu eKfr1ZCEW+MMaG5P7o5JRYT0f6s370rRBPxIyHIPeCRc32+mP/ssvJjEKaJl53QF MWj5AEszzxZprJdFt+fWc9tRhDxYarRHAYvyF17n6yZKgA9spF75Yw13mc1w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; t=1668512029; x=1668598429; bh=epD6IWt2Ro9J7w2/AmzPJtNXorNo flPlMWPivxpzSCU=; b=Luv1XoyY3HceHyocyqmsc3uIm7g9Lwrzq7rWeZQU7fjc 5oLticb8o3rjbt843nAlKiKurO7BR2zJEwpF8VJmfGaRpD7i0qY6kAuqY6v9giiN YtpHW89FNNSqJIjuYG+eSP4Gd0E4938av78+YOVh+HFddcH4IZumNCdCv4FZJKSX rOmHbY7TEOOgJvJaRFI722tij5Vk38hxzMdMEf3B/QrB3sK/K3weHteMhJJIYfB3 IIKS6L9He3nqDPB4/fEu5+BYR49ns8uYuHFzSlCfzCo/+XSoUOUGgYMyzgb1u+/8 qISZQlZ2bgnb4ScvZJwthArtPEpueT26z1f54NeQ8Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvgedrgeeggddvlecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepfhgfhffvvefuffgjkfggtgesthdtre dttdertdenucfhrhhomheplfhoohhsthcumfhrvghmvghrshcuoehjohhoshhtkhhrvghm vghrshesfhgrshhtmhgrihhlrdhfmheqnecuggftrfgrthhtvghrnhepgfeihfdutdetle ejheevkeejtdffueehfffhffefteeiteefhedtkedtiedtkeffnecuvehluhhsthgvrhfu ihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepjhhoohhsthhkrhgvmhgvrhhsse hfrghsthhmrghilhdrfhhm X-ME-Proxy: Feedback-ID: ie15541ac:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 15 Nov 2022 06:33:48 -0500 (EST) In-reply-to: Received-SPF: pass client-ip=64.147.123.25; envelope-from=joostkremers@fastmail.fm; helo=wout2-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:140960 Archived-At: On Mon, Nov 14 2022, Evan Aad wrote: > When composing a bilingual document that combines a right-to-left > language, such as Hebrew, with a left-to-right language, such as > English, is there a way to force the left- or right alignment of a > line of text in the Emacs GUI when the text in that line contains no > letters of either alphabet. > > For example, when writing a mathematical text in Hebrew, intended to > be typeset by the TeX system, the following display-mode equation may > occur: > $$ > x+y=z > $$ > > In this case the Emacs GUI would align the initial $$ along the > buffer's right margin, whereas the next two lines would be aligned > along the left margin. This causes a disruption of the logical > cohesiveness of the LaTeX code. Is there a way that I could indicate > to the Emacs GUI to align the initial $$ along the left margin? See (info "(emacs) Bidirectional Editing") for this. If the text were all Hebrew, you could set the variable `bidi-paragraph-direction` to `right-to-left` and have all text start at the right margin. Otherwise, I think all you can do is insert the special Unicode character LEFT-TO-RIGHT MARK at the beginning of the relevant line. I don't know what your TeX system will do with that character, though. The character $ has 'weak directionality', meaning that (as stated in the Elisp manual) it "take[s] on the directionality of surrounding text".[1] It seems that "surrounding text" in this case means "preceding text", which probably makes sense in most cases, but not necessarily in your particular case, where $ follows a blank line (assuming you have blank lines surrounding $$...$$). Though perhaps someone more knowledgeable than me can shed some light on this. HTH Joost Footnotes: [1] (info "(elisp) Bidirectional Display") -- Joost Kremers Life has its moments