Ze'ev Clementson | 5 Jul 21:35
Picon

Getting started with Emacs BiDi

It took me a little while to figure out how to turn on bidi and use it
to input Hebrew in Emacs 24. It wasn't hard to figure it out, but it did
require some investigative work. I suspect others may also find that
there is a bit of a learning curve and might be put off from trying to
use it. I wrote the following elisp function to make it easier to switch
bidi/hebrew on/off: 

(defun zc-hebrew (&optional arg)
  "Switch to Hebrew input.
Without arg does RTL/LTR determination automatically (e.g. - via the rules
of the Unicode Bidirectional Algorithm). With arg forces RTL. Calling
again toggles off bidi and Hebrew input."
  (interactive "P")
  (if bidi-display-reordering
	  (progn
		(setq bidi-display-reordering nil)
		(inactivate-input-method))
	(setq bidi-display-reordering t)
	(if arg
		(setq bidi-paragraph-direction 'right-to-left)
	  (setq bidi-paragraph-direction nil))
	(set-input-method 'hebrew)))

And, I bound it to a key:

(global-set-key [(control c) (h)] 'zc-hebrew)

Now, when I want to type in Hebrew, I just press "C-c h" in a
buffer. When I want to switch back to English, I just press "C-c h" a
second time. If I want to force right-to-left orientation (rather than
(Continue reading)

Eli Zaretskii | 5 Jul 23:07
Picon

Re: Getting started with Emacs BiDi

> From: Ze'ev Clementson <beresheit <at> gmail.com>
> Date: Mon, 05 Jul 2010 12:35:28 -0700
> 
> It took me a little while to figure out how to turn on bidi and use it
> to input Hebrew in Emacs 24. It wasn't hard to figure it out, but it did
> require some investigative work.

Did you find anything that is not already in the manual?

>   (if bidi-display-reordering
> 	  (progn
> 		(setq bidi-display-reordering nil)
> 		(inactivate-input-method))
> 	(setq bidi-display-reordering t)

There's no need to turn bidi-display-reordering on and off.  You can
turn it on by default and leave it that way.  Typing plain L2R Latin
text should look the same with bidi-display-reordering non-nil as it
was before Emacs 24 (barring bugs).  I know a few people who actually
run Emacs 24 like that, even though they don't read any bidi script,
and I've heard no complaints from them for quite some time, so doing
that should be pretty safe.

> 	(if arg
> 		(setq bidi-paragraph-direction 'right-to-left)
> 	  (setq bidi-paragraph-direction nil))

Likewise, toggling bidi-paragraph-direction doesn't make much sense,
IMO.  This is a per-buffer variable, so once you've set it to R2L,
presumably because the buffer should display mostly R2L text, it
(Continue reading)

Ze'ev Clementson | 6 Jul 01:17
Picon

Re: Getting started with Emacs BiDi

Eli Zaretskii <eliz <at> gnu.org> writes:

>> From: Ze'ev Clementson <beresheit <at> gmail.com>
>> Date: Mon, 05 Jul 2010 12:35:28 -0700
>> 
>> It took me a little while to figure out how to turn on bidi and use it
>> to input Hebrew in Emacs 24. It wasn't hard to figure it out, but it did
>> require some investigative work.
>
> Did you find anything that is not already in the manual?

Which manual? The emacs info files don't appear to have anything
bidi-related in them (at least a search for "bidi" didn't turn up any
hits). 

>
>>   (if bidi-display-reordering
>> 	  (progn
>> 		(setq bidi-display-reordering nil)
>> 		(inactivate-input-method))
>> 	(setq bidi-display-reordering t)
>
> There's no need to turn bidi-display-reordering on and off.  You can
> turn it on by default and leave it that way.  Typing plain L2R Latin
> text should look the same with bidi-display-reordering non-nil as it
> was before Emacs 24 (barring bugs).  I know a few people who actually
> run Emacs 24 like that, even though they don't read any bidi script,
> and I've heard no complaints from them for quite some time, so doing
> that should be pretty safe.

(Continue reading)

Eli Zaretskii | 6 Jul 04:59
Picon

Re: Re: Getting started with Emacs BiDi

> From: Ze'ev Clementson <beresheit <at> gmail.com>
> Date: Mon, 05 Jul 2010 16:17:09 -0700
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> >> From: Ze'ev Clementson <beresheit <at> gmail.com>
> >> Date: Mon, 05 Jul 2010 12:35:28 -0700
> >> 
> >> It took me a little while to figure out how to turn on bidi and use it
> >> to input Hebrew in Emacs 24. It wasn't hard to figure it out, but it did
> >> require some investigative work.
> >
> > Did you find anything that is not already in the manual?
> 
> Which manual? The emacs info files don't appear to have anything
> bidi-related in them (at least a search for "bidi" didn't turn up any
> hits). 

There's the "Bidirectional Editing" node in the Emacs User manual.

How did you search for it?  Typing "i bidi TAB" shows 3 possible
completions.

> > There's no need to turn bidi-display-reordering on and off.  You can
> > turn it on by default and leave it that way.  Typing plain L2R Latin
> > text should look the same with bidi-display-reordering non-nil as it
> > was before Emacs 24 (barring bugs).  I know a few people who actually
> > run Emacs 24 like that, even though they don't read any bidi script,
> > and I've heard no complaints from them for quite some time, so doing
> > that should be pretty safe.
(Continue reading)

Ze'ev Clementson | 6 Jul 08:18
Picon

Re: Getting started with Emacs BiDi

Eli Zaretskii <eliz <at> gnu.org> writes:

>> From: Ze'ev Clementson <beresheit <at> gmail.com>
>> Date: Mon, 05 Jul 2010 16:17:09 -0700
>> 
>> Eli Zaretskii <eliz <at> gnu.org> writes:
>> 
>> >> From: Ze'ev Clementson <beresheit <at> gmail.com>
>> >> Date: Mon, 05 Jul 2010 12:35:28 -0700
>> >> 
>> >> It took me a little while to figure out how to turn on bidi and use it
>> >> to input Hebrew in Emacs 24. It wasn't hard to figure it out, but it did
>> >> require some investigative work.
>> >
>> > Did you find anything that is not already in the manual?
>> 
>> Which manual? The emacs info files don't appear to have anything
>> bidi-related in them (at least a search for "bidi" didn't turn up any
>> hits). 
>
> There's the "Bidirectional Editing" node in the Emacs User manual.
>
> How did you search for it?  Typing "i bidi TAB" shows 3 possible
> completions.

Nope, they don't show up in the aquamacs24 Emacs User manual. Were the
bidi pages added to the manual sometime after mid-May (which is
apparently when the last emacs24 refresh was applied to aquamacs24)? 

>> > There's no need to turn bidi-display-reordering on and off.  You can
(Continue reading)

Eli Zaretskii | 6 Jul 20:08
Picon

Re: Re: Getting started with Emacs BiDi

> From: Ze'ev Clementson <beresheit <at> gmail.com>
> Date: Mon, 05 Jul 2010 23:18:32 -0700
> 
> > There's the "Bidirectional Editing" node in the Emacs User manual.
> >
> > How did you search for it?  Typing "i bidi TAB" shows 3 possible
> > completions.
> 
> Nope, they don't show up in the aquamacs24 Emacs User manual. Were the
> bidi pages added to the manual sometime after mid-May (which is
> apparently when the last emacs24 refresh was applied to aquamacs24)? 

This node was added on March 30, the day the bidi branch was merged
with the mainline.  (I'm a documentation maniac, I don't like to
contribute any code without docs.)

It sounds like the Aquamacs maintainers merge documentation even less
frequently than the code, which is really weird, since new docs can
never break anything.
Ze'ev Clementson | 6 Jul 20:17
Picon

Re: Getting started with Emacs BiDi

Eli Zaretskii <eliz <at> gnu.org> writes:

>> From: Ze'ev Clementson <beresheit <at> gmail.com>
>> Date: Mon, 05 Jul 2010 23:18:32 -0700
>> 
>> > There's the "Bidirectional Editing" node in the Emacs User manual.
>> >
>> > How did you search for it?  Typing "i bidi TAB" shows 3 possible
>> > completions.
>> 
>> Nope, they don't show up in the aquamacs24 Emacs User manual. Were the
>> bidi pages added to the manual sometime after mid-May (which is
>> apparently when the last emacs24 refresh was applied to aquamacs24)? 
>
> This node was added on March 30, the day the bidi branch was merged
> with the mainline.  (I'm a documentation maniac, I don't like to
> contribute any code without docs.)
>
> It sounds like the Aquamacs maintainers merge documentation even less
> frequently than the code, which is really weird, since new docs can
> never break anything.

I think they did two different merges (1 from emacs24 and 1 from the
aquamacs23 main branch) and I suspect the aquamacs23 merge clobbered
some of the emacs24 stuff (at least, that's what it looks like from my
reading of the history). Hopefully, subsequent merges will fix things in
the aquamacs24 branch. 

- Ze'ev
(Continue reading)

Ze'ev Clementson | 7 Jul 17:52
Picon

Re: Getting started with Emacs BiDi

Eli Zaretskii <eliz <at> gnu.org> writes:

>> From: Ze'ev Clementson <beresheit <at> gmail.com>
>> Date: Mon, 05 Jul 2010 23:18:32 -0700
>> 
>> > There's the "Bidirectional Editing" node in the Emacs User manual.
>> >
>> > How did you search for it?  Typing "i bidi TAB" shows 3 possible
>> > completions.
>> 
>> Nope, they don't show up in the aquamacs24 Emacs User manual. Were the
>> bidi pages added to the manual sometime after mid-May (which is
>> apparently when the last emacs24 refresh was applied to aquamacs24)? 
>
> This node was added on March 30, the day the bidi branch was merged
> with the mainline.  (I'm a documentation maniac, I don't like to
> contribute any code without docs.)
>
> It sounds like the Aquamacs maintainers merge documentation even less
> frequently than the code, which is really weird, since new docs can
> never break anything.

I just checked a "vanilla" emacs24 build (2010-07-07) and it also doesn't 
have the bidi topics in it. Where specifically in the manual should the bidi 
topics be?

- Ze'ev
Eli Zaretskii | 7 Jul 18:31
Picon

Re: Re: Getting started with Emacs BiDi

> From: Ze'ev Clementson <beresheit <at> gmail.com>
> Date: Wed, 07 Jul 2010 08:52:43 -0700
> 
> I just checked a "vanilla" emacs24 build (2010-07-07) and it also doesn't 
> have the bidi topics in it. Where specifically in the manual should the bidi 
> topics be?

I'm not sure what kind of answer you expect.  There's a special node
in the manual called "Bidirectional Editing", so just typing `g'
followed by that name will land you there.  That's after you type
"C-h i m emacs RET" to enter Info and go to the Emacs user manual.
Ze'ev Clementson | 7 Jul 19:23
Picon

Re: Getting started with Emacs BiDi

Eli Zaretskii <eliz <at> gnu.org> writes:

>> From: Ze'ev Clementson <beresheit <at> gmail.com>
>> Date: Wed, 07 Jul 2010 08:52:43 -0700
>> 
>> I just checked a "vanilla" emacs24 build (2010-07-07) and it also doesn't 
>> have the bidi topics in it. Where specifically in the manual should the bidi 
>> topics be?
>
> I'm not sure what kind of answer you expect.  There's a special node
> in the manual called "Bidirectional Editing", so just typing `g'
> followed by that name will land you there.  That's after you type
> "C-h i m emacs RET" to enter Info and go to the Emacs user manual.

I startup emacs24 with the following:
./Emacs.app/Contents/MacOS/Emacs --debug-init -q
C-h i
M Emacs RET
g Bidi TAB

I get: "No match"

So, it looks like the "Bidirectional Editing" node is not in the
publicly-accessible emacs24 sources.  I'm using the Emacs24 build from:
http://emacsformacosx.com/builds

M-x version:

GNU Emacs 24.0.50.1 (x86_64-apple-darwin, NS apple-appkit-1038.32) of
2010-07-07 on black.porkrind.org 
(Continue reading)

Eli Zaretskii | 7 Jul 19:46
Picon

Re: Re: Getting started with Emacs BiDi

> From: Ze'ev Clementson <beresheit <at> gmail.com>
> Date: Wed, 07 Jul 2010 10:23:12 -0700
> 
> I startup emacs24 with the following:
> ./Emacs.app/Contents/MacOS/Emacs --debug-init -q
> C-h i
> M Emacs RET
> g Bidi TAB
> 
> I get: "No match"

Are you sure you are reading the version of the manual that came with
this Emacs?  Try "C-u C-h i" and then type the full absolute file name
of the Emacs manual (the file named `emacs') that came with this build.

I'm quite sure you are looking at some old version of the manual,
because it turns out the latest Aquamacs 24 already has the bidi node
(I just checked), and you told me you didn't find it there as well.

> So, it looks like the "Bidirectional Editing" node is not in the
> publicly-accessible emacs24 sources.

Yes, it is.  I'm building the current trunk on several different
machines, and they all have it.
Ze'ev Clementson | 7 Jul 20:07
Picon

Re: Getting started with Emacs BiDi

Eli Zaretskii <eliz <at> gnu.org> writes:

>> From: Ze'ev Clementson <beresheit <at> gmail.com>
>> Date: Wed, 07 Jul 2010 10:23:12 -0700
>> 
>> I startup emacs24 with the following:
>> ./Emacs.app/Contents/MacOS/Emacs --debug-init -q
>> C-h i
>> M Emacs RET
>> g Bidi TAB
>> 
>> I get: "No match"
>
> Are you sure you are reading the version of the manual that came with
> this Emacs?  Try "C-u C-h i" and then type the full absolute file name
> of the Emacs manual (the file named `emacs') that came with this build.
>
> I'm quite sure you are looking at some old version of the manual,
> because it turns out the latest Aquamacs 24 already has the bidi node
> (I just checked), and you told me you didn't find it there as well.

AGGHH (followed by sound of head banging against the wall) - ages ago I
had set the INFOPATH variable in the environment.plist on my Mac and I
had forgotten about this. You are correct - the bidi entry is in the
emacs24 info files. 

Sorry for the noise.

- Ze'ev 
(Continue reading)

Ze'ev Clementson | 8 Jul 21:39
Picon

Re: Getting started with Emacs BiDi

FYI: I've written a blog post on "Hebrew and BiDi text in Emacs24":
http://bit.ly/cf2yWU

- Ze'ev
Eli Zaretskii | 8 Jul 22:45
Picon

Re: Re: Getting started with Emacs BiDi

> From: Ze'ev Clementson <beresheit <at> gmail.com>
> Date: Thu, 08 Jul 2010 12:39:23 -0700
> 
> FYI: I've written a blog post on "Hebrew and BiDi text in Emacs24":
> http://bit.ly/cf2yWU

Thanks.
Ze'ev Clementson | 14 Jul 23:44
Picon

Re: Getting started with Emacs BiDi

Ze'ev Clementson <beresheit <at> gmail.com> writes:

> FYI: I've written a blog post on "Hebrew and BiDi text in Emacs24":
> http://bit.ly/cf2yWU

Here's Part 2 (Hebrew Input Methods) : http://bit.ly/cWVl05

- Ze'ev

Gmane