From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Halim Newsgroups: gmane.emacs.bugs Subject: bug#61269: 28.2; Sequence of spaces preceding tab in bidirectional line Date: Sat, 04 Feb 2023 02:41:35 +0700 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39133"; mail-complaints-to="usenet@ciao.gmane.io" To: 61269@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Feb 04 08:47:46 2023 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 1pODGz-0009u7-Qp for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 04 Feb 2023 08:47:46 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pODGW-0008NV-AR; Sat, 04 Feb 2023 02:47:18 -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 1pODGJ-0008Mh-B6 for bug-gnu-emacs@gnu.org; Sat, 04 Feb 2023 02:47:04 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pODGJ-0006bj-2M for bug-gnu-emacs@gnu.org; Sat, 04 Feb 2023 02:47:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pODGI-0006aS-Ur for bug-gnu-emacs@gnu.org; Sat, 04 Feb 2023 02:47:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Halim Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 04 Feb 2023 07:47:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 61269 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.167549679925256 (code B ref -1); Sat, 04 Feb 2023 07:47:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 4 Feb 2023 07:46:39 +0000 Original-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 Original-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 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 1pO24a-0001jF-8G for bug-gnu-emacs@gnu.org; Fri, 03 Feb 2023 14:50:14 -0500 Original-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== Original-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 Original-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 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> 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: P8SMI8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XcbDFAEVxp6QNdXWZNsmllAjfkRGlF5BgmaNhl/Kge9ylasl+XEROWdpyEOkVn+1UncKPoXkCsgAf3T0dajxmkK/Wu+jUVtif7HOs7lqYCytBtuTR0bueob4g/LyhkTO8ErkS/7sgYhI/Sg+B5ofDZoNYmvWlUCIlXLChwZdNgH7etgSGD0k19SlC24CxNNFuUkL5+BFpam3WpKOt0UIySKPljyWvfpgExT7VdhfqDjN4KARTlSa/RGmhQ8vkcJZbl+4LelaMtRAMeRuQjs9fxpFGKgZFqkAfbXlvoNr78cfx8EtOETfedcYZCg+yL8ZtvrpMR54OVao3k0mX6sgeiUa9dftu+k7EQNz+Sgm YGP0fgbBms4GId93o9iV60Aw0/B3D1Xi21t0gNCxjed++XsKHTRiBbngxvKFLkvsjd8MduSvE0cfjk0okq/EBvajfSwz9bN9YD 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-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 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:254753 Archived-At: 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))