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


Hallo Marc,

Marc Haber <mh+jed-users@xxxxxxxxxxxx> wrote:
> On Sat, Jul 29, 2006 at 12:55:10PM +0000, Jörg Sommer wrote:
>> Marc Haber <mh+jed-users-l@xxxxxxxxxxxx> wrote:
>> > 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");
>
> With that, I get "Unknown keymap: mailedit" on startup.

Put a make_keymap("mailedit") before the definekey_reserved() statements
or use setkey_reserved() in the mailhook.

>> > 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.
>
> I see. Why was goto_header defined in the first place if it is not
> useable and not used?

I don't know.

Bye, Jörg.
-- 
Gienger's Law (http://www.bruhaha.de/laws.html):
Die Wichtigkeit eines Newspostings im Usenet ist reziprok zur Anzahl der
enthaltenenen, kumulierten Ausrufungszeichen.

--------------------------
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]