jed-users mailing list

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

Re: exit in EDT emulation


David Gressett <gresset1@xxxxxxxxxxx> wrote:
>>    define edt_evaluate_cmd ()
>>    {
>>        cmd = strtrim (read_mini ("EDT:", "", ""));
>>        if (cmd == "exit")
>>          cmd = "exit_jed";
>>        eval (cmd);
>>    }
>>    setkey ("\eOP\eOw");
>>
>>Does this give you the desired behavior?
>
>I get a message that tells me that cmd is not defined.
>
>If I fix that by putting
>   variable cmd;
>in as the first line of edt_evaluate_cmd()
>I get a different message when jed starts:
>
>S-Lang Error: Stack Underflow: called from line 2, file:  ***string***

My apologies for being so sloppy.  Try this version.

    define edt_evaluate_cmd ()
    {
        variable cmd = strtrim (read_mini ("EDT:", "", ""));
        if (cmd == "exit")
          cmd = "exit_jed";
        eval (cmd);
    }
    setkey ("edt_evaluate_cmd", "\eOP\eOw");

Thanks,
--John

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


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