groff
[Top][All Lists]
Advanced

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

Re: [Groff] Hi, some newbie questions.


From: Antony Scriven
Subject: Re: [Groff] Hi, some newbie questions.
Date: Tue, 18 Jan 2005 10:57:08 +0000
User-agent: Mutt/1.5.6i

Hello

On Jan 17, Peter Schaffter wrote:

 > On Mon, Jan 17, 2005, Mike Parson wrote:
 > > Back more on the topic of wishful thinking for GUI-ish
 > > groff editors:
 > > 
 > > I'd like to see something along the lines of the old
 > > WordPerfect 'display codes' mode.  Split screen
 > > (80/20?), bottom few lines of the editor show what
 > > you're editing with the embeded codes that chanage
 > > what's going on, the main editing window would show you
 > > a pseudo-formatted version, maybe what the text would
 > > look like when sent through -Tascii.
 > > 
 > > And, of course, vi keybindings in the editor =)
 > 
 > What you describe is, for me, the absolute ideal for a
 > "groff editor".  I've been putting forth this notion for
 > years (more privately than publicly, though there are a
 > few usenet and groff mailing list posts on the subject).
 > 
 > But I can't help wondering if this idea is going to stay in the
 > realm of dreamland.  The only way it would fly is if someone on the
 > list had the time, energy and know-how to get the project started.
 > I'm honestly not up to the task--I sincerely wish I were--but if
 > some groffers got together and started working on it, I'd be way
 > more than happy to contribute what I could.

This sort of thing might be possible in vim. Here's a quick
hack.

------- begin screenshot -------


    Proof of concept

                          blah     | bleh
                       blih   bloh |
                       ------------+------
                       vorg   vorg | vorg
                       vorg   vorg | vorg
                       vorg   vorg | vorg

output------------------------------2,1------------------------------Top
.ti 4
Proof of concept

.TS
center ;
c       s       l
l       l       |^
-       -       -
l       l       |l.
blah    bleh
input-------------------------------1,1------------------------------Top
:w
------ end screen shot -------

Here's the code to do it:

:au bufwritepre input norm! address@hidden@
:au bufwritepost input winc w|%d|exe 'r!groff -t -Tascii input'
        \ |norm!/address@hidden@/^Mddz.:w^M^Wwndd:se ei=all|w|se ei=

^M is a literal CTRL-M and ^W is a literal CTRL-W.

Every time you write the file the output display is updated
and tracks the cursor position in the input text.

Taking this beyond the toy code above will require more
serious programming effort. I am worn to a threadpaper, and
alack! I am undone, for I have no more twist!

I expect emacs could be made to do something similar; there
is already the preview-latex package which goes well beyond
vim's capabilities. Google for it to see the possibilities.
Furthermore, you can also have vi keybindings in emacs.

Antony




reply via email to

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