[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Groff] My paragraph processor: I didn(t send the good version
From: |
Thomas Baruchel |
Subject: |
[Groff] My paragraph processor: I didn(t send the good version |
Date: |
Sat, 12 May 2001 12:21:39 +0200 |
User-agent: |
Mutt/1.2.5i |
Hi, I didn't send the good version. Read the previous message, but two bugs
are corrected in the present version:
- A word of a paragraph can now begin with . or ' (like a request), because
each word is protected by a \&
- You can now print an escape sequence (the \ char) in a word, because
each word is encapsulated between .eo and .ec
So, your paragraph can now be:
.mmm*P1
I like the .br request and also the '\' character.
.mmm*P2
which it couldn't be in previous message.
Two bugs remain:
you can't use for the moment \% and \~
(the solution for the first one is found but not implemented yet; it is
the next step of my job)
(the solution for the second is not exactly clear in my mind, though I see
one or two ways to explore).
Once the low level macros will be fine (soon), I begin a higher level macro:
My .PP macro with an intelligent formatting of the paragraph.
> The piece of text can really be whatever you want (the single bug for the
> moment is for the \~ escape sequence). The piece of text isn't read in copy
> mode. Really, you shouldn't put something different that what you are used to.
> What do they do ? The create an UNFORMATTED diversion (believe me!) with
In fact, it is a semi-formatted diversion (each word is formatted separately,
but no line is already formatted).
========================================================================
.nr mmm*PI 12p \" indentation
.nr mmm*PS 14 \" taille des caractères
.nr mmm*Wa 0 \" warning
.ds mmm*H1 -¤ \" remplacement du caractère -
.ds mmm*H2 ¤- \" restitution du caractère -
.ds mmm*H3 ¤¤-- \" état normal
.nr mmm*VL 4 \" verbose level :
.\" 1 paragraphe laid
.\" 2 un paragraphe a été rectifié
.\" 3 toutes sortes d'information
.nr mmm*ss 12 \" espace minimal
.nr mmm*ugly 17 \" premier espace considéré comme laid
.\"
.\"
.\"
.de mmm*compute*init
.nr mmm*spaces -1
.nr mmm*lines 0
.nr mmm*value 0
.nr mmm*previous \\n(.du
.tr \\*[mmm*H2]
.eo
..
.de mmm*compute
.ec
.tr \\*[mmm*H3]
.nr mmm*spaces +1
.if dmmm*word .mmm*word
.if \\n(.du-\\n[mmm*previous] \{\
. nr mmm*lines +1
. nr mmm*spaces -1
. if \\n[.hlc] .nr mmm*spaces +1
. nr mmm*value \
(\\n[mmm*spaces]*\\w'\\ '+\\n(.l-\\n(.n)/\\n[mmm*spaces]
. nr mmm*previous \\n(.du
. if dmmm*line .mmm*line
. nr mmm*spaces 0
.\} \"fin du changement de ligne
.tr \\*[mmm*H2]
.eo
..
.de mmm*compute*end
.ec
.tr \\*[mmm*H3]
.rm mmm*spaces
.rm mmm*lines
.rm mmm*value
.rm mmm*previous
..
.de mmm*write
.tr @.
@mmm*compute
.br
.tr @@
.dt \\n(.du+\\n(.vu mmm*write
\\&\\c \" in order to protect a word of a text, beginning with .
..
.de mmm*P1
.nr mmm*place \\n(.c \" ligne du début du paragraphe
.nr mmm*warn*old \\n[.warn]
.warn \\n[mmm*Wa]
.br \" ### est-ce bien utile ?
.di mmm*P
.tr @.
@mmm*compute*init
.br
.tr @@
.ev mmm*env
.in 0
.ti \\n[mmm*PI]u
.ps \\n[mmm*PS]
.ll 1u
.nh
.tr \\*[mmm*H1]
.dt \\n(.du+\\n(.vu mmm*write
\\&\\c \" in order to protect a word of a text, beginning with .
..
.\"
.\"
.\"
.de mmm*P2
.dt
.tr \\*[mmm*H3]
.br
.ev
.tr @.
@mmm*compute*end
.br
.tr @@
.di
.warn \\n[mmm*warn*old]
.rm mmm*warn*old
.asciify mmm*P
.rm mmm*place
..
.\"
.\"
.\"
.nr mmm*PI 0
.mmm*P1
.tr @.
@br is a beautiful request. I like the letter 'b'. I also like the \\ char.
.tr @@
.mmm*P2
.ad b
.mmm*P
.br
.nr mmm*PI 12p
.mmm*P1
This is another paragraph, a more conventionnal one with an indentation.
.mmm*P2
.mmm*P
.br
.de mmm*word
x
..
.mmm*P \"prints a second time the same paragraph with an 'x' between words.