groff
[Top][All Lists]
Advanced

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

Re: user-defined characters, translation maps, and environment binding


From: Ralph Corderoy
Subject: Re: user-defined characters, translation maps, and environment binding
Date: Mon, 24 Apr 2023 11:31:10 +0100

Hi Branden,

> >     .char £ pound sterling
> >     .char $ United States dollar
> >     .
> >     The £ and $ are almost at par.
> >     .
> >     .tr aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ
> >     £ crashes overnight!
> >     .
> >     .pl \n(nlu
> >     ^D
> >     The pound sterling and United States dollar are almost at par.
> >     POUND STERLING CRASHES OVERNIGHT!
...
> > I'd want to see shouty caps.
>
> I think this an excellent example of user-defined character abuse.

It's a long-standing idiom.  Not abuse.

> There's no reason not to use strings here.
...
>     .  de UP
>     .    tr aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ
>     .    ds \\$1 \\*[\\$1]
>     .    tr AABBCCDDEEFFGGHHIIJJKKLLMMNNOOPPQQRRSSTTUUVVWWXXYYZZ
>     .  .
...
>     .ds P pound sterling\"
>     .ds D United States dollar\"
>     .
>     The \*P and \*D are almost at par.
>     .
>     .ds news \*P crashes overnight!
>     .UP news
>     \*[news]
>     .pl \n(nlu

Reasons not to use strings here:

- It avoids having to re-work existing documents.
- The text should be typed with £ and $, not \*P and \*D.
- The text to shout now has to be put into a string, a macro called, and
  the string interpolated.  Before, the text was just written.

It sounds like transliteration local to an environment is a new feature,
not one worthy of breaking .tr.

-- 
Cheers, Ralph.



reply via email to

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