[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Groff] What does the "-u" in ".tmac-u" mean?
From: |
G. Branden Robinson |
Subject: |
Re: [Groff] What does the "-u" in ".tmac-u" mean? |
Date: |
Sun, 5 Nov 2017 06:32:13 -0500 |
User-agent: |
NeoMutt/20170113 (1.7.2) |
At 2017-11-05T11:42:48+0100, Ulrich Lauther wrote:
> > > Werner wrote:
> > > > Branden wrote:
> > > > > I move that we stop stripping the files. Stripping them is
> > > > > saving us only a few hundred kB out of 25 megs.
> > > > It's not about saving disk space. Remember that groff is an
> > > > interpreted language *without* a translation to an internal
> > > > representation.[*] This means, for example, that a comment
> > > > within a loop with 1000 repeats gets parsed a thousand times,
> > > > again and again.
>
> Couldn't this be avoided, if groff used in a preprocess one or two sed
> commands to get rid of comments and indentation?
In theory, that's impossible (in full generality) because roff is not a
regular language. Consider the following example:
$ cat >ec.roff
.ec #
.#" This is a roff comment after I cleverly change the escape character.
Foo#[bu]bar; a bullet separates the foo from the bar.
$ nroff ec.roff |head -n1
Foo·bar; a bullet separates the foo from the bar.
sed isn't capable of coping with such tricks.
Lest anyone think that no macro package would be that perverse, our mm
and trace macro packages _do_ redefine the escape character.
Other folks here can probably think of further examples which render a
regex substitution approach infeasible.
--
Regards,
Branden
signature.asc
Description: PGP signature
- [Groff] What does the "-u" in ".tmac-u" mean?, G. Branden Robinson, 2017/11/02
- Re: [Groff] What does the "-u" in ".tmac-u" mean?, Werner LEMBERG, 2017/11/02
- Re: [Groff] What does the "-u" in ".tmac-u" mean?, Heinz-Jürgen Oertel, 2017/11/02
- Re: [Groff] What does the "-u" in ".tmac-u" mean?, Bertrand Garrigues, 2017/11/04
- Re: [Groff] What does the "-u" in ".tmac-u" mean?, G. Branden Robinson, 2017/11/04
- Re: [Groff] What does the "-u" in ".tmac-u" mean?, Werner LEMBERG, 2017/11/05
- Re: [Groff] What does the "-u" in ".tmac-u" mean?, Ralph Corderoy, 2017/11/05
- Re: [Groff] What does the "-u" in ".tmac-u" mean?, oe, 2017/11/05
- Re: [Groff] What does the "-u" in ".tmac-u" mean?, Ulrich Lauther, 2017/11/05
- Re: [Groff] What does the "-u" in ".tmac-u" mean?,
G. Branden Robinson <=
- Re: [Groff] What does the "-u" in ".tmac-u" mean?, Ingo Schwarze, 2017/11/05
- Re: [Groff] What does the "-u" in ".tmac-u" mean?, Ralph Corderoy, 2017/11/05
- Re: [Groff] What does the "-u" in ".tmac-u" mean?, Werner LEMBERG, 2017/11/05
- Re: [Groff] What does the "-u" in ".tmac-u" mean?, Ingo Schwarze, 2017/11/05
- Re: [Groff] What does the "-u" in ".tmac-u" mean?, Peter Schaffter, 2017/11/05
- Re: [Groff] What does the "-u" in ".tmac-u" mean?, Ingo Schwarze, 2017/11/06
- Re: [groff] [Groff] What does the "-u" in ".tmac-u" mean?, Larry Kollar, 2017/11/11
- Re: [groff] [Groff] What does the "-u" in ".tmac-u" mean?, Ted Harding, 2017/11/12
- Re: [groff] What does the "-u" in ".tmac-u" mean?, Ralph Corderoy, 2017/11/12
- Re: [groff] What does the "-u" in ".tmac-u" mean?, G. Branden Robinson, 2017/11/12