From unknown Tue Jun 17 20:20:01 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#43207 <43207@debbugs.gnu.org> To: bug#43207 <43207@debbugs.gnu.org> Subject: Status: 26.3; Strange bidi behavior Reply-To: bug#43207 <43207@debbugs.gnu.org> Date: Wed, 18 Jun 2025 03:20:01 +0000 retitle 43207 26.3; Strange bidi behavior reassign 43207 emacs submitter 43207 nisse@lysator.liu.se (Niels M=C3=B6ller) severity 43207 normal tag 43207 notabug thanks From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 04 15:37:00 2020 Received: (at submit) by debbugs.gnu.org; 4 Sep 2020 19:37:00 +0000 Received: from localhost ([127.0.0.1]:40651 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kEHW3-0000iU-Rb for submit@debbugs.gnu.org; Fri, 04 Sep 2020 15:37:00 -0400 Received: from lists.gnu.org ([209.51.188.17]:37308) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kEHW2-0000iN-Ju for submit@debbugs.gnu.org; Fri, 04 Sep 2020 15:36:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47164) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kEHW2-0006p3-Ch for bug-gnu-emacs@gnu.org; Fri, 04 Sep 2020 15:36:54 -0400 Received: from mail.lysator.liu.se ([130.236.254.3]:38705) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kEHVz-0004G2-He for bug-gnu-emacs@gnu.org; Fri, 04 Sep 2020 15:36:53 -0400 Received: from mail.lysator.liu.se (localhost [127.0.0.1]) by mail.lysator.liu.se (Postfix) with ESMTP id A72F640003 for ; Fri, 4 Sep 2020 21:36:42 +0200 (CEST) Received: from fukushima.lysator.liu.se (fukushima.lysator.liu.se [IPv6:2001:6b0:17:f0a0::5d]) by mail.lysator.liu.se (Postfix) with SMTP id 8D41040002 for ; Fri, 4 Sep 2020 21:36:41 +0200 (CEST) Received: by fukushima.lysator.liu.se (sSMTP sendmail emulation); Fri, 04 Sep 2020 21:36:41 +0200 From: nisse@lysator.liu.se (Niels =?utf-8?Q?M=C3=B6ller?=) To: bug-gnu-emacs@gnu.org Subject: 26.3; Strange bidi behavior Date: Fri, 04 Sep 2020 21:36:41 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: ClamAV using ClamSMTP Received-SPF: pass client-ip=130.236.254.3; envelope-from=nisse@lysator.liu.se; helo=mail.lysator.liu.se X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/04 15:36:43 X-ACL-Warn: Detected OS = Linux 3.11 and newer X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.6 (-) 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.6 (--) I get a pretty confusing behavior when I load the file at https://www.lysator.liu.se/~nisse/misc/emacs-bidi-bug-2.txt This is what it looks like https://www.lysator.liu.se/~nisse/misc/emacs-bidi-bug-2.png I'll try to describe the behavior I get when loading the file with emacs -Q emacs-bidi-bug-2.txt (I'm not sure exactly what intended behavior is, but what I see is quite confusing). The file contains some arabic characters (originating in a discussion of the vatican reportedly registering an arabic domain name meaning "katholic"), followed by some Swedish text. The Swedish text is displayed mostly in left-to-right order (except for punctuation characters), but right-justified in the buffer, and to me it seems like some parts of emacs thinks the text is rendered right-to-left. More specifically, C-f moves point in the expected "logical order" of the text, which is mostly to the right on the screen. However pressing the right-arrow key (bound to right-char) moves cursor to the left on most parts of this text (the opposite direction of C-f (forward-char)), despite the text being rendered in left-to-right order. I would have expected the later part of the file to be displayed left-justified in left-to-right order, with the exception of the single word "=D9=83=D8=A7=D8=AB=D9=88=D9=84=D9=8A" rendered right-to-left. Regards, /Niels In GNU Emacs 26.3 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.20) of 2020-05-17, modified by Debian built on x86-csail-01 Windowing system distributor 'The X.Org Foundation', version 11.0.12004000 Configured using: 'configure --build x86_64-linux-gnu --prefix=3D/usr --sharedstatedir=3D/var/lib --libexecdir=3D/usr/lib --localstatedir=3D/var/lib --infodir=3D/usr/share/info --mandir=3D/usr/share/man --enable-libsystemd --with-pop=3Dyes --enable-locallisppath=3D/etc/emacs:/usr/local/share/emacs/26.3/site-lisp:= /usr/local/share/emacs/site-lisp:/usr/share/emacs/26.3/site-lisp:/usr/share= /emacs/site-lisp --with-sound=3Dalsa --without-gconf --with-mailutils --build x86_64-linux-gnu --prefix=3D/usr --sharedstatedir=3D/var/lib --libexecdir=3D/usr/lib --localstatedir=3D/var/lib --infodir=3D/usr/share/info --mandir=3D/usr/share/man --enable-libsystemd --with-pop=3Dyes --enable-locallisppath=3D/etc/emacs:/usr/local/share/emacs/26.3/site-lisp:= /usr/local/share/emacs/site-lisp:/usr/share/emacs/26.3/site-lisp:/usr/share= /emacs/site-lisp --with-sound=3Dalsa --without-gconf --with-mailutils --with-x=3Dyes --with-x-toolkit=3Dgtk3 --with-toolkit-scroll-bars 'CFLAGS=3D-g -O2 -fdebug-prefix-map=3D/build/emacs-mHAik2/emacs-26.3+1=3D. -fstack-protector-strong -Wformat -Werror=3Dformat-security -Wall' 'CPPFLAGS=3D-Wdate-time -D_FORTIFY_SOURCE=3D2' LDFLAGS=3D-Wl,-z,relro' Configured features: XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GSETTINGS GLIB NOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM THREADS LIBSYSTEMD LCMS2 Important settings: value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix Major mode: Text Minor modes in effect: tooltip-mode: t global-eldoc-mode: t electric-indent-mode: t mouse-wheel-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 transient-mark-mode: t Load-path shadows: /usr/share/emacs/site-lisp/lyskom-elisp-client hides /usr/share/emacs/site-lisp/lyskom-elisp-client/lyskom-elisp-client Features: (pp shadow sort mail-extr emacsbug message dired dired-loaddefs format-spec rfc822 mml mml-sec epa derived epg epg-config gnus-util rmail rmail-loaddefs mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils parse-time browse-url wid-edit network-stream puny nsm rmc seq auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs password-cache starttls tls gnutls lyskom-rest string lyskom-menus lyskom-ansaphone lyskom-messages mship-edit lyskom-cache lyskom-services lyskom-mime lyskom-aux-items lyskom-command advice lyskom-clienttypes lyskom-types lyskom-language-sv lyskom-strings lyskom-language lyskom-macros lyskom-vars lyskom-feature lyskom-defvar lyskom edmacro kmacro cl-print byte-opt gv bytecomp byte-compile cconv thingatpt cl-extra help-fns radix-tree help-mode easymenu cl-loaddefs cl-lib elec-pair time-date mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type 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 elisp-mode lisp-mode prog-mode register page menu-bar rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core term/tty-colors frame 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 charscript charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray minibuffer cl-preloaded nadvice loaddefs button faces cus-face macroexp files 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 move-toolbar gtk x-toolkit x multi-tty make-network-process emacs) Memory information: ((conses 16 264803 23621) (symbols 48 30298 0) (miscs 40 845 608) (strings 32 61450 3495) (string-bytes 1 1701594) (vectors 16 37130) (vector-slots 8 1636019 140596) (floats 8 99 394) (intervals 56 3949 356) (buffers 992 21)) --=20 Niels M=C3=B6ller. PGP-encrypted email is preferred. Keyid 368C6677. Internet email is subject to wholesale government surveillance. From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 04 16:03:35 2020 Received: (at 43207) by debbugs.gnu.org; 4 Sep 2020 20:03:35 +0000 Received: from localhost ([127.0.0.1]:40698 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kEHvq-0003aK-O5 for submit@debbugs.gnu.org; Fri, 04 Sep 2020 16:03:35 -0400 Received: from eggs.gnu.org ([209.51.188.92]:40888) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kEHvn-0003Zz-Qg; Fri, 04 Sep 2020 16:03:33 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:49312) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kEHvg-0007Dr-JR; Fri, 04 Sep 2020 16:03:24 -0400 Received: from [176.228.60.248] (port=1034 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kEHvf-0004Ln-W6; Fri, 04 Sep 2020 16:03:24 -0400 Date: Fri, 04 Sep 2020 23:03:13 +0300 Message-Id: <835z8tqpha.fsf@gnu.org> From: Eli Zaretskii To: nisse@lysator.liu.se (Niels =?utf-8?Q?M=C3=B6ller?=) In-Reply-To: (nisse@lysator.liu.se) Subject: Re: bug#43207: 26.3; Strange bidi behavior 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: 43207 Cc: 43207@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 (---) tags 43207 notabug thanks > From: nisse@lysator.liu.se (Niels Möller) > Date: Fri, 04 Sep 2020 21:36:41 +0200 > > I get a pretty confusing behavior when I load the file at > > https://www.lysator.liu.se/~nisse/misc/emacs-bidi-bug-2.txt > > This is what it looks like > > https://www.lysator.liu.se/~nisse/misc/emacs-bidi-bug-2.png It is not a bug, but the expected behavior. The display of bidirectional text is affected by the "base paragraph direction", and in Emacs paragraphs are separated by empty lines. Since there's no empty line between the Arabic text and the following lines of Latin text, that Latin text "inherits" the base paragraph direction of right-to-left, set by the line that has only the Arabic text. You can either insert an empty line between that Arabic line, or you can force the entire buffer to be displayed with left-to-right base directionality by doing M-x set-variable RET bidi-paragraph-direction RET left-to-right RET This is all described in the Emacs manual, btw; see the node "Bidirectional Editing" there. > More specifically, C-f moves point in the expected "logical order" of > the text, which is mostly to the right on the screen. However pressing > the right-arrow key (bound to right-char) moves cursor to the left on > most parts of this text (the opposite direction of C-f (forward-char)), > despite the text being rendered in left-to-right order. This is also the expected behavior. It might be surprising for someone who isn't used to reading bidirectional text, especially when the base direction of a paragraph is the opposite of the natural text direction. But this is how most bidi-supporting applications out there behave. If you prefer the arrow keys to move the cursor visually, you can do M-x set-variable RET visual-order-cursor-movement RET t RET (This is also in the manual.) > I would have expected the later part of the file to be displayed > left-justified in left-to-right order, with the exception of the single > word "كاثولي" rendered right-to-left. That'd cause annoying change of justification to the left or right when Arabic or Latin words are pushed to the next line due to text insertion. From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 04 20:10:07 2020 Received: (at 43207-done) by debbugs.gnu.org; 5 Sep 2020 00:10:07 +0000 Received: from localhost ([127.0.0.1]:41039 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kELmR-0005Gy-2t for submit@debbugs.gnu.org; Fri, 04 Sep 2020 20:10:07 -0400 Received: from mail-ej1-f54.google.com ([209.85.218.54]:39817) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kELmO-0005GE-Ge for 43207-done@debbugs.gnu.org; Fri, 04 Sep 2020 20:10:05 -0400 Received: by mail-ej1-f54.google.com with SMTP id p9so10727117ejf.6 for <43207-done@debbugs.gnu.org>; Fri, 04 Sep 2020 17:10:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:in-reply-to:references:mime-version:date:message-id:subject:to :cc; bh=o4JdwsanQzbvXEppi2EPbuudZ10L6pR7om0K6ZVjAUY=; b=FnOp3/G3lEEZ1SkHXXckJ1hzLGvRwSeHWIai04Axz3D2RxHKt+9QQ1RSGx9W2NYoh1 vY5l7joRs6fzs4z2zdsvo/GxaHanLTSgb7Po/03riBX2jjb1MPg8W/zZlPYkXLIiYpH0 PCvHhFMHE9I40r1pgkdv/+IaMOYqoV/OnP5PS45SbbYbdvny8V21c0+LgDHCkIdoZJgV ge9a/zc7jAQC1Lk5elEQ98VAsXk/IiQHfJClnQWNva/mYkaMDQfTQoRmzNrfYW0l7Obt Ve2sDDkYR76Jy87dMPlmIvVUHns7Ue4y2TPZPazlEaapiuEhcVa3LHPEqqIv4IBYfIS1 2yeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:in-reply-to:references:mime-version:date :message-id:subject:to:cc; bh=o4JdwsanQzbvXEppi2EPbuudZ10L6pR7om0K6ZVjAUY=; b=DBKIHRTz/nVlIUzHgXM78AwvKcOixMw8DWRdLxrueR7UJS0nsRLtX6Meo4irPw3c+S pZdiEyU8dtz9Wbwbl6ibJi6bf/TwHbj9AulXx3Aw2TGTVDeHjgtOPlL2HbAMBjo+Y0Jc Sdl4jMUpNTaxBRKNSv7HwCpO8xw73eaDa2HDm5JVSeTzw0vcqP7sus4JGJZB9SXbV7iG F9JCvdtrDBnaW+KopGKSETaCE9ojOkvyee6uj9/gQtgEDW6WmoR+JSNyTP5NTkSY1Sff a8rIZwblcufv+3gOTQKPL99ssMA/GJc5F3Ukj8Hy7WeULeZ8pC9hDVNi4xExhc8sXqtG z7Zg== X-Gm-Message-State: AOAM532C6aN3pr+xrqKorbnc5KLKevdN7Wm02d3Zmc6cvG/e0oxNTNfR N8oYA7O1D+pH+6NK4UbmdZXXitv4l46uDV7bEXs= X-Google-Smtp-Source: ABdhPJyEjL2Y+H7nJcT3s7DXSXEV0EXh4CdAK79B6iiMbOkzcm4PZBAgBOOB7OJTtPdkxdYnCQaR47RhEXzQjEZja84= X-Received: by 2002:a17:906:e0c2:: with SMTP id gl2mr9872286ejb.160.1599264598655; Fri, 04 Sep 2020 17:09:58 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Sat, 5 Sep 2020 00:09:57 +0000 From: Stefan Kangas In-Reply-To: <835z8tqpha.fsf@gnu.org> References: <835z8tqpha.fsf@gnu.org> MIME-Version: 1.0 Date: Sat, 5 Sep 2020 00:09:57 +0000 Message-ID: Subject: Re: bug#43207: 26.3; Strange bidi behavior To: Eli Zaretskii , =?UTF-8?Q?Niels_M=C3=B6ller?= Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 43207-done Cc: 43207-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: -1.0 (-) Eli Zaretskii writes: > tags 43207 notabug > thanks I'm therefore closing this bug report. From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 05 02:46:59 2020 Received: (at 43207) by debbugs.gnu.org; 5 Sep 2020 06:46:59 +0000 Received: from localhost ([127.0.0.1]:41418 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kERyV-00037R-IG for submit@debbugs.gnu.org; Sat, 05 Sep 2020 02:46:59 -0400 Received: from mail.lysator.liu.se ([130.236.254.3]:35453) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kERyS-00037E-6E for 43207@debbugs.gnu.org; Sat, 05 Sep 2020 02:46:58 -0400 Received: from mail.lysator.liu.se (localhost [127.0.0.1]) by mail.lysator.liu.se (Postfix) with ESMTP id 429674000A; Sat, 5 Sep 2020 08:46:53 +0200 (CEST) Received: from fukushima.lysator.liu.se (fukushima.lysator.liu.se [IPv6:2001:6b0:17:f0a0::5d]) by mail.lysator.liu.se (Postfix) with SMTP id 034A340008; Sat, 5 Sep 2020 08:46:51 +0200 (CEST) Received: by fukushima.lysator.liu.se (sSMTP sendmail emulation); Sat, 05 Sep 2020 08:46:51 +0200 From: nisse@lysator.liu.se (Niels =?utf-8?Q?M=C3=B6ller?=) To: Eli Zaretskii Subject: Re: bug#43207: 26.3; Strange bidi behavior References: <835z8tqpha.fsf@gnu.org> Date: Sat, 05 Sep 2020 08:46:51 +0200 In-Reply-To: <835z8tqpha.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 04 Sep 2020 23:03:13 +0300") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: ClamAV using ClamSMTP X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 43207 Cc: 43207@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 (---) Eli Zaretskii writes: > It is not a bug, but the expected behavior. The display of > bidirectional text is affected by the "base paragraph direction", and > in Emacs paragraphs are separated by empty lines. Since there's no > empty line between the Arabic text and the following lines of Latin > text, that Latin text "inherits" the base paragraph direction of > right-to-left, set by the line that has only the Arabic text. Thanks for the explanation. So if the base paragraph direction is right-to-left, then right arrow is supposed to move logical backwards, like C-b. > You can either insert an empty line between that Arabic line,=20 Is there any way to tell emacs that a new paragraph starts, without inserting anything visible in the buffer? Some special unicode character, or emacs text property? > But this is how most bidi-supporting applications out there behave. For what it's worth, display in firefox works differently. The line of arabic text is right-to-left and right-justified on the screen, but following lines are left-to-right, more like what I expected. So it seems to use a different parapgraph heuristics than emacs. > If you prefer the arrow keys to move the cursor visually, you can do > > M-x set-variable RET visual-order-cursor-movement RET t RET > > (This is also in the manual.) I was also able to find this setting via the documentation for left-char/right-char. That's nice. Regards, /Niels --=20 Niels M=C3=B6ller. PGP-encrypted email is preferred. Keyid 368C6677. Internet email is subject to wholesale government surveillance. From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 05 03:36:10 2020 Received: (at 43207) by debbugs.gnu.org; 5 Sep 2020 07:36:10 +0000 Received: from localhost ([127.0.0.1]:41439 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kESk6-0004IU-Fx for submit@debbugs.gnu.org; Sat, 05 Sep 2020 03:36:10 -0400 Received: from eggs.gnu.org ([209.51.188.92]:47200) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kESk4-0004IG-6z for 43207@debbugs.gnu.org; Sat, 05 Sep 2020 03:36:08 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:59616) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kESjx-0002WV-KM; Sat, 05 Sep 2020 03:36:01 -0400 Received: from [176.228.60.248] (port=4258 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kESjw-00088x-SZ; Sat, 05 Sep 2020 03:36:01 -0400 Date: Sat, 05 Sep 2020 10:35:52 +0300 Message-Id: <83o8mkptev.fsf@gnu.org> From: Eli Zaretskii To: nisse@lysator.liu.se (Niels =?utf-8?Q?M=C3=B6ller?=) In-Reply-To: (nisse@lysator.liu.se) Subject: Re: bug#43207: 26.3; Strange bidi behavior References: <835z8tqpha.fsf@gnu.org> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 43207 Cc: 43207@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: nisse@lysator.liu.se (Niels Möller) > Cc: 43207@debbugs.gnu.org > Date: Sat, 05 Sep 2020 08:46:51 +0200 > > Thanks for the explanation. So if the base paragraph direction is > right-to-left, then right arrow is supposed to move logical backwards, > like C-b. Yes. > > You can either insert an empty line between that Arabic line, > > Is there any way to tell emacs that a new paragraph starts, without > inserting anything visible in the buffer? Some special unicode > character, or emacs text property? No, not at the moment. FWIW, I don't think there's a significant need for such a feature, given the related features we already have. > > But this is how most bidi-supporting applications out there behave. > > For what it's worth, display in firefox works differently. The line of > arabic text is right-to-left and right-justified on the screen, but > following lines are left-to-right, more like what I expected. So it > seems to use a different parapgraph heuristics than emacs. Yes, the Unicode Standard allows some leeway in this matter, and Emacs uses it. Firefox is not a text editor, so it doesn't need to cope with the various situations we have every day in Emacs, where text filling rearranges the words at the beginning of a physical line, which generally can change the base direction at random (because the base direction depends on the first string directional character of the first line of the paragraph). Because someone requested strict adherence to the Unicode Bidirectional Algorithm in this particular matter, Emacs does support the "each physical line starts a new paragraph" behavior; you will find in the manual how to set that up using the variables bidi-paragraph-start-re and bidi-paragraph-separate-re. But I don't recommend such a setup in Emacs, for the reasons I described above. From unknown Tue Jun 17 20:20:01 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 03 Oct 2020 11:24:04 +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