[vox-tech] Email formatting fun

Ken Bloom vox-tech@lists.lugod.org
Tue, 20 Apr 2004 11:30:00 -0700


--WIyZ46R2i8wDzkSu
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Tue, Apr 20, 2004 at 10:23:20AM -0700, Jonathan McPherson wrote:
> Hey all,
>=20
> I use mutt to read my email, and vim to compose messages.  Judging
> from the headers on the mail messages around the list, many of you
> are in the same boat.
>=20
> I like my email to be as well-formatted as possible.  Towards that
> end, I use a paragraph formatter named par[1] to format my email
> messages.  par reflows paragraphs and chooses line breaks that are
> optimal (in some sense), using a dynamic programming algorithm that
> outperforms the greedy one used by "fmt" and most other mail
> clients.
>=20
> Anyhow, my messages tend to consist of at least three different
> classes of text:
>=20
> 1. Paragraphs - the most basic unit.  These may contain a quote
> prefix (>, etc), an indent, or some other prefix, which must be
> preserved as the paragraph is reflowed to email line length.
>=20
> 2. Lists - such as this one.  These are formatted as "hanging
> indent" paragraphs.  For instance, this list is formatted as a set
> of paragraphs with a hanging indent of 3.
>=20
> 3. Raw - text that should not be touched by the formatter.  For
> instance, code snippets and my signature could be considered to be
> "raw" text.
>=20
> At any rate, my current system of email formatting is somewhat
> time-consuming.  Parts of the email that fall into class (1) must be
> passed to par; parts that fall into class (2) must be passed to par
> with a special argument indicating the level of hanging indent to be
> used; and parts that fall into class (3) must not be passed to par.
> Thus, I must manually highlight groups of lines and filter them
> through par with the appropriate command-line options.  This only
> takes a few seconds, but it's something that could be automated.
>=20
> So, the question for you Unix/text gurus is simply: what do you use
> for your email? and do you have any recommendations for how I could
> automate the above process?  Ideally I'd like to just have the
> entire email filtered through one script that Does the Right Thing.
>=20
> I'm thinking about using awk to separate the classes and pass them
> to par, but I'm having more trouble doing that than seems
> reasonable.  Of course, I've never used awk before, so... (-:
>=20
> Thanks!=20
>=20
> -jam
>=20
> [1] http://www.nicemice.net/par/

I use gq} I don't know whether you'll find it to be less or more of a
pain.

--=20
I usually have a GPG digital signature included as an attachment.
See http://www.gnupg.org/ for info about these digital signatures.
My key was last signed 10/14/2003. If you use GPG *please* see me about=20
signing the key. ***** My computer can't give you viruses by email. ***

--WIyZ46R2i8wDzkSu
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFAhWwnlHapveKyytERAi2YAJ9GLy5TrD6bAUw12mCTRZmuOgXSpACfe71g
OZNuma4CjdJxXx/R8GGn2QE=
=FVzJ
-----END PGP SIGNATURE-----

--WIyZ46R2i8wDzkSu--