emacseshell

Eshell for RTL File Names


By default, Emacs 24 can handle Arabic, Hebrew, and other right-to-left (RTL) languages. I have multilingual term emulators that handle this in X, but I would like to use eshell inside emacs to see the non-English character filenames (and boy do I have many). When I use eshell, the characters are not in the correct order and it spells out gibberish. (setq-default bidi-display-reordering t) (which is default) makes no difference obviously.

Is this possible?


Solution

  • I believe you're getting double reordering by emacs + mlterm, and need to disable one.

    Your screenshot shows in upper half mlterm successfully detects line-by-line base direction and reorders characters. And Emacs 24 by default reorders bidi in the terminal, assuming a non-bidi LTR termianl. Combining both results in double reordering ABC -> CBA -> ABC.

    You have 2 options:

    1. Disable bidi in mlterm (at least while running emacs, not sure how to automate that).

    2. Disable bidi in emacs (at least when running under mlterm). I.e. set bidi-display-reordering to nil, not t.

    I expect the first will work better. mlterm can only give you a dumb "bidi display" layer, which may be confusing on top of an editor; emacs gives you "bidi editing" where someone thought of how the whole interaction should work.

    P.S. I'm not sure why the end result is right-aligned, as it seems there is a blank line before so Emacs should consider it a new paragraph, decide it's RTL and send right-aligned text to mlterm, and I'd expect mlterm to then reverse the line resulting in it left-aligned. I'm probably missing something.