* How to handle mixed LtR and RtL scripts in tabulated lists
@ 2020-09-15 11:45 Joost Kremers
2020-09-15 15:55 ` Eli Zaretskii
0 siblings, 1 reply; 3+ messages in thread
From: Joost Kremers @ 2020-09-15 11:45 UTC (permalink / raw)
To: gnu-emacs-help
Hi,
I'm wondering if there is a good way to create tabulated lists
that have both left-to-right and right-to-left scripts. I'm
running into the problem that the rtl entries have the columns in
the "wrong" order.
I'm putting "wrong" in quotes here, because for the actual rtl
entry, the columns would be in the right order. It's just that
mixing such entries with ltr entries yields bad results.
Details of the actual problem can be found in this Github issue:
https://github.com/joostkremers/ebib/issues/172
Basically, I'm creating a tabulated list of BibTeX entries, where
each entry should have the columns "Key", "Author", "Year",
"Title", in that order. However, entries that contain (in the
example issue linked to) Hebrew text (specifically author name and
title), the order of the columns ends up as (from left to right):
"Key", "Title", "Year", "Author", the last three columns being in
the "wrong" order compared to the ltr entries.
Currently, I'm using the built-in function
`truncate-string-to-width` to create the rows of the tabulated
list. (At the time I decided against using `tabulated-list-mode`,
because I had some requirements that `tabulated-list-mode` didn't
seem to handle. I don't remember the details...)
Is there a better way to this sort of thing? Should I be handling
this differently?
TIA for any and all suggestions.
--
Joost Kremers
Life has its moments
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: How to handle mixed LtR and RtL scripts in tabulated lists
2020-09-15 11:45 How to handle mixed LtR and RtL scripts in tabulated lists Joost Kremers
@ 2020-09-15 15:55 ` Eli Zaretskii
2020-09-15 17:59 ` Joost Kremers
0 siblings, 1 reply; 3+ messages in thread
From: Eli Zaretskii @ 2020-09-15 15:55 UTC (permalink / raw)
To: Joost Kremers; +Cc: gnu-emacs-help
> From: Joost Kremers <joostkremers@fastmail.fm>
> Date: Tue, 15 Sep 2020 13:45:50 +0200
>
> I'm wondering if there is a good way to create tabulated lists
> that have both left-to-right and right-to-left scripts. I'm
> running into the problem that the rtl entries have the columns in
> the "wrong" order.
>
> I'm putting "wrong" in quotes here, because for the actual rtl
> entry, the columns would be in the right order. It's just that
> mixing such entries with ltr entries yields bad results.
>
> Details of the actual problem can be found in this Github issue:
>
> https://github.com/joostkremers/ebib/issues/172
This is actually covered in the ELisp manual, in the node
"Bidirectional Display". It suggests several different ways of
handling this, I'm quite sure one of them will satisfy your needs
without being too much of a burden.
> Currently, I'm using the built-in function
> `truncate-string-to-width` to create the rows of the tabulated
> list.
Not sure this part is related. If there are bidi aspects that
interfere with this truncation, please tell the details.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: How to handle mixed LtR and RtL scripts in tabulated lists
2020-09-15 15:55 ` Eli Zaretskii
@ 2020-09-15 17:59 ` Joost Kremers
0 siblings, 0 replies; 3+ messages in thread
From: Joost Kremers @ 2020-09-15 17:59 UTC (permalink / raw)
To: help-gnu-emacs
On Tue, Sep 15 2020, Eli Zaretskii wrote:
> This is actually covered in the ELisp manual, in the node
> "Bidirectional Display". It suggests several different ways of
> handling this, I'm quite sure one of them will satisfy your
> needs
> without being too much of a burden.
Thanks, Eli, that's indeed the place I needed to look. I thought
`truncate-width-to-string` was part of the problem, so I didn't
think to look elsewhere in the manual...
I'm now passing the strings that make up the individual cells to
`bidi-string-mark-left-to-right`, which solves the problem, at
least for the test case that I have.
>> Currently, I'm using the built-in function
>> `truncate-string-to-width` to create the rows of the tabulated
>> list.
>
> Not sure this part is related. If there are bidi aspects that
> interfere with this truncation, please tell the details.
I suspect you are right. If I do run into additional issues, I'll
post here, but for the moment, it looks alright.
Thanks again,
--
Joost Kremers
Life has its moments
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-09-15 17:59 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-09-15 11:45 How to handle mixed LtR and RtL scripts in tabulated lists Joost Kremers
2020-09-15 15:55 ` Eli Zaretskii
2020-09-15 17:59 ` Joost Kremers
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).