emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Right-to-left text in org mode
@ 2013-06-24 17:22 Manuel GJT
  2013-06-24 17:49 ` Dov Grobgeld
  0 siblings, 1 reply; 6+ messages in thread
From: Manuel GJT @ 2013-06-24 17:22 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 975 bytes --]

Hello everyone,

I need to work in an org buffer with both left-to-right and right-to-left
text. Although the character directionality and composition works fine,
when writing paragraphs with visual-line-mode on the lines get inverted,
i.e., the line

ZYX CBA

appears as

ZYX
CBA

instead of

CBA
ZYX

The section "22.20 Bidirectional Editing" of the Emacs manual suggests
forcing the directionality of the paragraph with RIGHT-TO-LEFT MARK, but
this does not seem to work: even with such a character beginning the line,
(current-bidi-paragraph-direction) returns "left-to-right".

The RTL MARK seems to work just fine in tables.

When written in a clean text-mode buffer the same text appears with proper
directionality. However switching from org-mode to text-mode does not
correct directionality in said paragraphs. The issue persists even when
visiting the file with emacs -Q.

org-version 8.0.3, same issue with v. 7.9.4

Your help is much appreciated.

-- 
Manuel GJT

[-- Attachment #2: Type: text/html, Size: 1113 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Right-to-left text in org mode
  2013-06-24 17:22 Right-to-left text in org mode Manuel GJT
@ 2013-06-24 17:49 ` Dov Grobgeld
  2013-06-25  4:27   ` Manuel GJT
  0 siblings, 1 reply; 6+ messages in thread
From: Dov Grobgeld @ 2013-06-24 17:49 UTC (permalink / raw)
  To: Manuel GJT; +Cc: emacs-orgmode

I was able to reproduce this behavior only with by forcing the
paragraph direction to LTR or equivilantly by having a first strong
LTR character in the beginning of the paragraph. Please provide more
information about your environment, and someone might be able to help
you.

Regards,
Dov


On Mon, Jun 24, 2013 at 8:22 PM, Manuel GJT <valhifi@gmail.com> wrote:
> Hello everyone,
>
> I need to work in an org buffer with both left-to-right and right-to-left
> text. Although the character directionality and composition works fine, when
> writing paragraphs with visual-line-mode on the lines get inverted, i.e.,
> the line
>
> ZYX CBA
>
> appears as
>
> ZYX
> CBA
>
> instead of
>
> CBA
> ZYX
>
> The section "22.20 Bidirectional Editing" of the Emacs manual suggests
> forcing the directionality of the paragraph with RIGHT-TO-LEFT MARK, but
> this does not seem to work: even with such a character beginning the line,
> (current-bidi-paragraph-direction) returns "left-to-right".
>
> The RTL MARK seems to work just fine in tables.
>
> When written in a clean text-mode buffer the same text appears with proper
> directionality. However switching from org-mode to text-mode does not
> correct directionality in said paragraphs. The issue persists even when
> visiting the file with emacs -Q.
>
> org-version 8.0.3, same issue with v. 7.9.4
>
> Your help is much appreciated.
>
> --
> Manuel GJT

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Right-to-left text in org mode
  2013-06-24 17:49 ` Dov Grobgeld
@ 2013-06-25  4:27   ` Manuel GJT
  2013-06-25  7:03     ` Dov Grobgeld
  0 siblings, 1 reply; 6+ messages in thread
From: Manuel GJT @ 2013-06-25  4:27 UTC (permalink / raw)
  To: Dov Grobgeld; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 2150 bytes --]

Specifically what additional information should I provide? This happens to
me even without my .emacs loaded. I'm running Ubuntu 12.04 with
m17n-(db/contrib), libm17n-(0/dev) installed.

It seems that in org mode is forcing LTR in mixed-directionality texts
since, for example, a heading with RTL text will not change the stars to be
right-aligned, and the cursor's behavior in org mode is different than in a
clean buffer.

