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#49562: 27.2; Crash with specific mode-line-format in BiDi processing Date: Thu, 15 Jul 2021 13:06:25 +0300 Message-ID: <8335sf7uxq.fsf@gnu.org> References: <83pmvk7lty.fsf@gnu.org> 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="7360"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 49562@debbugs.gnu.org To: Martin =?UTF-8?Q?Br=C3=BCstel?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jul 15 12:08:57 2021 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 1m3yIb-0001hY-3x for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 15 Jul 2021 12:08:57 +0200 Original-Received: from localhost ([::1]:33628 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m3yIa-00051s-2w for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 15 Jul 2021 06:08:56 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35272) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m3yGk-0002YV-Ku for bug-gnu-emacs@gnu.org; Thu, 15 Jul 2021 06:07:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:35337) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m3yGk-0005LB-Cj for bug-gnu-emacs@gnu.org; Thu, 15 Jul 2021 06:07:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1m3yGk-0000VC-8j for bug-gnu-emacs@gnu.org; Thu, 15 Jul 2021 06:07:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 15 Jul 2021 10:07:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49562 X-GNU-PR-Package: emacs Original-Received: via spool by 49562-submit@debbugs.gnu.org id=B49562.16263436111899 (code B ref 49562); Thu, 15 Jul 2021 10:07:02 +0000 Original-Received: (at 49562) by debbugs.gnu.org; 15 Jul 2021 10:06:51 +0000 Original-Received: from localhost ([127.0.0.1]:46881 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m3yGY-0000UY-RF for submit@debbugs.gnu.org; Thu, 15 Jul 2021 06:06:51 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:37454) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m3yGY-0000UL-5U for 49562@debbugs.gnu.org; Thu, 15 Jul 2021 06:06:50 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:42068) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m3yGS-00059C-4t; Thu, 15 Jul 2021 06:06:44 -0400 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:4986 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m3yGR-0000bx-MQ; Thu, 15 Jul 2021 06:06:44 -0400 In-Reply-To: (message from Martin =?UTF-8?Q?Br=C3=BCstel?= on Thu, 15 Jul 2021 11:30:27 +0200) 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" Xref: news.gmane.io gmane.emacs.bugs:210022 Archived-At: > From: Martin BrĂ¼stel > CC: <49562@debbugs.gnu.org> > Date: Thu, 15 Jul 2021 11:30:27 +0200 > > Is there any built-in functionality to either > > 1. "sanitize" a string to remove bidi formatting in a sane way, or > 2. have `substring` functionality that can somehow deal with these > formatting controls, or > 3. restore balance of a possibly broken bidi formatted string? Not as you describe it, no. You could remove all bidi formatting controls with subst-char-in-string or with string-match/replace-match, and then use bidi-string-mark-left-to-right to solve many problems with bidirectional display of mixed RTL and LTR text. But note that bidi-string-mark-left-to-right doesn't exactly wrap the string in an embedding, it does something smarter.