On Tue, Nov 20, 2012 at 02:34:59PM -0600, David Champion wrote:
> * On 20 Nov 2012, David Champion wrote: 
> > * On 20 Nov 2012, Peter Davis wrote: 
> > > Is there any reasonly easy (non-painful) way to put a table in a
> > > message? A plain text table would be fine if I could limit it to 72
> > > characters wide or so, and if there were a reasonable way to edit it,
> > > preferably in emacs.
> > 
> > Type this:
> > ...
> 
> I've never used this before but I want to start.  I wrote a wrapper so
> that I only need to compose the table's contents, not the additional
> markup.
> 
> ### save to mutt-table script
> #!/bin/sh
> # "table wider than line width" is an error that tbl may produce when
> # no terminal is present.
> (
>       echo '.TS'
>       echo 'box tab(|);'
>       read line
>       # produce a column format based on columns in line 1
>       echo "$line" | sed -e 's,[^|]*,l,' -e 's,[^|]*,c,g' -e 's,$,.,'
>       echo "$line"
>       cat -
>       echo '.TE'
> ) |
> tbl |
> nroff -Tascii 2>&1 |
> grep -v 'table wider than line width' |
> uniq
> 
> ### add to .exrc
> map T {
> !}mutt-table
> 
> ### type into vi
> Year|Hurricane|Deaths|Location
> 1780|Great Hurricane of 1780|27,500+|Antilles
> 1998|Hurricane Mitch|18,974 - 21,000|Honduras
> 1900|cane|8,000 - 12,000|Cuba, Texas
> 1974|Hurricane Fifi|8,000 - 10,000|Honduras, Belize
> 1930|bcane|2,000 - 8,000|Antilles, D.R.
> 1963|Hurricane Flora|7,186 - 8,000|Haiti, Cuba
> 
> ### press T over table to format

This looks great, but I am unclear what one does precisely. I created
the script, and added the stuff to .exrc (actually created that file, as
I use .vimrc). Then I added the text for the table to the article. What
do I do next. Pressing T did nothing.

Brian.

 
> -- 
> David Champion • d...@uchicago.edu • IT Services • University of Chicago

-- 

Reply via email to