Perhaps you could show me how to ignore any previous paragraph settings
other than with R-T-L MARK?


Kind regards,

Manuel GJT


On Mon, Jun 24, 2013 at 12:49 PM, Dov Grobgeld <dov.grobgeld@gmail.com>wrote:

> I was able to reproduce this behavior only with by forcing the
> paragraph direction to LTR or equivilantly by having a first strong
> LTR character in the beginning of the paragraph. Please provide more
> information about your environment, and someone might be able to help
> you.
>
> Regards,
> Dov
>
>
> On Mon, Jun 24, 2013 at 8:22 PM, Manuel GJT <valhifi@gmail.com> wrote:
> > Hello everyone,
> >
> > I need to work in an org buffer with both left-to-right and right-to-left
> > text. Although the character directionality and composition works fine,
> when
> > writing paragraphs with visual-line-mode on the lines get inverted, i.e.,
> > the line
> >
> > ZYX CBA
> >
> > appears as
> >
> > ZYX
> > CBA
> >
> > instead of
> >
> > CBA
> > ZYX
> >
> > The section "22.20 Bidirectional Editing" of the Emacs manual suggests
> > forcing the directionality of the paragraph with RIGHT-TO-LEFT MARK, but
> > this does not seem to work: even with such a character beginning the
> line,
> > (current-bidi-paragraph-direction) returns "left-to-right".
> >
> > The RTL MARK seems to work just fine in tables.
> >
> > When written in a clean text-mode buffer the same text appears with
> proper
> > directionality. However switching from org-mode to text-mode does not
> > correct directionality in said paragraphs. The issue persists even when
> > visiting the file with emacs -Q.
> >
> > org-version 8.0.3, same issue with v. 7.9.4
> >
> > Your help is much appreciated.
> >
> > --
> > Manuel GJT
>



-- 
Manuel GJT

[-- Attachment #2: Type: text/html, Size: 2923 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Right-to-left text in org mode
  2013-06-25  4:27   ` Manuel GJT
@ 2013-06-25  7:03     ` Dov Grobgeld
  2013-06-26  1:49       ` Manuel GJT
  0 siblings, 1 reply; 6+ messages in thread
From: Dov Grobgeld @ 2013-06-25  7:03 UTC (permalink / raw)
  To: Manuel GJT; +Cc: emacs-orgmode

A work around seems to be to provide an empty line between the LTR and
the RTL paragraph. I.e. instead of

* this is ltr
* THIS IS RTL

do:

* this is ltr

* THIS IS RTL

But you are correct that the wrapping of LTR paragraphs with RTL text
is buggy. This bug seems to have nothing to do with org mode, but
happens e.g. in text mode and fundamental mode as well. You should
raise this issue on the emacs-list or file a bug with emacs.

On Tue, Jun 25, 2013 at 7:27 AM, Manuel GJT <valhifi@gmail.com> wrote:
> Specifically what additional information should I provide? This happens to
> me even without my .emacs loaded. I'm running Ubuntu 12.04 with
> m17n-(db/contrib), libm17n-(0/dev) installed.
>
> It seems that in org mode is forcing LTR in mixed-directionality texts
> since, for example, a heading with RTL text will not change the stars to be
> right-aligned, and the cursor's behavior in org mode is different than in a
> clean buffer.
>
> Perhaps you could show me how to ignore any previous paragraph settings
> other than with R-T-L MARK?
>
>
> Kind regards,
>
> Manuel GJT
>
>
> On Mon, Jun 24, 2013 at 12:49 PM, Dov Grobgeld <dov.grobgeld@gmail.com>
> wrote:
>>
>> I was able to reproduce this behavior only with by forcing the
>> paragraph direction to LTR or equivilantly by having a first strong
>> LTR character in the beginning of the paragraph. Please provide more
>> information about your environment, and someone might be able to help
>> you.
>>
>> Regards,
>> Dov
>>
>>
>> On Mon, Jun 24, 2013 at 8:22 PM, Manuel GJT <valhifi@gmail.com> wrote:
>> > Hello everyone,
>> >
>> > I need to work in an org buffer with both left-to-right and
>> > right-to-left
>> > text. Although the character directionality and composition works fine,
>> > when
>> > writing paragraphs with visual-line-mode on the lines get inverted,
>> > i.e.,
>> > the line
>> >
>> > ZYX CBA
>> >
>> > appears as
>> >
>> > ZYX
>> > CBA
>> >
>> > instead of
>> >
>> > CBA
>> > ZYX
>> >
>> > The section "22.20 Bidirectional Editing" of the Emacs manual suggests
>> > forcing the directionality of the paragraph with RIGHT-TO-LEFT MARK, but
>> > this does not seem to work: even with such a character beginning the
>> > line,
>> > (current-bidi-paragraph-direction) returns "left-to-right".
>> >
>> > The RTL MARK seems to work just fine in tables.
>> >
>> > When written in a clean text-mode buffer the same text appears with
>> > proper
>> > directionality. However switching from org-mode to text-mode does not
>> > correct directionality in said paragraphs. The issue persists even when
>> > visiting the file with emacs -Q.
>> >
>> > org-version 8.0.3, same issue with v. 7.9.4
>> >
>> > Your help is much appreciated.
>> >
>> > --
>> > Manuel GJT
>
>
>
>
> --
> Manuel GJT

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Right-to-left text in org mode
  2013-06-25  7:03     ` Dov Grobgeld
@ 2013-06-26  1:49       ` Manuel GJT
  2013-06-28 11:17         ` Dov Grobgeld
  0 siblings, 1 reply; 6+ messages in thread
From: Manuel GJT @ 2013-06-26  1:49 UTC (permalink / raw)
  To: Dov Grobgeld; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 3772 bytes --]

