From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Itai Berli Newsgroups: gmane.emacs.bugs Subject: bug#27525: 25.1; Line wrapping of bidi paragraphs Date: Fri, 21 Jul 2017 09:19:25 +0300 Message-ID: References: <8337abobuz.fsf@gnu.org> <87eftpa30a.fsf@blei.turtle-trading.net> <83a84djweb.fsf@gnu.org> <83shhsbakk.fsf@gnu.org> <83lgnjbsqw.fsf@gnu.org> <83bmofbc0f.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="94eb2c1cd6d43a19eb0554cddb5a" X-Trace: blaine.gmane.org 1500618076 9746 195.159.176.226 (21 Jul 2017 06:21:16 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 21 Jul 2017 06:21:16 +0000 (UTC) To: 27525@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jul 21 08:21:11 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dYRJG-0002B0-3e for geb-bug-gnu-emacs@m.gmane.org; Fri, 21 Jul 2017 08:21:10 +0200 Original-Received: from localhost ([::1]:41257 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dYRJL-00024D-M1 for geb-bug-gnu-emacs@m.gmane.org; Fri, 21 Jul 2017 02:21:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36283) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dYRJD-000225-24 for bug-gnu-emacs@gnu.org; Fri, 21 Jul 2017 02:21:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dYRJ8-00078q-9P for bug-gnu-emacs@gnu.org; Fri, 21 Jul 2017 02:21:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:47635) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dYRJ8-00078h-68 for bug-gnu-emacs@gnu.org; Fri, 21 Jul 2017 02:21:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dYRJ7-0001Ll-Vq for bug-gnu-emacs@gnu.org; Fri, 21 Jul 2017 02:21:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Itai Berli Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 21 Jul 2017 06:21:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 27525 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 27525-submit@debbugs.gnu.org id=B27525.15006180155127 (code B ref 27525); Fri, 21 Jul 2017 06:21:01 +0000 Original-Received: (at 27525) by debbugs.gnu.org; 21 Jul 2017 06:20:15 +0000 Original-Received: from localhost ([127.0.0.1]:50312 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dYRIM-0001Kd-GJ for submit@debbugs.gnu.org; Fri, 21 Jul 2017 02:20:14 -0400 Original-Received: from mail-wr0-f182.google.com ([209.85.128.182]:38568) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dYRIK-0001KP-Jp for 27525@debbugs.gnu.org; Fri, 21 Jul 2017 02:20:13 -0400 Original-Received: by mail-wr0-f182.google.com with SMTP id f21so21888259wrf.5 for <27525@debbugs.gnu.org>; Thu, 20 Jul 2017 23:20:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=pvd1zQsa3+RBYYB02azJJyooZhenpvNpritL7lRnIhk=; b=Qn8txy3eWehJPZWo2D7imErI+NDdevcCJKSyeLbteOyEWvTUKb0yIvbAd+SEEdGZgS +xYUjOhlkuwjF2UzzstHKbIi+CGAE/6xY2b4evgVCc5aIna+U+Y/w9mpwKoUAAwkXDzM O2SquycfZNxPN4mPLKLzPG7WoLUe/yJbPmMQZDIu+bPK7L6n/COArGlLWN8I+JI9T5W2 WjGcbcTQT519zYb6KNnGgUZHgojXJWR/TukG4pHDMoS/zC0mT5VG0Ga9QK4KotAKMGC7 0WKq2/AWZVhXwWzVlry5JgPTn6CJ1aUMiFwYUih+5mYMHj4Aziooa2nqiWEbDiEo2Fdv TE2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=pvd1zQsa3+RBYYB02azJJyooZhenpvNpritL7lRnIhk=; b=raJb48Ju5xgNcfA1fSxfBhzhAayOeGiFZonCC7JNH8heDqa1gWEfIX1u1u4rg3OBxx zySWvR/0iyPraK17zn7q7eUQRT4h/0rLSWfbELHzQBGm/v8xz9nNqR+teW3uFFtmet6c Zuar+nJZdZg7Jm+0/BfRX4CfYqT4DJ5zupZQ1NTCx6cRjdnZoUY/O9dAygmBIWtc7ZJZ HXldVNop9uGK9b5+i3u0yTaZ1TABAhR0dx2PZ029wg08rG91+zd+DDzIBP/5WyBZz87N Z6rJsDl4JGpy18JvAnAaaVSwIEJsVcHkMpcX9g+GA7+l1u80aR7tQzn72z6mUOZDQ8yd eeMQ== X-Gm-Message-State: AIVw111m9Om0LmDL/qhTCblYz11VcdTSd41OcjVSW2WTczLTz9ASilRm SJmK+H7ix0HNn8OLAyBCtV5/ZqCJ1up2 X-Received: by 10.223.170.7 with SMTP id p7mr8251631wrd.79.1500618006598; Thu, 20 Jul 2017 23:20:06 -0700 (PDT) Original-Received: by 10.28.197.196 with HTTP; Thu, 20 Jul 2017 23:19:25 -0700 (PDT) In-Reply-To: <83bmofbc0f.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:134816 Archived-At: --94eb2c1cd6d43a19eb0554cddb5a Content-Type: text/plain; charset="UTF-8" You sure put a lot of thought and effort into it. Thank you for that. Now that I have downloaded the source code, I'd like to take a look at this problem first hand. I'm not a programmer, not even an amateur one, but I can sometimes make sense of the general gist of code when I read it, and I'd like to take a look at the part of code that's responsible for the present bug, maybe put a breakpoint here and there and give it a test run to get a feel of how it works, and why it misses the mark when it comes to line wrapping bidi paragraphs. Could you please give me some pointers: what files should I look into, what functions should I read, possibly even suggestions for where to put breakpoints and which variables to watch. I'm not asking for a comprehensive and detailed run down of this feature; just a starting point(s). Every tip and suggestion will be welcome. On Thu, Jul 20, 2017 at 2:09 PM, Eli Zaretskii wrote: > > Resent-Sender: help-debbugs@gnu.org > > From: Itai Berli > > Date: Thu, 20 Jul 2017 10:01:33 +0300 > > > > I see no reason to continue this discussion any further. > > Thank you. > > > One thing I'm curious about, though. What bidi features exist in Emacs, > half of which the other editors don't > > have? Which features were you referring to when you wrote that, thanks > to them, "10 years later, Emacs still > > shines among all the bidi-aware editors out there"? > > . For starters, all the UBA features are fully supported, including > the directional isolates and bracket-matching (a.k.a. "BPA"). > . Support for bidirectional display on both GUI and text-mode terminals. > . Both logical-order and visual-order cursor motion. > . Full support for Arabic shaping and other complex-script shaping > features in bidirectional text (e.g., Hebrew "nikkud"). > . Bidi formatting controls are visible on screen, so users don't need > to guess why display looks like it does. > . Variables to control where paragraphs begin and end, for the > purposes of determining base paragraph direction. > . Variables to disable mirroring of parentheses due to bidi context, > and even disable bidi reordering entirely, if needed. > . Lisp functions that are necessary when writing bidi-aware > customizations and features: > . a function that returns base paragraph direction at point > . a function that returns resolved bidi levels for a line > . a function that takes a string and wraps it so that it could be > concatenated with other strings without fear of producing jumbled > display due to reordering (important for tabular display) > . a function to find characters whose directionality was overridden > by bidi controls (which could be used to maliciously dupe the > user to think a string is not what it really is) > . a function to return a substring of buffer text surrounded by > bidi controls that make sure its visual appearance will not > change when copied to a different portion of text > > And that is even before we consider Emacs-only features, which those > other editors can only dream about, like mouse-highlight, display and > overlay strings, invisible text, text alignment on display, etc. -- > all of which are bidi-aware in Emacs. > --94eb2c1cd6d43a19eb0554cddb5a Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
You sure put a lot of thought and effort into it. Tha= nk you for that.

