groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [Groff] poor man's wysiwyg for groff/gv


From: Ted Harding
Subject: RE: [Groff] poor man's wysiwyg for groff/gv
Date: Mon, 17 Dec 2001 18:03:29 -0000 (GMT)

On 17-Dec-01 Larry McVoy wrote:
> I use this a lot, maybe you'll like it.  It burns a little cpu but
> that's a non issue these days.  You run it like
> 
>       g groff -mgs -s -p -t mypaper.ms
> 
> and it redraws any time you touch any of the files included by
> mypaper.ms or mypaper.ms itself.

Well, in "me-too" mode, I append the core of a script I've been
using for the same purpose for some years. It's a plain shell
script, and does not depend on perl.

I call this script "ge" (for "groff-edit"), and there's also
a symbolic link "ge_L -> ge" ("ge" does portrait, "ge_L" does
landscape). Not being a perl expert I can't emulate Larry's
virtuosity on that front; nor does my script watch _all_ the
files involved -- only the file being edited.

Usage involves three files:

  document.tr  document.ps  document.watch

where "document" stands for the real name of the document.
Usage is

  ge document

This starts up an editing window (using vim -- substitute
your favourite) for document.tr, starts up gv in watch
mode displaying document.ps, and also starts up a auxiliary
"utility window" in which you can do stuff on the side in the
same  directory. The file "document.watch" is also touched;
all these files are created with useful default contents if
they don't already exist.

After that it goes into essentially the same loop as Larry's.

Every time the current edited version of document.tr is saved
(":w" in vim), timestamps are compared and updated, and groff
(in my preferred modality -- you change it to yours) is run.
Only when this groff run is complete is a "kill -1" sent to
gv, which then re-reads the completed document.ps file (this
gets round the timing problem observed by Ralph).

Best wishes to all,
Ted.

--------------------------------------------------------------------
E-Mail: (Ted Harding) <address@hidden>
Fax-to-email: +44 (0)870 167 1972
Date: 17-Dec-01                                       Time: 18:03:29
------------------------------ XFMail ------------------------------

reply via email to

[Prev in Thread] Current Thread [Next in Thread]