It turns out that org mode does force directionality in its buffers. I
found in org.el the line

5308  (setq bidi-paragraph-direction 'left-to-right)

However, bidi-paragraph-direction is always buffer local when set. That
explains why switching to other mode does not help.

The solution is to set bidi-paragraph-direction to nil in org buffers with
mixed LTR and RTL texts. This, however, might change the alignment of some
headings to right-aligned. But the bidi markers now work just fine, so it's
just a matter of placing them wisely.

I appreciate the time you took for this little discussion. It helped me get
a clearer picture of the inner workings of bidi and emacs.


Kind regards,

Manuel GJT


On Tue, Jun 25, 2013 at 2:03 AM, Dov Grobgeld <dov.grobgeld@gmail.com>wrote:

> A work around seems to be to provide an empty line between the LTR and
> the RTL paragraph. I.e. instead of
>
> * this is ltr
> * THIS IS RTL
>
> do:
>
> * this is ltr
>
> * THIS IS RTL
>
> But you are correct that the wrapping of LTR paragraphs with RTL text
> is buggy. This bug seems to have nothing to do with org mode, but
> happens e.g. in text mode and fundamental mode as well. You should
> raise this issue on the emacs-list or file a bug with emacs.
>
> On Tue, Jun 25, 2013 at 7:27 AM, Manuel GJT <valhifi@gmail.com> wrote:
> > Specifically what additional information should I provide? This happens
> to
> > me even without my .emacs loaded. I'm running Ubuntu 12.04 with
> > m17n-(db/contrib), libm17n-(0/dev) installed.
> >
> > It seems that in org mode is forcing LTR in mixed-directionality texts
> > since, for example, a heading with RTL text will not change the stars to
> be
> > right-aligned, and the cursor's behavior in org mode is different than
> in a
> > clean buffer.
> >
> > Perhaps you could show me how to ignore any previous paragraph settings
> > other than with R-T-L MARK?
> >
> >
> > Kind regards,
> >
> > Manuel GJT
> >
> >
> > On Mon, Jun 24, 2013 at 12:49 PM, Dov Grobgeld <dov.grobgeld@gmail.com>
> > wrote:
> >>
> >> I was able to reproduce this behavior only with by forcing the
> >> paragraph direction to LTR or equivilantly by having a first strong
> >> LTR character in the beginning of the paragraph. Please provide more
> >> information about your environment, and someone might be able to help
> >> you.
> >>
> >> Regards,
> >> Dov
> >>
> >>
> >> On Mon, Jun 24, 2013 at 8:22 PM, Manuel GJT <valhifi@gmail.com> wrote:
> >> > Hello everyone,
> >> >
> >> > I need to work in an org buffer with both left-to-right and
> >> > right-to-left
> >> > text. Although the character directionality and composition works
> fine,
> >> > when
> >> > writing paragraphs with visual-line-mode on the lines get inverted,
> >> > i.e.,
> >> > the line
> >> >
> >> > ZYX CBA
> >> >
> >> > appears as
> >> >
> >> > ZYX
> >> > CBA
> >> >
> >> > instead of
> >> >
> >> > CBA
> >> > ZYX
> >> >
> >> > The section "22.20 Bidirectional Editing" of the Emacs manual suggests
> >> > forcing the directionality of the paragraph with RIGHT-TO-LEFT MARK,
> but
> >> > this does not seem to work: even with such a character beginning the
> >> > line,
> >> > (current-bidi-paragraph-direction) returns "left-to-right".
> >> >
> >> > The RTL MARK seems to work just fine in tables.
> >> >
> >> > When written in a clean text-mode buffer the same text appears with
> >> > proper
> >> > directionality. However switching from org-mode to text-mode does not
> >> > correct directionality in said paragraphs. The issue persists even
> when
> >> > visiting the file with emacs -Q.
> >> >
> >> > org-version 8.0.3, same issue with v. 7.9.4
> >> >
> >> > Your help is much appreciated.
> >> >
> >> > --
> >> > Manuel GJT
> >
> >
> >
> >
> > --
> > Manuel GJT
>



-- 
Manuel GJT

[-- Attachment #2: Type: text/html, Size: 5240 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Right-to-left text in org mode
  2013-06-26  1:49       ` Manuel GJT
@ 2013-06-28 11:17         ` Dov Grobgeld
  0 siblings, 0 replies; 6+ messages in thread
From: Dov Grobgeld @ 2013-06-28 11:17 UTC (permalink / raw)
  To: Manuel GJT; +Cc: emacs-orgmode

You are right, I forgot about that. I also have (setq
bidi-paragraph-direction nil) in my org-mode-hook.

Regadrs,
Dov


On Wed, Jun 26, 2013 at 4:49 AM, Manuel GJT <valhifi@gmail.com> wrote:
> It turns out that org mode does force directionality in its buffers. I found
> in org.el the line
>
> 5308  (setq bidi-paragraph-direction 'left-to-right)
>
> However, bidi-paragraph-direction is always buffer local when set. That
> explains why switching to other mode does not help.
>
> The solution is to set bidi-paragraph-direction to nil in org buffers with
> mixed LTR and RTL texts. This, however, might change the alignment of some
> headings to right-aligned. But the bidi markers now work just fine, so it's
> just a matter of placing them wisely.
>
> I appreciate the time you took for this little discussion. It helped me get
> a clearer picture of the inner workings of bidi and emacs.
>
>
> Kind regards,
>
> Manuel GJT
>
>
> On Tue, Jun 25, 2013 at 2:03 AM, Dov Grobgeld <dov.grobgeld@gmail.com>
> wrote:
>>
>> A work around seems to be to provide an empty line between the LTR and
>> the RTL paragraph. I.e. instead of
>>
>> * this is ltr
>> * THIS IS RTL
>>
>> do:
>>
>> * this is ltr
>>
>> * THIS IS RTL
>>
>> But you are correct that the wrapping of LTR paragraphs with RTL text
>> is buggy. This bug seems to have nothing to do with org mode, but
>> happens e.g. in text mode and fundamental mode as well. You should
>> raise this issue on the emacs-list or file a bug with emacs.
>>
>> On Tue, Jun 25, 2013 at 7:27 AM, Manuel GJT <valhifi@gmail.com> wrote:
>> > Specifically what additional information should I provide? This happens
>> > to
>> > me even without my .emacs loaded. I'm running Ubuntu 12.04 with
>> > m17n-(db/contrib), libm17n-(0/dev) installed.
>> >
>> > It seems that in org mode is forcing LTR in mixed-directionality texts
>> > since, for example, a heading with RTL text will not change the stars to
>> > be
>> > right-aligned, and the cursor's behavior in org mode is different than
>> > in a
>> > clean buffer.
>> >
>> > Perhaps you could show me how to ignore any previous paragraph settings
>> > other than with R-T-L MARK?
>> >
>> >
>> > Kind regards,
>> >
>> > Manuel GJT
>> >
>> >
>> > On Mon, Jun 24, 2013 at 12:49 PM, Dov Grobgeld <dov.grobgeld@gmail.com>
>> > wrote:
>> >>
>> >> I was able to reproduce this behavior only with by forcing the
>> >> paragraph direction to LTR or equivilantly by having a first strong
>> >> LTR character in the beginning of the paragraph. Please provide more
>> >> information about your environment, and someone might be able to help
>> >> you.
>> >>
>> >> Regards,
>> >> Dov
>> >>
>> >>
>> >> On Mon, Jun 24, 2013 at 8:22 PM, Manuel GJT <valhifi@gmail.com> wrote:
>> >> > Hello everyone,
>> >> >
>> >> > I need to work in an org buffer with both left-to-right and
>> >> > right-to-left
>> >> > text. Although the character directionality and composition works
>> >> > fine,
>> >> > when
>> >> > writing paragraphs with visual-line-mode on the lines get inverted,
>> >> > i.e.,
>> >> > the line
>> >> >
>> >> > ZYX CBA
>> >> >
>> >> > appears as
>> >> >
>> >> > ZYX
>> >> > CBA
>> >> >
>> >> > instead of
>> >> >
>> >> > CBA
>> >> > ZYX
>> >> >
>> >> > The section "22.20 Bidirectional Editing" of the Emacs manual
>> >> > suggests
>> >> > forcing the directionality of the paragraph with RIGHT-TO-LEFT MARK,
>> >> > but
>> >> > this does not seem to work: even with such a character beginning the
>> >> > line,
>> >> > (current-bidi-paragraph-direction) returns "left-to-right".
>> >> >
>> >> > The RTL MARK seems to work just fine in tables.
>> >> >
>> >> > When written in a clean text-mode buffer the same text appears with
>> >> > proper
>> >> > directionality. However switching from org-mode to text-mode does not
>> >> > correct directionality in said paragraphs. The issue persists even
>> >> > when
>> >> > visiting the file with emacs -Q.
>> >> >
>> >> > org-version 8.0.3, same issue with v. 7.9.4
>> >> >
>> >> > Your help is much appreciated.
>> >> >
>> >> > --
>> >> > Manuel GJT
>> >
>> >
>> >
>> >
>> > --
>> > Manuel GJT
>
>
>
>
> --
> Manuel GJT

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-06-28 11:17 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-24 17:22 Right-to-left text in org mode Manuel GJT
2013-06-24 17:49 ` Dov Grobgeld
2013-06-25  4:27   ` Manuel GJT
2013-06-25  7:03     ` Dov Grobgeld
2013-06-26  1:49       ` Manuel GJT
2013-06-28 11:17         ` Dov Grobgeld

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).