jed-users mailing list

[2003 Date Index] [2003 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

Re: Arrows in LaTeX4Jed


begin  Guido Gonzato <ggonza@xxxxxx> wrote:
> Hello,
> 
> I have fixed the bug and added an alternative way to insert math arrows in
> LaTeX4Jed. Instead of using Joerg's implementation, which is nice but
> somewhat confusing ('->' becomes \rightarrow, but \leftarrow is given by
> '-<'), I have written this code:
> 
> define latex_arrow ()
> {
>   % right arrows
>   if (LAST_CHAR == '>') {
>     if (blooking_at ("--")) {
>       go_left (2);

go_left() doesn't do more then "() = left()". I'm not for bloating up the
api with such functions. I would suggests to replace this calls with
() = left(2).

>       deln (2);
>       insert ("{\\longrightarrow}");
>       return;

Why you use return? Why not use the if-else construct? Is it slower or
why? I am not really a fighter for the single-entry-single-exit principle,
but I think code is more robust with a if-else construct then 2000
returns.

I don't know. I don't fight in slang so long, that I can say how it
behaves.

> <--    \longleftarrow  (*)
> <==    \Longleftarrow  (*)

Is it a good practice to insert the - or = (only for visual effect) in
this moment and read the next key with getkey() from the key. If it is a
= or - replace the whole thing, else go back and replace only the <- / <=
and unget the key.

I don't know which hooks can distrub the situation or what else could
happen.

Jörg.

--------------------------
To unsubscribe send email to <jed-users-request@xxxxxxxxxxx> with
the word "unsubscribe" in the message body.
Need help? Email <jed-users-owner@xxxxxxxxxxx>.


[2003 date index] [2003 thread index]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]