From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 04 02:46:39 2023 Received: (at submit) by debbugs.gnu.org; 4 Feb 2023 07:46:39 +0000 Received: from localhost ([127.0.0.1]:40549 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pODFs-0006Z9-0q for submit@debbugs.gnu.org; Sat, 04 Feb 2023 02:46:39 -0500 Received: from lists.gnu.org ([209.51.188.17]:43714) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pO24f-0001OC-Ci for submit@debbugs.gnu.org; Fri, 03 Feb 2023 14:50:19 -0500 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 1pO24a-0001jF-8G for bug-gnu-emacs@gnu.org; Fri, 03 Feb 2023 14:50:14 -0500 Received: from mail-psaapc01olkn2082f.outbound.protection.outlook.com ([2a01:111:f400:feae::82f] helo=APC01-PSA-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pO24X-0001cQ-3o for bug-gnu-emacs@gnu.org; Fri, 03 Feb 2023 14:50:12 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=S+GJduAWiBJqRflSmMVhRNbdVULQPkAeYTiRo0/zISWld1eK8PpHps04ykB2bregBx1FEeBQ1c2Ct1ppmP3hYebSlgvFhpmlJIJVi0ymQHw/OiRXvZUUtNwKLSJgpfru5VJUgNAEt6dnzkmM6gus/+M2yChWkKnSJ41nSknWDmaLg/zXaYVDn435DUJEIrySEIfNTRaslZ/oyLl58ffKMe9vzd3bgSFW8uCiplJejY33+0JB+2AxEsfCNPN99wgzAiKoALyiwcriEBOWSu37JqcI9kzV2u4ok1f11bqj5WPlozA5gILQoyMap/z9OYMnBxbjp/s5x0P9K5WbYSZVbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=QCZ2O/8HYLp4FqfgvFkLELmhpmdtvd3lgpt2H5NuwJ4=; b=BSHkBgB3wrC7iMKRAFX9cB21Gf4fN2dQ0L4D809rFD4RF2FSxY3gSOU54Rg+crGr6Uh/0RKlISN95wzMLvTnUqxxFfiTkPUrWW9YAh47pIWSY5zn8lSp/jikTXE6Y8H7mO9SSyC6tANQsRMAZ2SzZQCy1coo1+ZHdr5UJhDJbSsYTRhHdY6ZrjRpg9Bs5bZSh+A2N0Wz7HiXTWe+DJE6PRntZ7j1phtvuVjwihgAzi6Y336OrqNYbNfZDmYniYdV5auWKXKU+4gZZZktenxiORHjgrWemZ+efLsL32z5FiKB+KT/w7b8RyT9hQX9TjzeObpdyBfL8faMw9OH1+elPQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=QCZ2O/8HYLp4FqfgvFkLELmhpmdtvd3lgpt2H5NuwJ4=; b=s8Ar88Uinsm0YfzHd8WTTmd3i9Et+vYpKBGfy5WP7hRdIHBHnKenRCyO+KG+wdEA5EkhE9c/zz59z5ZYJzwg0t8o/bEbBx6wSn+gboYSnfflq19qRbNeqUVpbFIM+MNh4i/ziGDoJPlJVZKFOIwpxEvulsmvoE+fMtsd4hjdJ2NQOxDHwmDJ+OYA1XtY6cj3MAxXp3eMSrZ0+0fo9hkKx/ZtgKOoHtZ8TbIt1VXvEjHj2gYABoYTQMYLEO3xY4rYYc8cQ1IfXccrq2hoLR35xs3z1J7Zp3GX3BVui46hLkPIWuJLA1pdSFyX+aA5FOYvb9MrcGSTGaK1futr+YTEKA== Received: from PUZPR06MB5451.apcprd06.prod.outlook.com (2603:1096:301:eb::9) by TY0PR06MB5128.apcprd06.prod.outlook.com (2603:1096:400:1b3::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6086.6; Fri, 3 Feb 2023 19:45:01 +0000 Received: from PUZPR06MB5451.apcprd06.prod.outlook.com ([fe80::1fd9:df27:5c7d:36bf]) by PUZPR06MB5451.apcprd06.prod.outlook.com ([fe80::1fd9:df27:5c7d:36bf%7]) with mapi id 15.20.6064.022; Fri, 3 Feb 2023 19:45:01 +0000 From: Halim To: bug-gnu-emacs@gnu.org Subject: 28.2; Sequence of spaces preceding tab in bidirectional line Date: Sat, 04 Feb 2023 02:41:35 +0700 Message-ID: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-TMN: [PPidb2/tc5ueTrqdUjniJrrfDLIgolfx] X-ClientProxiedBy: SG3P274CA0018.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:be::30) To PUZPR06MB5451.apcprd06.prod.outlook.com (2603:1096:301:eb::9) X-Microsoft-Original-Message-ID: <87a61uy1sg.fsf@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PUZPR06MB5451:EE_|TY0PR06MB5128:EE_ X-MS-Office365-Filtering-Correlation-Id: dd0b69e9-3eb9-4d1f-5af1-08db061f2378 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: P8SMI8CkNFVnXZDd+So+2mKRzrp6OWtE2cQLreowEOvyawGYItdqB8+5R1UPkofFfZ5soHgkKboTQAzpDa8rCVdT2tGMNobDMdWcZWonQMdilbyEpvhNsqQRBnVUH/wOZGUcCt1QX0pyC4AI1A/l/F/GYt9gRwMJ0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V2ZhMVlHTEQ1VlRac3FQSUFpNnhBdWZHd01ranA1aWdkVks0NzBjOXFr?= =?utf-8?B?dDYyL2tEdTFFL0lkMWhQTlg0cFB4QU5QN2dETENhTWVwbGRSS1FtT3V5Y1Rw?= =?utf-8?B?N1E4V2UrLzZCejd4a2lHTzZTT0hVZmI2WVFJWm9tN051bXNHNTcrdVpkd1Y0?= =?utf-8?B?UWl4RE15TXFxdGFJbXZWcmdjZFg2cHBrU0NrYjdkMDdmc3FPUmJUdjJibFJi?= =?utf-8?B?cHNZYVdzcnJzSENtY3NOUzFnZ2g3ZHc5ZFVYYlA1Q1ZQQTJmdE5BbWJjQ0tj?= =?utf-8?B?WGo3eWhTNHVrTEkrQ21TNCtQUkFSUi8xbDcwUjBpTVVOK2pLTW9tV3VlRDN0?= =?utf-8?B?eG9QNzc3ZXRxdzQxV2Fmd3plQVloZXhmSFJwMUNpL3hUWmp5WmtiU3RRPT0=?= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: dd0b69e9-3eb9-4d1f-5af1-08db061f2378 X-MS-Exchange-CrossTenant-AuthSource: PUZPR06MB5451.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Feb 2023 19:45:01.4555 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: TY0PR06MB5128 Received-SPF: pass client-ip=2a01:111:f400:feae::82f; envelope-from=mhalimln@outlook.com; helo=APC01-PSA-obe.outbound.protection.outlook.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Sat, 04 Feb 2023 02:46:33 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) In a left-to-right line emacs display a sequence of one or more spaces (U+0020), where the spaces precede a tab (U+0009) and they both appear between two right-to-left alphabet, to the left of the first (in typing order) rtl alphabet. The bug does not present when the rtl text is inside an rtl isolate. Let s represent space, t represet tab, l represent itself, r and m represent arabic alphabet. The following example have this format in typing order from left to right. Format: lsrssstm Example text: l =D8=AD =D9=85 The expected display is 'lsrssstm', the actual is 'lssssrtm'. The spaces following 'r' in the format is displayed to the left of 'r' in the actual display. Using 'C-f' from 'r' moves the cursor to the left until it hits 't' where the cursor move to the right of 'r'. I have tried to view the file containing the buggy text in focuswriter and fribidi. They both display the same expected way. Extra Info The bug also present to ltr text on rtl line. I believe this is generic and is caused by this line '&& level !=3D bidi_it->level_stack[0].level' (see below). The bug also present in emacs built from commit 'ac7ec87a7a0db887e4ae7fe9005aea517958b778' with --without-all. In this commit I make the following modification. --------------- $ git diff ac7ec87a7a0db887e4ae7fe9005aea517958b778 diff --git a/src/bidi.c b/src/bidi.c index e012512..fe6e4d6 100644 --- a/src/bidi.c +++ b/src/bidi.c @@ -3302,10 +3302,7 @@ bidi_level_of_next_char (struct bidi_it *bidi_it) if ((bidi_it->orig_type =3D=3D NEUTRAL_WS || bidi_it->orig_type =3D=3D WEAK_BN || bidi_isolate_fmt_char (bidi_it->orig_type)) - && bidi_it->next_for_ws.charpos < bidi_it->charpos - /* If this character is already at base level, we don't need to - reset it, so avoid the potentially costly loop below. */ - && level !=3D bidi_it->level_stack[0].level) + && bidi_it->next_for_ws.charpos < bidi_it->charpos) { int ch; ptrdiff_t clen =3D bidi_it->ch_len; --------------- It fixes the bug. =20 In GNU Emacs 28.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.36, cair= o version 1.17.6) of 2023-01-03 built on 2 Windowing system distributor 'The X.Org Foundation', version 11.0.12101006 System Description: Arch Linux Configured using: 'configure --sysconfdir=3D/etc --prefix=3D/usr --libexecdir=3D/usr/lib --localstatedir=3D/var --with-cairo --with-harfbuzz --with-libsystemd --with-modules --with-x-toolkit=3Dgtk3 'CFLAGS=3D-march=3Dx86-64 -mtune=3Dgeneric -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3D2 -Wformat -Werror=3Dformat-security -fstack-clash-protection -fcf-protection -g -ffile-prefix-map=3D/build/emacs/src=3D/usr/src/debug/emacs -flto=3Dauto' 'LDFLAGS=3D-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -flto=3Dauto'= ' Configured features: ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG JSON LCMS2 LIBOTF LIBSYSTEMD LIBXML2 M17N_FLT MODULES NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND THREADS TIFF TOOLKIT_SCROLL_BARS X11 XDBE XIM XPM GTK3 ZLIB Important settings: value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix Major mode: Fundamental Minor modes in effect: delete-selection-mode: t cua-mode: t umath-mode: umath-insert-common tooltip-mode: t global-eldoc-mode: t show-paren-mode: t electric-indent-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t indent-tabs-mode: t transient-mark-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug sendmail misearch multi-isearch mule-util jka-compr nndraft nnmh nnfolder utf-7 rfc2104 gnutls gnus-agent gnus-srvr gnus-score score-mode nnvirtual gnus-msg gnus-art mm-uu mml2015 mm-view mml-smime smime dig nntp gnus-cache gnus-sum shr kinsoku svg dom gnus-group gnus-undo gnus-start gnus-dbus dbus xml gnus-cloud nnimap nnmail mail-source utf7 netrc nnoo parse-time iso8601 gnus-spec gnus-int gnus-range message dired dired-loaddefs rfc822 mml mml-sec epa mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader gnus-win gnus nnheader gnus-util rmail rmail-loaddefs rfc2047 rfc2045 ietf-drums time-date mail-utils mm-util mail-prsvr display-fill-column-indicator display-line-numbers delsel cua-base cus-load lsp-mode lsp-protocol help-mode xref project tree-widget wid-edit spinner pcase network-stream puny nsm rmc markdown-mode rx color thingatpt noutline outline lv inline imenu ht filenotify f f-shortdoc shortdoc s ewoc epg rfc6068 epg-config dash compile text-property-search comint ansi-color ring finder-inf edmacro kmacro easy-mmode derived info cl package browse-url url url-proxy url-privacy url-expand url-methods url-history url-cookie url-domsuf url-util mailcap url-handlers url-parse auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs password-cache json subr-x map url-vars seq byte-opt gv bytecomp byte-compile cconv cl-loaddefs cl-lib iso-transl tooltip eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors frame minibuffer cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite emoji-zwj charscript charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray cl-preloaded nadvice button loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote threads dbusbind inotify lcms2 dynamic-setting system-font-setting font-render-setting cairo move-toolbar gtk x-toolkit x multi-tty make-network-process emacs) Memory information: ((conses 16 386790 21130) (symbols 48 30110 6) (strings 32 132616 6853) (string-bytes 1 3608021) (vectors 16 51861) (vector-slots 8 610382 31136) (floats 8 356 324) (intervals 56 4882 0) (buffers 992 21)) From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 04 06:38:27 2023 Received: (at 61269) by debbugs.gnu.org; 4 Feb 2023 11:38:28 +0000 Received: from localhost ([127.0.0.1]:40788 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pOGsF-000319-Hh for submit@debbugs.gnu.org; Sat, 04 Feb 2023 06:38:27 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44182) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pOGsA-00030q-0a for 61269@debbugs.gnu.org; Sat, 04 Feb 2023 06:38:25 -0500 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 1pOGs4-0004cH-2N; Sat, 04 Feb 2023 06:38:16 -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=8IJr5p2xgRPkaE7jkT8yn6jiETAXrvQwEazXnxMjap8=; b=SiNem7f+7DfWILpUfFeC rTaj/M6oDRqGJ4ypWG2k+IrrpJUm4XiIKwH1SWzApOnLAK1b1DNCM2rh4ixiRs9Qh62cti6IorFRC bTy8nzGCwvrbLCFqN+Qk4UIISJWkecbZZiTDVjQCXMY5wwLidJh8wbYriDE5MxWmR/lYVYHHw89Nq hgXcsGAUtA3tIE6PDatp44sg6E95o2duW6mtGqG77Z3PUa6/FRbIlaxX68A371w4rqE4fR9j+OFpx ceX+rGMmNypfGVsSvFln9/d1HQIzfeDn/TdUxJLJtNIzRTgkZWyrTQzyNG31u20YLEnVdziT67iaU yzyAJlgrzEZI1Q==; Received: from [87.69.77.57] (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 1pOGs2-0008KY-Sr; Sat, 04 Feb 2023 06:38:15 -0500 Date: Sat, 04 Feb 2023 13:38:20 +0200 Message-Id: <83sfflu0cz.fsf@gnu.org> From: Eli Zaretskii To: Halim In-Reply-To: (message from Halim on Sat, 04 Feb 2023 02:41:35 +0700) Subject: Re: bug#61269: 28.2; Sequence of spaces preceding tab in bidirectional line References: MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 61269 Cc: 61269@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Halim > Date: Sat, 04 Feb 2023 02:41:35 +0700 > > > In a left-to-right line emacs display a sequence of one or more > spaces (U+0020), where the spaces precede a tab (U+0009) and they > both appear between two right-to-left alphabet, to the left of the > first (in typing order) rtl alphabet. > > The bug does not present when the rtl text is inside an rtl > isolate. > > Let s represent space, t represet tab, l represent itself, r and > m represent arabic alphabet. The following example have this format > in typing order from left to right. > > Format: > lsrssstm > > Example text: > l ح م > > The expected display is 'lsrssstm', the actual is 'lssssrtm'. > The spaces following 'r' in the format is displayed to the left > of 'r' in the actual display. Using 'C-f' from 'r' moves the > cursor to the left until it hits 't' where the cursor move to > the right of 'r'. > > I have tried to view the file containing the buggy text in > focuswriter and fribidi. They both display the same expected > way. > > Extra Info > > The bug also present to ltr text on rtl line. I believe > this is generic and is caused by this line > '&& level != bidi_it->level_stack[0].level' (see below). > > The bug also present in emacs built from commit > 'ac7ec87a7a0db887e4ae7fe9005aea517958b778' with > --without-all. In this commit I make the following > modification. > > --------------- > $ git diff ac7ec87a7a0db887e4ae7fe9005aea517958b778 > diff --git a/src/bidi.c b/src/bidi.c > index e012512..fe6e4d6 100644 > --- a/src/bidi.c > +++ b/src/bidi.c > @@ -3302,10 +3302,7 @@ bidi_level_of_next_char (struct bidi_it *bidi_it) > if ((bidi_it->orig_type == NEUTRAL_WS > || bidi_it->orig_type == WEAK_BN > || bidi_isolate_fmt_char (bidi_it->orig_type)) > - && bidi_it->next_for_ws.charpos < bidi_it->charpos > - /* If this character is already at base level, we don't need to > - reset it, so avoid the potentially costly loop below. */ > - && level != bidi_it->level_stack[0].level) > + && bidi_it->next_for_ws.charpos < bidi_it->charpos) > { > int ch; > ptrdiff_t clen = bidi_it->ch_len; > --------------- > > It fixes the bug. Thanks. You are right that the logic there was flawed. However, just removing the base-level test is sub-optimal: that test was added to speed up redisplay when the buffer has a lot of control characters (e.g., binary null bytes) that don't need to be reordered; see bug#22739. So I have installed a slightly different change, reproduced below; please see that it solves the problem, including (presumably) some real-life problems you had in displaying RTL text with embedded TABs. diff --git a/src/bidi.c b/src/bidi.c index e012512..93875d2 100644 --- a/src/bidi.c +++ b/src/bidi.c @@ -3300,12 +3300,15 @@ bidi_level_of_next_char (struct bidi_it *bidi_it) it belongs to a sequence of WS characters preceding a newline or a TAB or a paragraph separator. */ if ((bidi_it->orig_type == NEUTRAL_WS - || bidi_it->orig_type == WEAK_BN + || (bidi_it->orig_type == WEAK_BN + /* If this BN character is already at base level, we don't + need to consider resetting it, since I1 and I2 below + will not change the level, so avoid the potentially + costly loop below. */ + && level != bidi_it->level_stack[0].level) || bidi_isolate_fmt_char (bidi_it->orig_type)) - && bidi_it->next_for_ws.charpos < bidi_it->charpos - /* If this character is already at base level, we don't need to - reset it, so avoid the potentially costly loop below. */ - && level != bidi_it->level_stack[0].level) + /* This means the informaition about WS resolution is not valid. */ + && bidi_it->next_for_ws.charpos < bidi_it->charpos) { int ch; ptrdiff_t clen = bidi_it->ch_len; @@ -3340,7 +3343,7 @@ bidi_level_of_next_char (struct bidi_it *bidi_it) || bidi_it->orig_type == NEUTRAL_S || bidi_it->ch == '\n' || bidi_it->ch == BIDI_EOB || ((bidi_it->orig_type == NEUTRAL_WS - || bidi_it->orig_type == WEAK_BN + || bidi_it->orig_type == WEAK_BN /* L1/Retaining */ || bidi_isolate_fmt_char (bidi_it->orig_type) || bidi_explicit_dir_char (bidi_it->ch)) && (bidi_it->next_for_ws.type == NEUTRAL_B From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 05 12:03:59 2023 Received: (at submit) by debbugs.gnu.org; 5 Feb 2023 17:03:59 +0000 Received: from localhost ([127.0.0.1]:46358 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pOiQo-0005aS-OV for submit@debbugs.gnu.org; Sun, 05 Feb 2023 12:03:59 -0500 Received: from lists.gnu.org ([209.51.188.17]:50488) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pOiQm-0005aK-KB for submit@debbugs.gnu.org; Sun, 05 Feb 2023 12:03:57 -0500 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 1pOiQl-0003xa-2z for bug-gnu-emacs@gnu.org; Sun, 05 Feb 2023 12:03:56 -0500 Received: from mail-sgaapc01olkn2080c.outbound.protection.outlook.com ([2a01:111:f400:feab::80c] helo=APC01-SG2-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pOiQj-00021t-2W for bug-gnu-emacs@gnu.org; Sun, 05 Feb 2023 12:03:54 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HG8hkTAiFfF6u6+ruznNGo7dZm6A/WHLLahuH7VfI+/SB3vRnARg7eU7PpZk/sWEWlHqz9HQtu7rtibMdXmdgzh3IJpKCNWl1akPpa9SNLFXeNJUrSwS8a1ozVAJ2OGUAgP3aUZfdC/DInOJxHLr3oaNXZ7eaZ5nQF+o54DZhUCj3siQbCi+j75WEYmlBGx8jl6/ih9jiNv5sdbCEMrDM835TXj/CuZHFQ9kDcjC3qy+HrG+g/dK3IVbw0IHWrVE+wWCIRk0GnqHJLOGMA5KVI4G/JutTG/L7xqG657BqTUy+mKiRkRVCy53QQy0BC9qz3mG5PAzn6qXrlVfBUt6Og== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ppeTGO79VdfgLIDvMczuuLG9OpE5QZmyGBkZsfyF1x0=; b=ORr6uri8YmnTQDHD3UD+GT7szr4TkocVEvCnh7qeYPEzAgakeXsfDG9CfcyKrQw45260lAkiPDefVplNJvSq7mpZ/SzTC55Rtk0Po6SA40CoGHt88gjs0tNCzzczHjYsCrRmfIBymfPkZHpDy7nruh3HzF9PjDeiVlOfc2oH7HGDezPnYpMSHeedbw0eXbYDe6rdpa9eW5zsP9MFD5j//MeXiDVnxZ6T8dNuXlYEnBK/iN6SPsM+nwPPhUYFI1JfthB/K2Snm32iDuI0sev8bTGgn2QCSXZO3EOvN7oDd7D3D2GH0BqVyX6Z99pConFS87cWLf1oaJAWORCb+T9AVQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ppeTGO79VdfgLIDvMczuuLG9OpE5QZmyGBkZsfyF1x0=; b=Hlj8N4FQeI3RFwkHqVaenWBQlsMJ9GFFP8wakHOz45TF71yCiwIsZW+4Dsr7ziZM/RG9/9A2cQyDoE6GBmpqT+hZcE/ETDHcC40ke2ETslL8IpxBB9daD/FPUjm6+uO4zkBm7im2FVD7Jys61+OAu8kHd6nBV148xuzuB110h8fEfNiJTJcqOUnsucJCd4o0Q8+tcZNFwPlHZAutX0oQ3rfu1CUE7q3ZOc1pJZ2lswxU/pJDMgAng94lBtYyv6W5BxVOHjq6sGOVqHtnjtqD3VOTq9Po1heZNi1C76PhI1jcTZIbCB2t9iqwIwV+sOWIoGQWEYD4aFe6uNeHTulUFg== Received: from PUZPR06MB5451.apcprd06.prod.outlook.com (2603:1096:301:eb::9) by TYZPR06MB4349.apcprd06.prod.outlook.com (2603:1096:400:73::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6086.14; Sun, 5 Feb 2023 16:58:43 +0000 Received: from PUZPR06MB5451.apcprd06.prod.outlook.com ([fe80::1fd9:df27:5c7d:36bf]) by PUZPR06MB5451.apcprd06.prod.outlook.com ([fe80::1fd9:df27:5c7d:36bf%8]) with mapi id 15.20.6086.010; Sun, 5 Feb 2023 16:58:43 +0000 From: Halim To: bug-gnu-emacs@gnu.org Subject: bug#61269: 28.2; Sequence of spaces preceding tab in bidirectional line References: <83sfflu0cz.fsf@gnu.org> Date: Sun, 05 Feb 2023 23:55:38 +0700 In-Reply-To: <83sfflu0cz.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 04 Feb 2023 06:38:16 -0500") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-TMN: [ZQxl1m3ms0/uQa2sXRgdsYLEl3KEHGQ5] X-ClientProxiedBy: SI2PR02CA0015.apcprd02.prod.outlook.com (2603:1096:4:194::16) To PUZPR06MB5451.apcprd06.prod.outlook.com (2603:1096:301:eb::9) X-Microsoft-Original-Message-ID: <87edr49hmd.fsf@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PUZPR06MB5451:EE_|TYZPR06MB4349:EE_ X-MS-Office365-Filtering-Correlation-Id: 99ceebea-ce90-4088-f159-08db079a3ce5 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: DE6icd0pKJkDuLdOYfrcLFy0+WeOCZJvxgj2/cLAHNL5OQZpR/dhvn3iquhZESIJMfsy4nXFzWVnD6CUK1Vo8f5cRGJ+vjcbj5WfTZz50mkUrjPjaSyPC5OiflFHIl/uZ1ddAlICnRax96vn0vZQmV7yUp3B3J0YqtoEVkvqlqP76XyRUuYkWXuBQpbeudyyoq/Fp45LnspSc71LUKEJR/7JBNQawKYMq89PSZ7J8T1pBzufjC4ZWiljCENJcWxcGvJRugShBnGrBlU5L4SYPxw/Tre1FLmgOmbexfUWIiNFk/gym0/9Oc1ECQIi6WlpcwivQtdRxqClwqliBMsBHE5+rD7jrEE2JoNQ9A60cf6HFlusEBki5CLttWVHZt+L4PidT4zfs+tzPx0rb89yohGc4JPzhCyEhj2eRBzl+4h129Wc4s6i1FlV/RHbSTJEtRyTH9hwRLKLtetZd0awWEUjIfgSRA8ebSurXa5hgJmbCMFcqq1+d6KG9G0tVRk+7C5VQn9iQBqVcPqwRKZ9LwcqbzfsJimEHVNvnk2VClQvbwy+fOUOlhKIws8ACv/Z57qEk0MQGxyXIOP/k8RU0b+9GILvcXknz0TpDOPlFX0= X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?TUJoZ0Izc0ZuamNJc084RlpDNE51STFwZklYbkZGbUtTUVl6bUdzYXk3cCti?=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nE0ZkFURllKWDRB?= =?utf-8?B?T0VpUUNYOTVhRDRldG8ycUZhTmMvSU5YM3EydEZ3NGcxUjRGZENuQ3pOMFk4?= =?utf-8?B?UXV5ZHVYK255aFQrb2xTT0l6eEpvRFVFSEtQeVVVRi82N0tPeDRvdXBkZGdI?= =?utf-8?B?cVpGTE8zb2ZKQ2R2N1ZQOTdkVU5mSC9mZ1Z4bDBNdUtqUHptenFsTjduOGVF?= =?utf-8?B?R2JEcjJPbzMyR2JGTEZ3djFrelFkSkllbVVpdTFhM3EyWTBoWnU4UUtaMHJD?= =?utf-8?B?U1RLZVJuVnV2QWwvV3krenJCbzBjUW4yWnhsQVNUQTJVZ3ZjQ2Y2SlFYQlVl?= =?utf-8?B?d2xFRnVmYW5meGVUbUcxdGtJVnVFaUNxQmRnaGVvUThndy9CSFdSaXhkSDYy?= =?utf-8?B?blRTTVNTcGhKUllSMmo3cVNuWXpncUNhQWVRdXpkazdrWHZwaDRsNHFvalVu?= =?utf-8?B?VmwrQ2pLSkcraDZibTV3S3ozRmpDSHI1M2w3QS9BVjhJc1NLdC9Jak9zcE4x?= =?utf-8?B?SUhOckRsZEllZC9FTW13anpONGR2d29WTjhyaDBtYi9HUVZxSzNEQVo3TDNy?= =?utf-8?B?a05tYlNoSGI1eExVL0t3eWtrOEU1SG1xTTRjcTFyTTFoZ2NzZjNQeDJDK1l0?= =?utf-8?B?c1Irdzl3MHh0V3JFQUh3akYwT0xQOERzbm80cW12dUg1b3JzSERhUGFlczFD?= =?utf-8?B?bHRHU3VFVUF2SWdkeXppMEk1bUpCSyt2QkdPcUFOT2RVeHhiNjJlN0tkZlZN?= =?utf-8?B?UlFwRFExc0wrKzdoNDBad0xoUXNBcGJidzJ0NTR2WTBhOWIxNXVkSkFBPT0=?= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 99ceebea-ce90-4088-f159-08db079a3ce5 X-MS-Exchange-CrossTenant-AuthSource: PUZPR06MB5451.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Feb 2023 16:58:43.4877 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYZPR06MB4349 Received-SPF: pass client-ip=2a01:111:f400:feab::80c; envelope-from=mhalimln@outlook.com; helo=APC01-SG2-obe.outbound.protection.outlook.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) Eli Zaretskii writes: >> From: Halim >> Date: Sat, 04 Feb 2023 02:41:35 +0700 >>=20 >>=20 >> In a left-to-right line emacs display a sequence of one or more >> spaces (U+0020), where the spaces precede a tab (U+0009) and they >> both appear between two right-to-left alphabet, to the left of the >> first (in typing order) rtl alphabet. >>=20 >> The bug does not present when the rtl text is inside an rtl >> isolate. >>=20 >> Let s represent space, t represet tab, l represent itself, r and >> m represent arabic alphabet. The following example have this format >> in typing order from left to right. >>=20 >> Format: >> lsrssstm >>=20 >> Example text: >> l =D8=AD =D9=85 >>=20 >> The expected display is 'lsrssstm', the actual is 'lssssrtm'. >> The spaces following 'r' in the format is displayed to the left >> of 'r' in the actual display. Using 'C-f' from 'r' moves the >> cursor to the left until it hits 't' where the cursor move to >> the right of 'r'. >>=20 >> I have tried to view the file containing the buggy text in >> focuswriter and fribidi. They both display the same expected >> way. >>=20 >> Extra Info >>=20 >> The bug also present to ltr text on rtl line. I believe >> this is generic and is caused by this line >> '&& level !=3D bidi_it->level_stack[0].level' (see below). >>=20 >> The bug also present in emacs built from commit >> 'ac7ec87a7a0db887e4ae7fe9005aea517958b778' with >> --without-all. In this commit I make the following >> modification. >>=20 >> --------------- >> $ git diff ac7ec87a7a0db887e4ae7fe9005aea517958b778 >> diff --git a/src/bidi.c b/src/bidi.c >> index e012512..fe6e4d6 100644 >> --- a/src/bidi.c >> +++ b/src/bidi.c >> @@ -3302,10 +3302,7 @@ bidi_level_of_next_char (struct bidi_it *bidi_it) >> if ((bidi_it->orig_type =3D=3D NEUTRAL_WS >> || bidi_it->orig_type =3D=3D WEAK_BN >> || bidi_isolate_fmt_char (bidi_it->orig_type)) >> - && bidi_it->next_for_ws.charpos < bidi_it->charpos >> - /* If this character is already at base level, we don't need to >> - reset it, so avoid the potentially costly loop below. */ >> - && level !=3D bidi_it->level_stack[0].level) >> + && bidi_it->next_for_ws.charpos < bidi_it->charpos) >> { >> int ch; >> ptrdiff_t clen =3D bidi_it->ch_len; >> --------------- >>=20 >> It fixes the bug. > > Thanks. > > You are right that the logic there was flawed. However, just removing > the base-level test is sub-optimal: that test was added to speed up > redisplay when the buffer has a lot of control characters (e.g., > binary null bytes) that don't need to be reordered; see bug#22739. > > So I have installed a slightly different change, reproduced below; > please see that it solves the problem, including (presumably) some > real-life problems you had in displaying RTL text with embedded TABs. > > diff --git a/src/bidi.c b/src/bidi.c > index e012512..93875d2 100644 > --- a/src/bidi.c > +++ b/src/bidi.c > @@ -3300,12 +3300,15 @@ bidi_level_of_next_char (struct bidi_it *bidi_it) > it belongs to a sequence of WS characters preceding a newline > or a TAB or a paragraph separator. */ > if ((bidi_it->orig_type =3D=3D NEUTRAL_WS > - || bidi_it->orig_type =3D=3D WEAK_BN > + || (bidi_it->orig_type =3D=3D WEAK_BN > + /* If this BN character is already at base level, we don't > + need to consider resetting it, since I1 and I2 below > + will not change the level, so avoid the potentially > + costly loop below. */ > + && level !=3D bidi_it->level_stack[0].level) > || bidi_isolate_fmt_char (bidi_it->orig_type)) > - && bidi_it->next_for_ws.charpos < bidi_it->charpos > - /* If this character is already at base level, we don't need to > - reset it, so avoid the potentially costly loop below. */ > - && level !=3D bidi_it->level_stack[0].level) > + /* This means the informaition about WS resolution is not valid. = */ > + && bidi_it->next_for_ws.charpos < bidi_it->charpos) > { > int ch; > ptrdiff_t clen =3D bidi_it->ch_len; > @@ -3340,7 +3343,7 @@ bidi_level_of_next_char (struct bidi_it *bidi_it) > || bidi_it->orig_type =3D=3D NEUTRAL_S > || bidi_it->ch =3D=3D '\n' || bidi_it->ch =3D=3D BIDI_EOB > || ((bidi_it->orig_type =3D=3D NEUTRAL_WS > - || bidi_it->orig_type =3D=3D WEAK_BN > + || bidi_it->orig_type =3D=3D WEAK_BN /* L1/Retaining */ > || bidi_isolate_fmt_char (bidi_it->orig_type) > || bidi_explicit_dir_char (bidi_it->ch)) > && (bidi_it->next_for_ws.type =3D=3D NEUTRAL_B I have done the same test as I did before and your patch does fix the problem. Unfortunately I never had any real-life problems as I did not write any bidi text (I does write, but its only to help my understanding on UBA), so I cant give any result on this. Thanks. From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 05 12:17:51 2023 Received: (at 61269-done) by debbugs.gnu.org; 5 Feb 2023 17:17:51 +0000 Received: from localhost ([127.0.0.1]:46373 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pOieF-0005xM-4Z for submit@debbugs.gnu.org; Sun, 05 Feb 2023 12:17:51 -0500 Received: from eggs.gnu.org ([209.51.188.92]:48456) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pOieD-0005x7-9I for 61269-done@debbugs.gnu.org; Sun, 05 Feb 2023 12:17:50 -0500 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 1pOie6-0004tA-K4; Sun, 05 Feb 2023 12:17:42 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=Jmr0h2i2YVywGBZ8t3kMCIva6LVqXGV+/HlLwT6jnZw=; b=Nb8dcPJ5pkl2 wJiOn4+s+FEdon2qAYfv6emfGIQMCt2ijT4gb9N65qyCJbEYd8W3vigNljfM0XiOqXJE7cqwtjbqy KX5JzGasNNBJUcnw+b7GBvHMCIXko4N/7oqbEzquPeGZAzJsO2Rtm3yg/FGg2HJJbK7yFavltZX8Y sj3Aj2GpctQBi6hmskJXaN5Y5X3ckM1iEUM0XPG8BeIqbenlgWpzovt3Y82idDPDZMmzQ62or6xcK p1RIlswAnEkgcwaqsrcLUCb6YdxL2MpY3Q8Pf33r7sMXChUDKzD5ayzSpBomNK5EtDEz23WPCP+g0 r8RWDQI9O9Pak+JwNakvTw==; Received: from [87.69.77.57] (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 1pOie5-0001Bi-PN; Sun, 05 Feb 2023 12:17:42 -0500 Date: Sun, 05 Feb 2023 19:17:52 +0200 Message-Id: <83pmaoqben.fsf@gnu.org> From: Eli Zaretskii To: Halim In-Reply-To: (message from Halim on Sun, 05 Feb 2023 23:55:38 +0700) Subject: Re: bug#61269: 28.2; Sequence of spaces preceding tab in bidirectional line References: <83sfflu0cz.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 61269-done Cc: 61269-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Halim > Date: Sun, 05 Feb 2023 23:55:38 +0700 > > I have done the same test as I did before and your patch does fix > the problem. Unfortunately I never had any real-life problems as I > did not write any bidi text (I does write, but its only to help my > understanding on UBA), so I cant give any result on this. OK, thanks. So I'm closing this bug; feel free to reopen if you encounter some similar issues with whitespace and TABs in bidi context. From unknown Tue Aug 19 05:14:02 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Mon, 06 Mar 2023 12:24:07 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator