[TxMt] setting options on document open/close

Eric Peden eric at ericpeden.com
Fri Sep 23 00:33:11 UTC 2005


On Wed, Sep 21, 2005 at 04:23:17PM +0200, Allan Odgaard wrote:
>On 20/09/2005, at 10.57, Eric Peden wrote:
>
>>[...] (I have a macro bound to <return> that hands off the current
>>paragraph to the 'par' wrapping utility; this handles wrapping better
>>than TM's "Reformat Paragraph" command).
>
>I didn't know this utility, but have now installed it. Though I see
>(from the man):
>
>     For the "power user", a full understanding of par will require
>multiple readings of the TERMINOLOGY, OPTIONS, DETAILS, and EXAMPLES
>sections.
>
>So may be a while before grasp it all ;)

I just grabbed my par options from someone else's example. ;) In case
it's of use to anyone else, here's the command I use to re-wrap the
currently selected text. Input = selected text, output = replace selected text:

 PARINIT="rTbgqR B=.,?!_A_a Q=_s>|+" /opt/local/bin/par

Of course, adjust the path to 'par' as appropriate for your system.

What do those PARINIT settings do? In a shocking display of
ignorance... I have no idea. But they "just work" for email
re-wrapping. As an exercise for the reader, instructing 'par' to add
spaces to the end of each line, or piping the output of par through
sed to accomplish the same thing, should make text suitable for use in
format=flowed messages.

>>The last thing I'd like to do to polish off the text-wrap is to set
>>"Soft wrap" on and adjust the wrap column whenever an email is opened.
>>
>>Is there any way to do this? The soft wrap setting at least appears to
>>be stored on a per-window basis.
>
>[...]If you toggle the soft wrap setting, while the language is set to
>your new email language, it should stick for that file type.

I had already created a new language. I just hadn't noticed the soft
wrap command sticking... it does in fact seem to be doing this. An
excellent example of a smart program anticipating my needs ahead of
time, without getting in the way of what I'm actually trying to do. I
hope Clippy the Paperclip is paying attention...

-- 
eric
  Call it impulsive, call it compulsive, call it insane



More information about the textmate mailing list