jed-users mailing list

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

Re: Question about mailedit.sl docs


Hello Marc,

Marc Haber <mh+jed-users-l@xxxxxxxxxxxx> wrote:
> Hi,
>
> I am using jed 0.99.18 on Debian sid[1], which includes a library of
> extensions. I do not know whether this mailing list is appropriate for
> questions. If it is not, please point me to the right list.
>
> I am trying to use mailedit.sl which is placed into
> /usr/share/jed/lib/mailedit.sl by the Debian packages.

This is the upstream version.

> I'd like to use this function to define key sequences like "^Cs" to
> jump to certain headers, like the Subject, for example. I do not have
> any idea how to accomplish this.

Create your own goto_header function in your jed.rc.

define my_goto_header(header)
{
    variable mark = create_user_mark();
    bob();
    !if ( bol_fsearch("\n") )
    {
        goto_user_mark(mark);
        throw UsageError, "No headers found in this buffer";
    }
    !if ( bol_bsearch(header+":") )
    {
        goto_user_mark(mark);
        throw UsageError, "Header not found";
    }
}

and then define your keys:

definekey_reserved("my_goto_header(\"Subject\")", "s", "mailedit");
definekey_reserved("my_goto_header(\"From\")", "f", "mailedit");
definekey_reserved("my_goto_header(\"Expires\")", "e", "mailedit");

> Using goto_header in a setkey statement in my keybindings_hook does not
> seem to work as well as defining my own function (define
> mail_edit_subject() { goto_header("Subject"); }) in ~/.jed/jed.rc. I
> suspect this is because mailedit definies goto_header as private.

Yes, you are right. You cannot access a private function outside of the
file it was defined in.

> Are there any docs how to make use of the mailedit mode?

Unfortunately, no

Have a nice day, Jörg.
-- 
"It's been said you aren't a real UNIX system administrator until you've
edited a sendmail.cf file. It's also been said that you are crazy if you
attempted to do so twice"

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


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