[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: mined - a utf-8 editor



--- Thomas Wolff wrote:
> > How can I use mined eventhough it has no shaping or bidi support ?  Well,
> > simple -- use mlterm (mlterm.sf.net).  mlterm will do all your shaping
> > as well as bidi (bi-directionality), thus the only thing that needs to
> > be done is a way to be able to enter Arabic via the keyboard (ie. the
> > need for an Arabic keyboard mapping).
>
> I have downloaded, compiled and tried mlterm. I invoked it with 
> --km=UTF-8 or -E UTF-8 as the manual page says but it refuses to 
> operate in UTF-8 mode. It inputs 8-bit ISO Latin-1 and it outputs 
> nothing for non-ASCII characters. This thing seems to be quite broken.

You'll have to contact mlterm's list for more detail, but mlterm
certainly does work.  I ran './configure --enable-fribidi --enable-utmp'
(fribidi.sf.net) and then invoke mlterm with './mlterm -E utf8 --meta=esc
--fontsize=20'.  You can then easily view an Arabic file (and if you need
one, let me know I'll be more than happy to mail you one) using 'more',
'less', etc.  All of this of course assumes you already have the
appropriate font allocated and loaded (there were a number of posts on
this mailing-list regarding that topic - a 'search' might reveal exactly
what you need).  Mined works fine under mlterm except for the curses
menu and scroll-bar since there is bidi interaction and the curses
ctrl characters gets mirrored when they shouldn't be if a line starts
with an Arabic character (I'm not sure if unicode's UAX#9 talks about
handling this complex scenario -- in reality curses should not be treated
as normal characters and thus should not be under the bidi algorithm). 

You can see what I mean,

  http://www.arabeyes.org/~nadim/mined_view.jpg    (normal view)
  http://www.arabeyes.org/~nadim/mined_curses.jpg  (curses bidi problem)

NOTE: these screenshots will be removed soon (so copy 'em if you want 'em)

For those Bidi experts on the list -- any ideas on what's supposed to
happen when curses is involved with regard to Bidi ?
 
> > Note: most, if not all, Arabic supporting (and utf-8) editors out there
> >       have their own keymaps (emacs, katoob, vim, yudit, etc).
>
> I knew that at least some do that but I am not really familiar with it 
> and as I had written I would actually assume that the terminal 
> environment should take care about it. But anyway - if you point me to 
> a reference on how exactly the keymap should work (mapping and 
> switching methods for Arabic and other languages) I would be willing 
> to implement this.

Some examples could be arabeyes' vim patch or emacs' bidi work.  Here
are the appropriate links,

  http://www.arabeyes.org/project.php?proj=VIM (note download section)
  http://www.m17n.org/emacs-bidi

As for switching, its completely upto you how you'd like to define that.
Most applications create "switch keymap" commands and/or key-presses.  In
vim its CTRL-^ (after specifying an "alternate" keyboard/keymap -- ie.
':set keymap=arabic') in emacs-bidi its a menu selection.

> Also, please not that the default mode of mined is a sort of 
> "poor man's right-to-left", meaning that it produces right-to-left 
> appearance on terminals that do not know anything about right-to-left.
> This can only work together with internal right-to-left ordering of 
> the text in the file (it's basically input support) which is not 
> the preferred way of handling text files in regular right-to-left 
> applications if I understood various comments correctly - please tell 
> me what you think about it. Mined can be switched to work with a 
> right-to-left terminal with the -b option. I would expect it to 
> work with mlterm then - if only mlterm would work at all...

Mlterm takes care of this completely since it offers Bidi
(di-directionality).  Right-to-left and Left-to-right only simply
isn't sufficient when files containing both encodings (such as
English and Arabic) are viewed.

Regards,

 - Nadim


__________________________________________________
Do you Yahoo!?
Faith Hill - Exclusive Performances, Videos & More
http://faith.yahoo.com