jed-users mailing list

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

Re: problem with formatting code and email.sl


Hallo Juergen,

Juergen Lemke <lemke_juergen@xxxxxxxx> wrote:
> work ok. The trouble is when I try to use it in email
> mode (using the email.sl provided with jed).

Jed does not ship a file named email.sl. Do you mean mail.sl?

> So that my code doesn't garble the quoted part of the
> message I am editing, I changed my formatting function
> so that it looks like:
>
> define format_buffer()                                
> {                                                     
>    push_spot();                                       
>    bob();                                             
>                               
>    variable mode;                                     
>    (mode,) = what_mode();                             
>                               
>    do                                                 
>      {                                                
>         bol(); push_mark(); eol();                    
>         variable line = bufsubstr();                  
>                               
>         %bol();                                       
>                               
>         if (strcmp(mode,"email") == 0 and
>             strncmp(line,">",1) == 0)                  
>           {                                           
>              email_reformat();                        
>              continue;                                
>           }                                           
>                               
>         % formatting code...                          
>                               
>      }                                                
>    while (down(1) == 1);                              
>                               
>    pop_spot();
>    return;
> }
>
> I thought this would keep my code from messing up the
> quoted part of a message, but when I try to run it in
> email mode jed seems to hang.

Press Ctrl+G and look into the *traceback* buffer where the function
hang.

> Can you help me understand why that is happening?

One idea is, email_reformat() places the cursor at the begin of the
paragraph. So you enter get an endless loop.

(1) > text
(2) > text
    > text

You start at (1). You find the > and call email_reformat(). This places
the point at (1) after it reformated the text. Then you go down to (2),
see a > and call email_reformat(). This places the point at (1) after
reformating the text. Then you go down to (2) and ...

Bye, Jörg.
-- 
Dummheit anprangern ist ungefährlich, weil sich niemand angegriffen fühlt.

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