Now that I have downloaded the source = code, I'd like to take a look at this problem first hand. I'm not a= programmer, not even an amateur one, but I can sometimes make sense of the= general gist of code when I read it, and I'd like to take a look at th= e part of code that's responsible for the present bug, maybe put a brea= kpoint here and there and give it a test run to get a feel of how it works,= and why it misses the mark when it comes to line wrapping bidi paragraphs.=

Could you please give me some pointers: what files shou= ld I look into, what functions should I read, possibly even suggestions for= where to put breakpoints and which variables to watch. I'm not asking = for a comprehensive and detailed run down of this feature; just a starting = point(s). Every tip and suggestion will be welcome.

On Thu, Jul 20, 2017 at 2:09 PM, El= i Zaretskii <eliz@gnu.org> wrote:
> Resent-Sender: help-debbugs@gnu.org
> From: Itai Berli <itai.berli@gmail.com>
> Date: Thu, 20 Jul 2017 10:01:33 +0300
>
> I see no reason to continue this discussion any further.

Thank you.

> One thing I'm curious about, though. What bidi features exist in E= macs, half of which the other editors don't
> have? Which features were you referring to when you wrote that, thanks= to them, "10 years later, Emacs still
> shines among all the bidi-aware editors out there"?

=C2=A0. For starters, all the UBA features are fully supported, incl= uding
=C2=A0 =C2=A0the directional isolates and bracket-matching (a.k.a. "BP= A").
=C2=A0. Support for bidirectional display on both GUI and text-mode termina= ls.
=C2=A0. Both logical-order and visual-order cursor motion.
=C2=A0. Full support for Arabic shaping and other complex-script shaping =C2=A0 =C2=A0features in bidirectional text (e.g., Hebrew "nikkud"= ;).
=C2=A0. Bidi formatting controls are visible on screen, so users don't = need
=C2=A0 =C2=A0to guess why display looks like it does.
=C2=A0. Variables to control where paragraphs begin and end, for the
=C2=A0 =C2=A0purposes of determining base paragraph direction.
=C2=A0. Variables to disable mirroring of parentheses due to bidi context,<= br> =C2=A0 =C2=A0and even disable bidi reordering entirely, if needed.
=C2=A0. Lisp functions that are necessary when writing bidi-aware
=C2=A0 =C2=A0customizations and features:
=C2=A0 =C2=A0. a function that returns base paragraph direction at point =C2=A0 =C2=A0. a function that returns resolved bidi levels for a line
=C2=A0 =C2=A0. a function that takes a string and wraps it so that it could= be
=C2=A0 =C2=A0 =C2=A0concatenated with other strings without fear of produci= ng jumbled
=C2=A0 =C2=A0 =C2=A0display due to reordering (important for tabular displa= y)
=C2=A0 =C2=A0. a function to find characters whose directionality was overr= idden
=C2=A0 =C2=A0 =C2=A0by bidi controls (which could be used to maliciously du= pe the
=C2=A0 =C2=A0 =C2=A0user to think a string is not what it really is)
=C2=A0 =C2=A0. a function to return a substring of buffer text surrounded b= y
=C2=A0 =C2=A0 =C2=A0bidi controls that make sure its visual appearance will= not
=C2=A0 =C2=A0 =C2=A0change when copied to a different portion of text

And that is even before we consider Emacs-only features, which those
other editors can only dream about, like mouse-highlight, display and
overlay strings, invisible text, text alignment on display, etc. --
all of which are bidi-aware in Emacs.

--94eb2c1cd6d43a19eb0554cddb5a--