jed-users mailing list

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

Re: format_rest_of_paragraph


On Mon, Jan 09, 2006 at 05:18:19PM +0000, ntatham1@xxxxxxxxxxxxx wrote:
> 
> Textmode has the command format_paragraph that I can bind a key to. I use it a lot.
> 
> What I would also like is a format_rest_of_paragraph command.
> 
> For example, consider the text:
> 
> 	A quick brown fox
> 	    jumps over
> 	    the 
> 	    lazy
> 	    dog
> 
> I want to place my cursor on the j of jumps and format from there on so that
> the paragraph becomes:
> 
> 	A quick brown fox
> 	    jumps over the lazy dog
> 
> and not
> 
> 	A quick brown fox jumps over the lazy dog
>     
> which is what format_paragraph gives me.    
> 
> Does anyone know if this can be done easily?

I'm glad you brought this up.  I sometimes need it myself, for
example with definition lists in reStructuredText/Docutils.  Your
question encouraged me to try to find a way to do it and to
scratch my own itch, too.

Here is a solution in slang.  It's sort of a work around or maybe
even a kludge for lack of the function you want. Perhaps someone
else has a slicker way to do it.  Put this in your .jedrc and
change the key to which it is bound.

    define format_rest_of_paragraph ()
    {
        push_mark();
        bol();
        push_mark();
        newline();
        call("format_paragraph");
        pop_mark(1);
        call("backward_delete_char");
        pop_mark(1);
    }

    setkey("format_rest_of_paragraph", "\ezq");


Hope this helps.

Dave

-- 
Dave Kuhlman
http://www.rexx.com/~dkuhlman

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