Arbitrary Fractions - this time as strings

2021-07-15 Thread T. Kurt Bond
Returning to arbitrary fractions
, I'm
trying to make it work as a string invocation.  (Is that the right
terminology?)  Anyway, I'm trying this:

.po 1i
.ll 6.5i
.sp 1i
.ps 16
.vs 18
.de fracinline
\\R'n0 \\n[.s]'\#
\\R'n1 \\n[n0]*6/10'\#
\\R'dn (\\n[n0]-\\n[n1])*8/10'\#
\v'-\\n[dn]p'\s[\\n[n1]]\\$1\s0\v'\\n[dn]p'\[f/]\s[\\n[n1]]\\$2\s0\\$3
..
Trying 1/12 inline: \*[fracinline 1 12].  No newline after and with no
space before\*[fracinline 12 5 \c]or after.
.br
Trying 1/12 inline: \*[fracinline 1 12].
Newline after and with no
space before\*[fracinline 12 5 \c]or after.
.br

But the result I get is missing ithe words "No newline after and with no"
before "space before" .  Here's a screenshot:
[image: image.png]
Any ideas what I can do to make this work?

Thanks!

-- 
T. Kurt Bond, tkurtb...@gmail.com, https://tkurtbond.github.io


Re: Would it be reasonable to list the fonts that are available by default in groff?

2021-07-15 Thread T. Kurt Bond
So, on my Fedora 33 box at home, with both of the packages groff-base (the
default install, just for man pages, I think?) and groff (the rest of
groff) installed, /usr/share/groff does not contain a site-font.

On Thu, Jul 15, 2021 at 8:15 PM T. Kurt Bond  wrote:

> On Thu, 15 Jul 2021 16:58:41 -0400,
> Wim Stockman  wrote:
> > Using the site-font directory so you don't need root access.
>
> So, whether or not the site-font directory is owned by root, or even
> exists, is inconsistent.  (This also makes it difficult to find
> automatically for scripts.)
>
> For instance, on my macbook the Apple installed version (1.19.2, alas)
> the font directory is in /usr/share/groff/site-font like you would
> expect and is owned by root.  In the version installed by the homebrew
> package manager /usr/local/share/groff is a link to
> /usr/local/Cellar/groff/1.222.4_1/share/groff and is owned by me.
> (Homebrew doesn't use root access to install anything.)  I don't
> remember what Macports, which I used to use, did, but expect it would
> have been owned by root if it existed.  The version of groff I
> installed from git has a writable site-fonts.  On my Pop!_OS 21.04 box
> (an Ubuntu derivative) /usr/share/groff does not have a site-font, and
> is owned by root.  The OpenBSD 6.8 box I have access to has a
> /usr/local/share/groff/site-font directory that is owned by root.
> None of the directories owned by root are writable by normal users.
>
> (I'll have to see what my Fedora box when I get home this evening.)
>
> Peter Schaffter's current install-font.sh defaults to looking in
> /usr/local/share/groff for site-font, has an option, -s, to look in
> /usr/share/groff, and has another option, -P, for specifying the
> directory to look in.  (Note that is the directory to *look in* for
> site-font, not the actual full path to site-font.)  It also has logic
> for copying font files to one of the directories
> /usr/local/share/fonts/{truetype,opentype,type1} depending on what
> kind of font file the fonts are, and I don't think those directories
> are completely standardized either.
>
> Making install-fonts.sh put things in the right places, with or
> without root privileges, may be one of the things that makes
> incorporationg it into the groff distribution difficult.
>
> --
> T. Kurt Bond, tkurtb...@gmail.com, tkurtbond.github.io and tkb.tx0.org
>


-- 
T. Kurt Bond, tkurtb...@gmail.com, https://tkurtbond.github.io


Re: Question about ?roff on Reddit

2021-07-15 Thread T. Kurt Bond
Oh, I missed a  couple
 of other videos.

On Thu, Jul 15, 2021 at 10:09 PM T. Kurt Bond  wrote:

> If I remember correctly, at least one of the posters on the Groff Reddit
> also posts videos on youtube about groff, which seems like a popular way
> for the youngsters to get their information.  Oh, here's one
> , by Gavin Freeborn, who's
> got a playlist
> 
> of 16 or so troff/groff/neatroff videos, which I found from this
> 
> Reddit post.
>
> And searching on youtube for groff brought up Luke Smith
> , who has a short playlist
> 
> of groff videos.  And one more video
>  by manchot
> , their only
> video.
>
> On Thu, Jul 15, 2021 at 9:50 PM Nate Bargmann  wrote:
>
>> I learned there is a Groff Reddit as well:
>>
>> https://www.reddit.com/r/groff/
>>
>> It seems to have quite a bit of activity which is fantastic.
>>
>> - Nate
>>
>> --
>>
>> "The optimist proclaims that we live in the best of all
>> possible worlds.  The pessimist fears this is true."
>>
>> Web: https://www.n0nb.us
>> Projects: https://github.com/N0NB
>> GPG fingerprint: 82D6 4F6B 0E67 CD41 F689 BBA6 FB2C 5130 D55A 8819
>>
>>
>
> --
> T. Kurt Bond, tkurtb...@gmail.com, https://tkurtbond.github.io
>


-- 
T. Kurt Bond, tkurtb...@gmail.com, https://tkurtbond.github.io


Macros for printing envelopes?

2021-07-15 Thread Nate Bargmann
Hi all.

Reading through a few of the threads on Reddit what others are using
groff for got me to thinking that I have a use case that has to be
better than what I've been doing.  One practice I have adopted recently
is to print the address and return address directly to an envelope as I
will readily admit my handwriting is not all that readable.
Specifically I mostly use US sized #6 3/4 and #10 envelopes personally
and for an organization I am the treasurer for.

My first effort was to use Libre Office Writer and it works well to
print #6 3/4 envelopes but has a long standing bug that causes the
address blocks to be shifted downward on a #10 envelope to the point it
is not usable for the task.

I resorted to using a proprietary word processing program in a virtual
machine.  This works but is not ideal either for various reasons.

My thought turned to groff today and my Web searches came up empty with
only a couple of links to people talking about such macros, but no code.
So I ask, is there something I missed in the standard macro packages?
My searches there turned up nothing for envelopes.

As I see it, with groff I can easily create files for addresses I use
often and should be able to code a script that accepts those one-off
addresses.  Other than man pages, I'm a total novice to the rest of
groff and its macro packages.  I'd rather not reinvent a macro package
that someone else has gotten working and made available for the rest of
us.

TIA

- Nate

-- 

"The optimist proclaims that we live in the best of all
possible worlds.  The pessimist fears this is true."

Web: https://www.n0nb.us
Projects: https://github.com/N0NB
GPG fingerprint: 82D6 4F6B 0E67 CD41 F689 BBA6 FB2C 5130 D55A 8819



signature.asc
Description: PGP signature


Re: Question about ?roff on Reddit

2021-07-15 Thread T. Kurt Bond
If I remember correctly, at least one of the posters on the Groff Reddit
also posts videos on youtube about groff, which seems like a popular way
for the youngsters to get their information.  Oh, here's one
, by Gavin Freeborn, who's got
a playlist

of 16 or so troff/groff/neatroff videos, which I found from this

Reddit post.

And searching on youtube for groff brought up Luke Smith
, who has a short playlist

of groff videos.  And one more video
 by manchot
, their only
video.

On Thu, Jul 15, 2021 at 9:50 PM Nate Bargmann  wrote:

> I learned there is a Groff Reddit as well:
>
> https://www.reddit.com/r/groff/
>
> It seems to have quite a bit of activity which is fantastic.
>
> - Nate
>
> --
>
> "The optimist proclaims that we live in the best of all
> possible worlds.  The pessimist fears this is true."
>
> Web: https://www.n0nb.us
> Projects: https://github.com/N0NB
> GPG fingerprint: 82D6 4F6B 0E67 CD41 F689 BBA6 FB2C 5130 D55A 8819
>
>

-- 
T. Kurt Bond, tkurtb...@gmail.com, https://tkurtbond.github.io


Re: Question about ?roff on Reddit

2021-07-15 Thread Nate Bargmann
I learned there is a Groff Reddit as well:

https://www.reddit.com/r/groff/

It seems to have quite a bit of activity which is fantastic.

- Nate

-- 

"The optimist proclaims that we live in the best of all
possible worlds.  The pessimist fears this is true."

Web: https://www.n0nb.us
Projects: https://github.com/N0NB
GPG fingerprint: 82D6 4F6B 0E67 CD41 F689 BBA6 FB2C 5130 D55A 8819



signature.asc
Description: PGP signature


Re: Question about ?roff on Reddit

2021-07-15 Thread Nate Bargmann
* On 2021 15 Jul 12:44 -0500, G. Branden Robinson wrote:
> At 2021-07-15T18:09:37+0200, Wim Stockman wrote:
> > Hi Peter, it is already a big bunch of comments. Branden replied with
> > a cool word count example in groff.
> > 
> > :-)
> 
> Much as I love high fives, I can't claim credit for that one.  First,
> OmenBreeze on Reddit appears to be John Gardner, whom we haven't seen on
> this list much very recently but who has certainly made some solid
> contributions, and also did that awesome device-independent troff
> renderer in JavaScript.

I followed his link to:

https://rawgit.com/Alhadis/Roff.js/web-demo/index.html

and that is very well done.

> Second, I don't even _have_ a Reddit account.

I probably shouldn't, but I limit my reddits to those that are amateur
radio or Linux related in some way.

> John's a sneaky devil.  I've never seen the .cw request used in anger
> before.  :D  I'd link directly to his comment but Reddit doesn't seem to
> let me, it just throws up the whole thread.  Maybe "deep linking"
> (:rolleyes:) is a privilege reserved to those who are logged in to the
> site.

Probably so.  Here should be the link to John's comment/example:

https://www.reddit.com/r/linux/comments/ojkjm9/how_do_nrgroff_compare_with_more_modern_text/h58x3zb?utm_source=share_medium=web2x=3

- Nate

-- 

"The optimist proclaims that we live in the best of all
possible worlds.  The pessimist fears this is true."

Web: https://www.n0nb.us
Projects: https://github.com/N0NB
GPG fingerprint: 82D6 4F6B 0E67 CD41 F689 BBA6 FB2C 5130 D55A 8819



signature.asc
Description: PGP signature


Re: Would it be reasonable to list the fonts that are available by default in groff?

2021-07-15 Thread Dave Kemper
On 7/15/21, G. Branden Robinson  wrote:
> What I think we need is to absorb Peter's font installer into groff,
> give it a man page, make sure it works for a preponderance of expected
> scenarios, and so forth.  I'd do it, but I haven't had the spoons.

And you already have a huge number of spoons in the groff pot!

But getting install-font.sh distribution-ready is a set of tasks that
doesn't require a lot of groff-specific expertise, making it a good
candidate for someone who wants to contribute to groff but doesn't
want (or have the cycles) to learn an extensive existing code base.

Consensus last year seemed to be that two tasks need to be done;
Branden alludes to a third above.  These tasks involve different
skills and needn't be done by the same person.

 - Make the script portable by removing dependencies on bash-specific
features (see http://lists.gnu.org/archive/html/groff/2020-04/msg00079.html
and downthread; thread continues, not linked to the previous one, at
http://lists.gnu.org/archive/html/groff/2020-05/msg0.html)

 - Write a man page

 - Write some test cases to ensure it works as expected

If anyone thinks one of these tasks might be for you, probably the
best way to coordinate is through the savannah ticket for this issue
(http://savannah.gnu.org/bugs/?58831).  You can add a note there
saying what you're working on, and attach files for others to review.



Re: Would it be reasonable to list the fonts that are available by default in groff?

2021-07-15 Thread T . Kurt Bond
On Thu, 15 Jul 2021 19:16:50 -0400,
Douglas McIlroy  wrote:
> I'm generally an intrepid groff user, but not when it comes to font
> installation. Anything that demystifies the process will win my applause.
> 
> Doug

Despite the vagaries of directory locations, once you understand what
install-font.sh wants and fontforge is installed install-font.sh is
relatively easy to use.  I typically write a short script that calls
install-font.sh with the option to specify the correct directory for
each of the variations of the font in which I'm interested.  Here's
the script I use to install Cormorant Garamond.

= install-cormorant-garamond.sh 
#! /usr/bin/env bash

if [ "$1" != "" ]; then
[ -d "$1" ] || { echo Bogus DEST: $1; exit 1; }
DEST="$1"
else
DEST="/Users/tkb/sw/versions/groff/git/share/groff"
fi

~/current/groff/utilities/install-font.sh -n -P "$DEST" -d -F CormorantGaramond 
-f +R CormorantGaramond-Regular.ttf
~/current/groff/utilities/install-font.sh -n -P "$DEST" -d -F CormorantGaramond 
-f +I CormorantGaramond-Italic.ttf
~/current/groff/utilities/install-font.sh -n -P "$DEST" -d -F CormorantGaramond 
-f +B CormorantGaramond-Bold.ttf
~/current/groff/utilities/install-font.sh -n -P "$DEST" -d -F CormorantGaramond 
-f +BI CormorantGaramond-BoldItalic.ttf


You can see that I default to installing it to the directory
/Users/tkb/sw/versions/groff/git/share/groff, but there is an option
to change it since I've got multiple versions installed.  The directory
/Users/tkb/sw/versions/groff/git is where I've configured the groff I
build from git to install.  (I used to use /sw/versions/groff/git,
which I like better, but upgrading to macOS Catalina saw all the files
you owned outside your home directory "quarantined" and made difficult
to access, and I opted not to fight it.)

If your font has other variants - other weights like Light, Medium,
and Semi, or smallcaps, etc., you can just add invocations of
install-font.sh to install them with names like
CormorantGaramondLight, etc.  I'm actually going to be using multiple
weights of Cormorant Garamond, so I'll be adding those to this script
soon.

Anyway, I have one of these scripts for each font I install, so I can
rerun them; sometimes fontforge reports problems, or I make a mistake
specifying the font file names.  And I actually use three different
computers regularly, so I install them on each one. So having the
script makes rerunning in case of errors nad keeping the font names
consistent on different machines easy.  They need to be run from the
directory with the font files.

Staring to use install-font.sh greatly widened the breath of fonts
that I can use with groff, having significantly lowered the difficulty
of installing fonts for me.

-- 
T. Kurt Bond, tkurtb...@gmail.com, tkurtbond.github.io and tkb.tx0.org



Re: Would it be reasonable to list the fonts that are available by default in groff?

2021-07-15 Thread T . Kurt Bond
On Thu, 15 Jul 2021 16:58:41 -0400,
Wim Stockman  wrote:
> Using the site-font directory so you don't need root access.

So, whether or not the site-font directory is owned by root, or even
exists, is inconsistent.  (This also makes it difficult to find
automatically for scripts.)

For instance, on my macbook the Apple installed version (1.19.2, alas)
the font directory is in /usr/share/groff/site-font like you would
expect and is owned by root.  In the version installed by the homebrew
package manager /usr/local/share/groff is a link to
/usr/local/Cellar/groff/1.222.4_1/share/groff and is owned by me.
(Homebrew doesn't use root access to install anything.)  I don't
remember what Macports, which I used to use, did, but expect it would
have been owned by root if it existed.  The version of groff I
installed from git has a writable site-fonts.  On my Pop!_OS 21.04 box
(an Ubuntu derivative) /usr/share/groff does not have a site-font, and
is owned by root.  The OpenBSD 6.8 box I have access to has a
/usr/local/share/groff/site-font directory that is owned by root.
None of the directories owned by root are writable by normal users.

(I'll have to see what my Fedora box when I get home this evening.)

Peter Schaffter's current install-font.sh defaults to looking in
/usr/local/share/groff for site-font, has an option, -s, to look in
/usr/share/groff, and has another option, -P, for specifying the
directory to look in.  (Note that is the directory to *look in* for
site-font, not the actual full path to site-font.)  It also has logic
for copying font files to one of the directories
/usr/local/share/fonts/{truetype,opentype,type1} depending on what
kind of font file the fonts are, and I don't think those directories
are completely standardized either.

Making install-fonts.sh put things in the right places, with or
without root privileges, may be one of the things that makes
incorporationg it into the groff distribution difficult.

-- 
T. Kurt Bond, tkurtb...@gmail.com, tkurtbond.github.io and tkb.tx0.org



Re: Would it be reasonable to list the fonts that are available by default in groff?

2021-07-15 Thread Douglas McIlroy
> We could basically write a macro that installs on the fly a system
> available font for groff. Using the possibility to run an external script
> from within groff I m sure it is possible to install the font on the fly.
> Running Peter font-install script. Using the site-font directory so you
> don't need root access.

I'm generally an intrepid groff user, but not when it comes to font
installation. Anything that demystifies the process will win my applause.

Doug



[bug #60913] suboptimal diagnostics and spurious output when (mis)using .evc

2021-07-15 Thread G. Branden Robinson
Update of bug #60913 (project groff):

  Status: In Progress => Fixed  
 Open/Closed:Open => Closed 
 Planned Release:None => 1.23.0 

___

Follow-up Comment #3:


commit ff394f136b602454c557d0ce96cd788db36d138b
Author: G. Branden Robinson 
Date:   Tue Jul 13 06:11:07 2021 +1000

[troff]: Refactor environment handling.

[troff]: Refactor environment initialization, switching, and copying.

* src/roff/troff/env.cpp: Rename struct `env_list` to `env_list_node`
  since it describes a node of a singly-linked list.  Remove constant
  `NENVIRONMENTS` and array `env_table`.  Add static symbol
  `default_environment_name` to replace string literal.

  (init_environments): Stop initializing `curenv` through `env_table`.
  Use `default_environment_name` for that initialization and add the
  default environment to `env_dictionary`.

  (environment_switch): Simplify.  Shorten "dummy environment"
  diagnostic message.  Stop creating an integer-named environment inside
  the `env_table` array, only falling through to use the
  `env_dictionary` if the named environment is not a valid integer or if
  the array is full.  Instead use `env_dictionary` always.  Drop no
  longer needed `pop` quasi-Boolean integer with extra state to suppress
  environment stack underflow errors.  Instead report the error if
  underflow occurs, regardless of any other circumstance.

  (environment_copy): Simplify.  Stop searching the `env_table` array
  for an environment to copy from, only falling through to use the
  `env_dictionary` if the named environment is not a valid integer or if
  the array is full.  Instead search `env_dictionary` always.  Emit "no
  environment specified to copy from" diagnostic only if the `evc`
  request is given no argument.  If the source environment to copy from
  is given but not found, emit a new diagnostic naming the nonexistent
  environment.  Fix bug: stop returning early if no copying could be
  done; instead fall through to the end of the function, which calls
  `skip_line()` and prevents anything on the remainder of the (invalid)
  control line from being interpreted.  Problem dates back to commit
  da3b7137, 6 March 2000 (groff 1.16).

Fixes .

commit 9d86a8e3f68644e891878bbda12497633f1b1bb5
Author: G. Branden Robinson 
Date:   Tue Jul 13 06:29:31 2021 +1000

Regression-test Savannah #60913.

Warning: test fails at this commit.


___

Reply to this item at:

  

___
  Message sent via Savannah
  https://savannah.gnu.org/




Re: Would it be reasonable to list the fonts that are available by default in groff?

2021-07-15 Thread G. Branden Robinson
At 2021-07-15T22:58:41+0200, Wim Stockman wrote:
> Actually I don't think that is necessary.  We could basically write a
> macro that installs on the fly a system available font for groff.
> Using the possibility to run an external script from within groff I m
> sure it is possible to install the font on the fly.  Running Peter
> font-install script. Using the site-font directory so you don't need
> root access.
> Don't you think ?

I think you're raising an orthogonal concern.

Accessing the file system like this would require the use of unsafe
requests, which people would understandably shy away from.

What I think we need is to absorb Peter's font installer into groff,
give it a man page, make sure it works for a preponderance of expected
scenarios, and so forth.  I'd do it, but I haven't had the spoons.

But none of this really has to do with making the _existing_ output
drivers accurately document what they support as shipped, or whether
we're adequately informing the users of the place of font description
files in the groff system as a whole.

I should probably mention that back at the end of May I already updated
the introduction to the groff_font(5) page and its corresponding Texinfo
manual node[1].  Do you think that this[2] is an improvement on groff
1.22.4's page?

Regards,
Branden

[1] 
https://git.savannah.gnu.org/cgit/groff.git/commit/?id=7173468d984d13bc8d03c40905a9d47bc75338f8

https://git.savannah.gnu.org/cgit/groff.git/commit/?id=33112cce6690dae32d23d02052ad5c94c0329d7f
[2] https://man7.org/linux/man-pages/man5/groff_font.5.html


signature.asc
Description: PGP signature


Re: Question about ?roff on Reddit

2021-07-15 Thread G. Branden Robinson
At 2021-07-15T22:17:31+0200, Wim Stockman wrote:
> Oeps, my mistake!
> Hope John you take my apologies .
> But still I also saw the .cw request but I couldn't find it in the
> manual  What does it do ?

That's a great question.  I confused it with .cs, which is the one I
haven't seen used in anger, and I thought I had figured out what John's
trick was doing.  Now I'll have to go back and have a second look.

Or maybe I should write my own word counter...

Regards,
Branden


signature.asc
Description: PGP signature


Re: groff-examples repository

2021-07-15 Thread Wim Stockman
Hi Thomas,
I have my gopher and Gemini server up and running almost for a year now. So
I can mirror the groff section on my gopher and Gemini capsule. The url of
my Gemini and gopher are yasendfile.org.
I also have no problem to dedicate some time to this little projects.
I don't know if you already tested the titan protocol to make it a Gemini
wiki :-)
Kind regards
Wim Stockman

Op do 15 jul. 2021 22:49 schreef Thomas Dupond :

> Hans Bezemer  wrote:
>
> > One of the advantages is that users can submit their own
> > snippets.
>
> Wim Stockman  wrote:
>
> > Maybe create some managed wikipage
> > So the community can contribute to it.
>
> As much as I enjoy the kind words around this project, I would like to
> say that my trade is not related in any way to software development so
> maintaining a wikipage is beyond my grasp.
>
> Sorry if it's a bummer :/ I will go for a static website for now.
>
> If anyone finds an interesting groff macro, feel free to email it to me,
> I will add it to the web page (when it launches).
>
> Thomas
>
>
>


Re: Would it be reasonable to list the fonts that are available by default in groff?

2021-07-15 Thread Wim Stockman
Actually I don't think that is necessary.
We could basically write a macro that installs on the fly a system
available font for groff. Using the possibility to run an external script
from within groff I m sure it is possible to install the font on the fly.
Running Peter font-install script. Using the site-font directory so you
don't need root access.
Don't you think ?
Kind regards
Wim Stockman

Op do 15 jul. 2021 21:03 schreef G. Branden Robinson <
g.branden.robin...@gmail.com>:

> Wherein I illustrate how well I can count...
>
> At 2021-07-16T04:24:29+1000, G. Branden Robinson wrote:
> > Given the coupling between output device and font repertoire, I submit
> > that the most appropriate place to document the available repertoire
> > is in the man page for the relevant output driver.  Four of our seven
> > such pages do in fact cover this material; see grodvi(1), grolbp(1),
> > gropdf(1), grops(1), and gxditview(1).
>
> ...that's five, not four.
>
> [discussion of grohtml and grotty snipped]
> > There are some deficiencies; some pages, like grolbp(1), don't
> > actually mention which font family is the default (news flash--it's
> > Times).
>
> The missing one is grolj4(1), which claims not one but _two_ man pages
> in its demesne, and manages to not cover this material in either.
>
> Someday I reckon I will fix that problem, and due to personal
> irascibility, probably also merge lj4_font(5) into grolj4(1).  There's
> nothing unique about the _groff_ font description format used by the lj4
> driver as far as I can see, and that's not what the page discusses;
> instead it's a description of historical developments of the fonts
> implemented within the printers.  That's not what section 5 of the
> Unix manual is for.  It's interesting reading (I love tech history), but
> I see no reason this stuff can't move into grolj4(1)--but not early in
> the page, because its audience is surely even narrower than that for the
> driver itself.
>
> Regards,
> Branden
>


Re: groff-examples repository

2021-07-15 Thread Thomas Dupond
Hans Bezemer  wrote:

> One of the advantages is that users can submit their own
> snippets.

Wim Stockman  wrote:

> Maybe create some managed wikipage
> So the community can contribute to it.

As much as I enjoy the kind words around this project, I would like to
say that my trade is not related in any way to software development so
maintaining a wikipage is beyond my grasp.

Sorry if it's a bummer :/ I will go for a static website for now.

If anyone finds an interesting groff macro, feel free to email it to me,
I will add it to the web page (when it launches).

Thomas




Re: Question about ?roff on Reddit

2021-07-15 Thread Wim Stockman
Oeps, my mistake!
Hope John you take my apologies .
But still I also saw the .cw request but I couldn't find it in the manual
 What does it do ?
Kind regards
Wim Stockman

Op do 15 jul. 2021 19:43 schreef G. Branden Robinson <
g.branden.robin...@gmail.com>:

> At 2021-07-15T18:09:37+0200, Wim Stockman wrote:
> > Hi Peter, it is already a big bunch of comments. Branden replied with
> > a cool word count example in groff.
> >
> > :-)
>
> Much as I love high fives, I can't claim credit for that one.  First,
> OmenBreeze on Reddit appears to be John Gardner, whom we haven't seen on
> this list much very recently but who has certainly made some solid
> contributions, and also did that awesome device-independent troff
> renderer in JavaScript.
>
> Second, I don't even _have_ a Reddit account.
>
> John's a sneaky devil.  I've never seen the .cw request used in anger
> before.  :D  I'd link directly to his comment but Reddit doesn't seem to
> let me, it just throws up the whole thread.  Maybe "deep linking"
> (:rolleyes:) is a privilege reserved to those who are logged in to the
> site.
>
> Regards,
> Branden
>


[groff] 12/14: [docs]: Update environment discussion.

2021-07-15 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit e50dbed9e740f328448df91f094c139a5bd76990
Author: G. Branden Robinson 
AuthorDate: Tue Jul 13 05:28:09 2021 +1000

[docs]: Update environment discussion.

* doc/groff.texi (Environments): Recast to tighten wording and update
  terminology.  Move discussion of AT environment support from here...

  (Implementation Differences): ...to here.

* man/groff_diff.7.man (Implementation differences): Sync with Texinfo
  node "Implementation Differences" above.
---
 doc/groff.texi   | 46 --
 man/groff_diff.7.man | 15 +++
 2 files changed, 39 insertions(+), 22 deletions(-)

diff --git a/doc/groff.texi b/doc/groff.texi
index cbdfe95..a95603e 100644
--- a/doc/groff.texi
+++ b/doc/groff.texi
@@ -14018,13 +14018,15 @@ requests.
 @cindex environments
 
 It happens frequently that some text should be printed in a certain
-format regardless of what may be in effect at the time, for example, in
-a trap invoked macro to print headers and footers.  To solve this
-@code{gtroff} processes text in @dfn{environments}.  An environment
-contains most of the parameters that control text processing.  It is
-possible to switch amongst these environments; by default @code{gtroff}
-processes text in environment@tie{}0.  The following is the information
-kept in an environment.
+format regardless of what may be in effect at the time.  For example,
+headers and footers are typically rendered by macros called by traps,
+and their text should be set in a consistent style and size regardless
+of how the body text is being rendered at that time.  To address this
+need, @code{roff} systems process text in an @dfn{environment} which
+stores most of the parameters that control text processing.  It is
+possible to create new environments and switch among them; the default
+is named @samp{0} (zero).  The following is the information kept in an
+environment.
 
 @itemize @bullet
 @item
@@ -14037,7 +14039,7 @@ spacing, indentation, line numbering, centering, 
right-justifying,
 underlining, hyphenation data)
 
 @item
-fill and adjust mode
+filling enablement, adjustment enablement and mode
 
 @item
 tab stops, tab and leader characters, escape character, no-break and
@@ -14053,25 +14055,19 @@ input traps
 drawing and fill colours
 @end itemize
 
-These environments may be given arbitrary names (@pxref{Identifiers}.)
-Old versions of @code{troff} only had environments named @samp{0},
-@samp{1}, and @samp{2}.
-
-@DefreqList {ev, [@Var{env}]}
+@DefreqList {ev, [@Var{ident}]}
 @DefregListEndx {.ev}
 @cindex switching environments (@code{ev})
 @cindex environment, switching (@code{ev})
 @cindex environment number/name register (@code{.ev})
-Switch to another environment.  The argument @var{env} is the name of
-the environment to switch to.  With no argument, @code{gtroff} switches
-back to the previous environment.  There is no limit on the number of
-named environments; they are created the first time that they are
-referenced.  The read-only string-valued register @code{.ev} contains
-the name or number of the current environment.
+Enter the environment @var{ident}, which is created if it does not
+already exist.  With no argument, GNU @code{troff} switches back to the
+previous environment.  The read-only string-valued register @code{.ev}
+contains the name of the current environment.
 
 A call to @code{ev} (with argument) pushes the previously active
 environment onto a stack.  If, say, environments @samp{foo},
-@samp{bar}, and @samp{zap} are called (in that order), the first
+@samp{bar}, and @samp{zap} are entered (in that order), the first
 @code{ev} request without parameter switches back to environment
 @samp{bar} (which is popped off the stack), and a second call switches
 back to environment @samp{foo}.
@@ -14086,10 +14082,10 @@ Here is an example:
 .ll -.5i
 .ev
 
-...
+@r{@dots{}}
 
 .ev footnote-env
-\(dg Note the large, friendly letters.
+\[dg] Note the large, friendly letters.
 .ev
 @endExample
 @endDefreq
@@ -15699,6 +15695,12 @@ called with @option{-T}.
 @code{lf} request differently.  For them, its @var{line} argument
 changes the line number of the @emph{current} line.
 
+@cindex environment availability and naming, incompatibilities with
+@acronym{AT} @code{troff} had only environments named @samp{0},
+@samp{1}, and @samp{2}.  In GNU @code{troff}, any number of environments
+may exist, using any valid identifiers for their names
+(@pxref{Identifiers}.)
+
 @cindex input level in delimited arguments
 @cindex delimited arguments, incompatibilities with @acronym{AT} @code{troff}
 Normally, GNU @code{troff} preserves the input level in delimited
diff --git a/man/groff_diff.7.man b/man/groff_diff.7.man
index 125bfac..33c19cd 100644
--- a/man/groff_diff.7.man
+++ b/man/groff_diff.7.man
@@ -4888,6 +4888,21 @@ line.
 .
 .
 .P
+AT
+.I troff
+had only environments named
+.RB \[lq] 0 

[groff] 11/14: doc/groff.texi: Fix style nit.

2021-07-15 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit 3e7d01d0492515b1749cfafaa8e54f9a7f89b3d0
Author: G. Branden Robinson 
AuthorDate: Tue Jul 13 05:16:20 2021 +1000

doc/groff.texi: Fix style nit.

* doc/groff.texi (Input Line Traps, Diversions): Use more idiomatic
  English word ordering.
---
 doc/groff.texi | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/doc/groff.texi b/doc/groff.texi
index 83d65c0..cbdfe95 100644
--- a/doc/groff.texi
+++ b/doc/groff.texi
@@ -13514,8 +13514,8 @@ next four text lines because all but the last are 
interrupted with
 
 Input traps are associated with the environment (@pxref{Environments});
 switching to another environment disables the current input trap, and
-going back reactivates it, restoring the count of already processed
-lines.
+going back reactivates it, restoring the count of lines already
+processed.
 
 @c -
 
@@ -13840,7 +13840,7 @@ baselines and thus does not increase the value 
interpolated by
 @cindex @code{boxa} request, and @code{dn} (@code{dl})
 After completing a diversion, the writable registers @code{dn} and
 @code{dl} contain the vertical and horizontal size of the diversion.
-Only the just-processed lines are counted: for the computation of
+Only the lines just processed are counted: for the computation of
 @code{dn} and @code{dl}, the requests @code{da} and @code{boxa} are
 handled as if @code{di} and @code{box} had been used,
 respectively---lines that have been already stored in the diversion

___
Groff-commit mailing list
Groff-commit@gnu.org
https://lists.gnu.org/mailman/listinfo/groff-commit


[groff] 06/14: [ms]: Fix documentation style nits.

2021-07-15 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit 68f932b0ec098bdcac7f914d04a1ce1ed99e4f5e
Author: G. Branden Robinson 
AuthorDate: Mon Jul 12 21:02:25 2021 +1000

[ms]: Fix documentation style nits.

* doc/ms.ms: Set FR register to "1" for full-length footnotes.

* doc/groff.texi (Adjustment, Tab Stops in ms, ms Headers and Footers):
* doc/ms.ms (Tab stops, Headers and footers):
* tmac/groff_ms.7.man (Tab stops, Headers and footers): Tighten wording.

* doc/groff.texi (Differences from AT ms):
* doc/ms.ms (Differences from AT ms):
* tmac/groff_ms.7.man (Differences from AT ms):
  Fix inappropriately nonparallel grammar in conjunctive structure.

* doc/ms.ms (Tab stops): Document `TA` with boxed table.
* tmac/groff_ms.7.man (Tab stops): Document `TA` with tagged paragraph.
---
 doc/groff.texi  | 21 ++---
 doc/ms.ms   | 27 ++-
 tmac/groff_ms.7.man | 21 +++--
 3 files changed, 39 insertions(+), 30 deletions(-)

diff --git a/doc/groff.texi b/doc/groff.texi
index 62c5691..26a06cf 100644
--- a/doc/groff.texi
+++ b/doc/groff.texi
@@ -3916,8 +3916,8 @@ There are multiple ways to produce headers and footers.  
One is to
 define the strings @code{LH}, @code{CH}, and @code{RH} to set the left,
 center, and right headers, respectively; and @code{LF}, @code{CF}, and
 @code{RF} to set the left, center, and right footers similarly.  This
-approach works best for documents that do not distinguish between odd
-and even pages.
+approach works best for documents that do not distinguish odd and even
+pages.
 
 Another method is to call macros with arguments that set headers or
 footers for odd or even pages; these variables produce four
@@ -3967,9 +3967,8 @@ Use the @code{ta} request to define tab stops as needed.  
@xref{Tabs and
 Fields}.
 
 @Defmac {TA, , ms}
-Use this macro to reset the tab stops to the default for @file{ms}
-(every 5 ens).  Redefine the @code{TA} macro to create a different set
-of default tab stops.
+Reset the tab stops to the @file{ms} default (every 5 ens).
+Redefine this macro to create a different set of default tab stops.
 @endDefmac
 
 @c -
@@ -4315,10 +4314,10 @@ in the center footer (the @code{CF} string).
 Macros that cause @code{groff} @file{ms} to internally reset its
 paragraph rendering parameters (paragraphs, headings, and displays,
 among others) may change the indentation; they do so not by incrementing
-or decrementing it, but set it absolutely.  This can cause problems for
-documents that define additional macros of their own that try to
-manipulate indentation.  The solution is to use, not the @code{in}
-request, but the @file{ms} @code{RS} and @code{RE} macros.
+or decrementing it, but by setting it absolutely.  This can cause
+problems for documents that define additional macros of their own that
+try to manipulate indentation.  The solution is to use, not the
+@code{in} request, but the @file{ms} @code{RS} and @code{RE} macros.
 
 @item
 To make @code{groff} @file{ms} use the default page offset (which also
@@ -4854,8 +4853,8 @@ After GNU @code{troff} performs an automatic line break, 
it then tries
 to @dfn{adjust} the line: inter-word spaces are widened until the text
 reaches the right margin.  Extra spaces between words are preserved.
 Leading and trailing spaces are handled as noted above.  Text can be
-adjusted to the left or right margins only (instead of both), or
-centered; see @ref{Manipulating Filling and Adjustment}.
+aligned to the left or right margins or centered; see @ref{Manipulating
+Filling and Adjustment}.
 
 @c -
 
diff --git a/doc/ms.ms b/doc/ms.ms
index 4ceadc7..05e75aa 100644
--- a/doc/ms.ms
+++ b/doc/ms.ms
@@ -18,6 +18,7 @@
 .nr LT \n[LL]
 .nr PS 11
 .nr VS 13
+.ds FR 1
 .ie t .nr PI 3.5n
 .el   .nr PI 4n
 .ND July 2021
@@ -2408,8 +2409,8 @@ to set the left,
 center,
 and right footers similarly.
 .
-This approach works best for documents that do not distinguish between
-odd and even pages.
+This approach works best for documents that do not distinguish odd and
+even pages.
 .
 .
 .PP
@@ -2532,14 +2533,22 @@ Use the
 .CW ta
 request to set tab stops as needed.
 .
-Use the
-.CW TA
-macro to reset tabs to the default
+.
+.TS
+box;
+lb lb
+lf(CR) lx.
+Macro  Description
+_
+\&.TA  T{
+Reset the tab stops to the
+.I ms
+default
 (every 5 ens).
 .
-Redefine
-.CW .TA
-to create a different set of default tab stops.
+Redefine this macro to create a different set of default tab stops.
+T}
+.TE
 .KE
 .
 .
@@ -2768,7 +2777,7 @@ and displays,
 among others)
 may change the indentation;
 they do so not by incrementing or decrementing it,
-but set it absolutely.
+but by setting it absolutely.
 .
 This can cause problems for documents that define additional macros of
 their own that try to 

[groff] 04/14: [ms]: Document HD hook as a Berkeley extension.

2021-07-15 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit 11532bdde4c488d5651f8f6a65d279a38de970b1
Author: G. Branden Robinson 
AuthorDate: Mon Jul 12 04:36:26 2021 +1000

[ms]: Document HD hook as a Berkeley extension.
---
 doc/groff.texi  | 6 +++---
 doc/ms.ms   | 6 +-
 tmac/groff_ms.7.man | 6 +-
 3 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/doc/groff.texi b/doc/groff.texi
index b1b8897..62c5691 100644
--- a/doc/groff.texi
+++ b/doc/groff.texi
@@ -3954,9 +3954,9 @@ be written, and @code{BT} (``bottom trap'') when the 
footer is to be.
 The @code{groff} trap that @file{ms} sets up to process the header also
 calls the (normally undefined) @code{HD} macro after @code{PT}; you can
 define @code{HD} if you need additional processing after printing the
-header (for example, to draw a line below it).  Any such macros you
-(re)define must implement any desired specialization for odd-, even-, or
-first-numbered pages.
+header (for example, to draw a line below it).  The @code{HD} hook is a
+Berkeley extension.  Any such macros you (re)define must implement any
+desired specialization for odd-, even-, or first-numbered pages.
 
 @c -
 
diff --git a/doc/ms.ms b/doc/ms.ms
index c13de29..4ceadc7 100644
--- a/doc/ms.ms
+++ b/doc/ms.ms
@@ -2494,7 +2494,7 @@ and
 when the footer is to be.
 .
 The
-.I groff
+.I roff
 trap that
 .I ms
 sets up to process the header also calls the
@@ -2508,6 +2508,10 @@ if you need additional processing after printing the 
header
 (for example,
 to draw a line below it).
 .
+The
+.CW HD
+hook is a Berkeley extension.
+.
 Any such macros you (re)define must implement any desired specialization
 for odd-,
 even-,
diff --git a/tmac/groff_ms.7.man b/tmac/groff_ms.7.man
index 62be54d..beccfff 100644
--- a/tmac/groff_ms.7.man
+++ b/tmac/groff_ms.7.man
@@ -1531,7 +1531,7 @@ and
 when the footer is to be.
 .
 The
-.I groff
+.I roff
 trap that
 .I ms
 sets up to process the header also calls the
@@ -1543,6 +1543,10 @@ you can define
 .B .HD
 if you need additional processing after printing the header.
 .
+The
+.B HD
+hook is a Berkeley extension.
+.
 Any such macros you (re)define must implement any desired specialization
 for odd-,
 even-,

___
Groff-commit mailing list
Groff-commit@gnu.org
https://lists.gnu.org/mailman/listinfo/groff-commit


[groff] 09/14: ChangeLog: Remove extraneous word.

2021-07-15 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit 7e8fe9f81538b5e27b5f827b52d5e22e76b554f0
Author: G. Branden Robinson 
AuthorDate: Mon Jul 12 22:02:25 2021 +1000

ChangeLog: Remove extraneous word.
---
 ChangeLog | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index b7fcf71..26792ce 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2352,7 +2352,7 @@
 2021-04-06  G. Branden Robinson 
 
* doc/groff.texi (Manipulating Hyphenation):
-   Recast introductory paragraph to better distinguish between the
+   Recast introductory paragraph to better distinguish the
automatic breaking of words and placement of hyphens at
user-specified hyphenation points (done with the \% escape) and
automatic determination of hyphenation points within words (what

___
Groff-commit mailing list
Groff-commit@gnu.org
https://lists.gnu.org/mailman/listinfo/groff-commit


[groff] 10/14: [docs]: Stop saying "'current' output device".

2021-07-15 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit c49261570838f3dabae491480e32282a8fa28fee
Author: G. Branden Robinson 
AuthorDate: Mon Jul 12 22:03:13 2021 +1000

[docs]: Stop saying "'current' output device".

No roff system I've ever heard of supports changing the output device
during the lifetime of the formatter process, and groff is no different.
---
 NEWS |  2 +-
 doc/groff.texi   | 16 
 man/groff_diff.7.man |  2 +-
 3 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/NEWS b/NEWS
index 6e226c2..f2908e9 100644
--- a/NEWS
+++ b/NEWS
@@ -2195,7 +2195,7 @@ Previously, the text after \fP appeared as bold.
 
 The `substring' request is not new, but hasn't been documented before.
 
-The predefined `.T' string register (which holds the current output
+The predefined `.T' string register (which holds the name of the output
 device) is not new, but hasn't been documented before.
 
 A new request `length' computes the length of a string and returns it in
diff --git a/doc/groff.texi b/doc/groff.texi
index 208a021..83d65c0 100644
--- a/doc/groff.texi
+++ b/doc/groff.texi
@@ -1282,10 +1282,10 @@ and a postprocessor (@code{post-grohtml}).
 
 @cindex output device name string (@code{.T})
 @cindex output device usage register (@code{.T})
-The predefined @code{gtroff} string @code{.T} contains the
-current output device; the read-only register @code{.T} is set to@tie{}1
-if this option is used (which is always true if @code{groff} is used to
-call @code{gtroff}).  @xref{Built-in Registers}.
+The predefined GNU @code{troff} string @code{.T} contains the name of
+the output device; the read-only register @code{.T} is set to@tie{}1 if
+this option is used (which is always true if @code{groff} is used to
+call GNU @code{troff}).  @xref{Built-in Registers}.
 
 The postprocessor to be used for a device is specified by the
 @code{postpro} command in the device description file.  (@xref{Device
@@ -10958,10 +10958,10 @@ Some devices may only have certain permissible sizes, 
in which case
 file specifies which sizes are permissible for the device.
 
 Use the @code{sizes} request to change the permissible sizes for the
-current output device.  Arguments are in scaled points; the
-@code{sizescale} line in the @file{DESC} file for the output device
-provides the scaling factor.  For example, if the scaling factor is
-1000, then the value 12000 is 12@tie{}points.
+output device.  Arguments are in scaled points; the @code{sizescale}
+line in the @file{DESC} file for the output device provides the scaling
+factor.  For example, if the scaling factor is 1000, then the value
+12000 is 12@tie{}points.
 
 Each argument can be a single point size (such as @samp{12000}), or a
 range of sizes (such as @samp{4000-72000}).  You can optionally end the
diff --git a/man/groff_diff.7.man b/man/groff_diff.7.man
index f073742..125bfac 100644
--- a/man/groff_diff.7.man
+++ b/man/groff_diff.7.man
@@ -4088,7 +4088,7 @@ predefines a string,
 containing the argument given to the
 .B \-T
 command-line option,
-namely the current output device
+namely the output device
 (for example,
 .B pdf
 or

___
Groff-commit mailing list
Groff-commit@gnu.org
https://lists.gnu.org/mailman/listinfo/groff-commit


[groff] 14/14: [troff]: Refactor environment handling.

2021-07-15 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit ff394f136b602454c557d0ce96cd788db36d138b
Author: G. Branden Robinson 
AuthorDate: Tue Jul 13 06:11:07 2021 +1000

[troff]: Refactor environment handling.

[troff]: Refactor environment initialization, switching, and copying.

* src/roff/troff/env.cpp: Rename struct `env_list` to `env_list_node`
  since it describes a node of a singly-linked list.  Remove constant
  `NENVIRONMENTS` and array `env_table`.  Add static symbol
  `default_environment_name` to replace string literal.

  (init_environments): Stop initializing `curenv` through `env_table`.
  Use `default_environment_name` for that initialization and add the
  default environment to `env_dictionary`.

  (environment_switch): Simplify.  Shorten "dummy environment"
  diagnostic message.  Stop creating an integer-named environment inside
  the `env_table` array, only falling through to use the
  `env_dictionary` if the named environment is not a valid integer or if
  the array is full.  Instead use `env_dictionary` always.  Drop no
  longer needed `pop` quasi-Boolean integer with extra state to suppress
  environment stack underflow errors.  Instead report the error if
  underflow occurs, regardless of any other circumstance.

  (environment_copy): Simplify.  Stop searching the `env_table` array
  for an environment to copy from, only falling through to use the
  `env_dictionary` if the named environment is not a valid integer or if
  the array is full.  Instead search `env_dictionary` always.  Emit "no
  environment specified to copy from" diagnostic only if the `evc`
  request is given no argument.  If the source environment to copy from
  is given but not found, emit a new diagnostic naming the nonexistent
  environment.  Fix bug: stop returning early if no copying could be
  done; instead fall through to the end of the function, which calls
  `skip_line()` and prevents anything on the remainder of the (invalid)
  control line from being interpreted.  Problem dates back to commit
  da3b7137, 6 March 2000 (groff 1.16).

Fixes .
---
 ChangeLog  |  39 +
 src/roff/troff/env.cpp | 114 -
 2 files changed, 75 insertions(+), 78 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 1e2a6eb..28baec9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,44 @@
 2021-07-13  G. Branden Robinson 
 
+   [troff]: Refactor environment initialization, switching, and
+   copying.
+
+   * src/roff/troff/env.cpp: Rename struct `env_list` to
+   `env_list_node` since it describes a node of a singly-linked
+   list.  Remove constant `NENVIRONMENTS` and array `env_table`.
+   Add static symbol `default_environment_name` to replace string
+   literal.
+   (init_environments): Stop initializing `curenv` through
+   `env_table`.  Use `default_environment_name` for that
+   initialization and add the default environment to
+   `env_dictionary`.
+   (environment_switch): Simplify.  Shorten "dummy environment"
+   diagnostic message.  Stop creating an integer-named
+   environment inside the `env_table` array, only falling through
+   to use the `env_dictionary` if the named environment is not a
+   valid integer or if the array is full.  Instead use
+   `env_dictionary` always.  Drop no longer needed `pop`
+   quasi-Boolean integer with extra state to suppress environment
+   stack underflow errors.  Instead report the error if underflow
+   occurs, regardless of any other circumstance.
+   (environment_copy): Simplify.  Stop searching the `env_table`
+   array for an environment to copy from, only falling through to
+   use the `env_dictionary` if the named environment is not a valid
+   integer or if the array is full.  Instead search
+   `env_dictionary` always.  Emit "no environment specified to copy
+   from" diagnostic only if the `evc` request is given no argument.
+   If the source environment to copy from is given but not found,
+   emit a new diagnostic naming the nonexistent environment.  Fix
+   bug: stop returning early if no copying could be done; instead
+   fall through to the end of the function, which calls
+   `skip_line()` and prevents anything on the remainder of the
+   {invalid} control line from being interpreted.  Problem dates
+   back to commit da3b7137, 6 March 2000 (groff 1.16).
+
+   Fixes .
+
+2021-07-13  G. Branden Robinson 
+
* src/roff/groff/tests/evc_produces_no_output_if_invalid.sh:
  Regression-test Savannah #60913.
* src/utils/grog/grog.am (grog_TESTS): Run test.
diff --git a/src/roff/troff/env.cpp b/src/roff/troff/env.cpp

[groff] 08/14: [ms]: Fix subject/verb agreement in docs.

2021-07-15 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit bcee59f552f720278ac07c60919a0bfae6df4ad4
Author: G. Branden Robinson 
AuthorDate: Mon Jul 12 21:57:46 2021 +1000

[ms]: Fix subject/verb agreement in docs.
---
 doc/groff.texi | 2 +-
 doc/ms.ms  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/doc/groff.texi b/doc/groff.texi
index f9115ce..208a021 100644
--- a/doc/groff.texi
+++ b/doc/groff.texi
@@ -2945,7 +2945,7 @@ Default: 2@dmn{n}.
 @cindex document description macros, [@code{ms}]
 
 All but the simplest documents bear a title.@footnote{Distinguish a
-document title from ``titles'', which is what @code{roff} systems call
+document title from ``titles'', which are what @code{roff} systems call
 headers and footers collectively.}  As their level of sophistication (or
 complexity) increases, they tend to acquire dates of revision,
 explicitly identified authors, sponsoring institutions for authors, and,
diff --git a/doc/ms.ms b/doc/ms.ms
index 513bfd1..a8d22fd 100644
--- a/doc/ms.ms
+++ b/doc/ms.ms
@@ -396,7 +396,7 @@ All but the simplest documents bear a title.\**
 .
 .FS
 Distinguish a document title from \[lq]titles\[rq],
-which is what
+which are what
 .I roff
 systems call headers and footers collectively.
 .FE

___
Groff-commit mailing list
Groff-commit@gnu.org
https://lists.gnu.org/mailman/listinfo/groff-commit


[groff] 02/14: [hdtbl]: Remove unnecessary Make variable.

2021-07-15 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit 5211986692bab3bd10dec736f46d38a4d6792ab4
Author: G. Branden Robinson 
AuthorDate: Sun Jul 11 23:14:03 2021 +1000

[hdtbl]: Remove unnecessary Make variable.

* contrib/hdtbl/hdtbl.am: Remove unnecessary Make variable.

  (hdtbl_builddir): Delete.

  (HDTBL_TFLAG): Remove `-M$(hdtbl_builddir)` option; it's no longer
  needed for hdtbl example document generation needed now that hdtbl is
  no longer stripped.
---
 contrib/hdtbl/ChangeLog | 8 
 contrib/hdtbl/hdtbl.am  | 3 +--
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/contrib/hdtbl/ChangeLog b/contrib/hdtbl/ChangeLog
index 9fdc85d..9add31b 100644
--- a/contrib/hdtbl/ChangeLog
+++ b/contrib/hdtbl/ChangeLog
@@ -1,3 +1,11 @@
+2021-07-11  G. Branden Robinson 
+
+   * hdtbl.am: Remove unnecessary Make variable.
+   (hdtbl_builddir): Delete.
+   (HDTBL_TFLAG): Remove `-M$(hdtbl_builddir)` option; it's no
+   longer needed for hdtbl example document generation needed now
+   that hdtbl is no longer stripped.
+
 2021-07-01  G. Branden Robinson 
 
Skip the stripper, part 2/3 ("hdtbl").
diff --git a/contrib/hdtbl/hdtbl.am b/contrib/hdtbl/hdtbl.am
index 1a68433..68bbe83 100644
--- a/contrib/hdtbl/hdtbl.am
+++ b/contrib/hdtbl/hdtbl.am
@@ -19,12 +19,11 @@
 # along with this program.  If not, see .
 
 hdtbl_srcdir = $(top_srcdir)/contrib/hdtbl
-hdtbl_builddir = $(top_builddir)/contrib/hdtbl
 
 man7_MANS += contrib/hdtbl/groff_hdtbl.7
 
 # Groff command used to generate .ps files
-HDTBL_TFLAG = -M$(hdtbl_srcdir) -M$(hdtbl_builddir)
+HDTBL_TFLAG = -M$(hdtbl_srcdir)
 HDTBL_PFLAG=-t -p -e -U
 HDTBLGROFF = \
   GROFF_COMMAND_PREFIX= \

___
Groff-commit mailing list
Groff-commit@gnu.org
https://lists.gnu.org/mailman/listinfo/groff-commit


[groff] 01/14: contrib/hdtbl/ChangeLog: Update file names.

2021-07-15 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit c13737714de346eccd83a5d2d8dae1c791d0922b
Author: G. Branden Robinson 
AuthorDate: Sun Jul 11 23:13:36 2021 +1000

contrib/hdtbl/ChangeLog: Update file names.

Make them relative to the contributed project's base directory.
---
 contrib/hdtbl/ChangeLog | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/contrib/hdtbl/ChangeLog b/contrib/hdtbl/ChangeLog
index 4af1148..9fdc85d 100644
--- a/contrib/hdtbl/ChangeLog
+++ b/contrib/hdtbl/ChangeLog
@@ -2,13 +2,13 @@
 
Skip the stripper, part 2/3 ("hdtbl").
 
-   * contrib/hdtbl/hdmisc.tmac-u: Rename to...
-   * contrib/hdtbl/hdmisc.tmac: ...this.
+   * hdmisc.tmac-u: Rename to...
+   * hdmisc.tmac: ...this.
 
-   * contrib/hdtbl/hdtbl.tmac-u: Rename to...
-   * contrib/hdtbl/hdtbl.tmac: ...this.
+   * hdtbl.tmac-u: Rename to...
+   * hdtbl.tmac: ...this.
 
-   * contrib/hdtbl/hdtbl.am (HDSTRIPFILES): Rename to...
+   * hdtbl.am (HDSTRIPFILES): Rename to...
(HDTBLTMACFILES): ...this.
(hdtbltmac_DATA): Rename to...
(dist_hdtbltmac_DATA): ...this.

___
Groff-commit mailing list
Groff-commit@gnu.org
https://lists.gnu.org/mailman/listinfo/groff-commit


[groff] 13/14: Regression-test Savannah #60913.

2021-07-15 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit 9d86a8e3f68644e891878bbda12497633f1b1bb5
Author: G. Branden Robinson 
AuthorDate: Tue Jul 13 06:29:31 2021 +1000

Regression-test Savannah #60913.

Warning: test fails at this commit.
---
 ChangeLog  |  6 ++
 src/roff/groff/groff.am|  1 +
 .../tests/evc_produces_no_output_if_invalid.sh | 25 ++
 3 files changed, 32 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index 26792ce..1e2a6eb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2021-07-13  G. Branden Robinson 
+
+   * src/roff/groff/tests/evc_produces_no_output_if_invalid.sh:
+ Regression-test Savannah #60913.
+   * src/utils/grog/grog.am (grog_TESTS): Run test.
+
 2021-07-11  G. Branden Robinson 
 
Update English hyphenation patterns.
diff --git a/src/roff/groff/groff.am b/src/roff/groff/groff.am
index 3c378bb..d39796a 100644
--- a/src/roff/groff/groff.am
+++ b/src/roff/groff/groff.am
@@ -40,6 +40,7 @@ groff_TESTS = \
   src/roff/groff/tests/do_not_loop_infinitely_when_breaking_cjk.sh \
   src/roff/groff/tests/dot-cp_register_works.sh \
   src/roff/groff/tests/dot-nm_register_works.sh \
+  src/roff/groff/tests/evc_produces_no_output_if_invalid.sh \
   src/roff/groff/tests/initialization_is_quiet.sh \
   src/roff/groff/tests/localization_works.sh \
   src/roff/groff/tests/msoquiet_works.sh \
diff --git a/src/roff/groff/tests/evc_produces_no_output_if_invalid.sh 
b/src/roff/groff/tests/evc_produces_no_output_if_invalid.sh
new file mode 100755
index 000..47b0d1d
--- /dev/null
+++ b/src/roff/groff/tests/evc_produces_no_output_if_invalid.sh
@@ -0,0 +1,25 @@
+#!/bin/sh
+#
+# Copyright (C) 2021 Free Software Foundation, Inc.
+#
+# This file is part of groff.
+#
+# groff is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# groff is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see .
+#
+
+groff="${abs_top_builddir:-.}/test-groff"
+
+# Regression-test Savannah #60913.
+
+test -z "$(printf '.evc foo bar\n' | "$groff")"

___
Groff-commit mailing list
Groff-commit@gnu.org
https://lists.gnu.org/mailman/listinfo/groff-commit


[groff] 07/14: [docs]: Apply lexical discipline to "adjustment".

2021-07-15 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit 5bec074c88a77d567e1cc068f42a54ac3641c35c
Author: G. Branden Robinson 
AuthorDate: Mon Jul 12 21:44:18 2021 +1000

[docs]: Apply lexical discipline to "adjustment".

Update discussions and code comments to reserve the term "adjustment" to
the only situation where the formatter logic actually
applies--"full justification" or "normal"/"both" margins in *roff
parlance.  Use forms of the term "align" for contexts where on the left
or right margin is expected to be straight.  The overloading of the term
"adjustment" in roff systems is, I think, a historical artifact of there
once being only two alternatives: adjustment to both margins, and no
adjustment (with a presumption of left-to-right orthography).

We can't rename the .ad request, but we can stop abusing terminology
when we discuss it or macros that interact with it.
---
 contrib/mm/examples/README | 6 +++---
 contrib/mm/groff_mm.7.man  | 6 +++---
 contrib/mm/m.tmac  | 4 ++--
 contrib/mom/om.tmac| 4 ++--
 doc/groff.texi | 4 ++--
 doc/ms.ms  | 2 +-
 tmac/groff_man.7.man.in| 2 +-
 tmac/groff_mdoc.7.man  | 4 ++--
 tmac/groff_ms.7.man| 2 +-
 9 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/contrib/mm/examples/README b/contrib/mm/examples/README
index 1d46e1c..cb0956a 100644
--- a/contrib/mm/examples/README
+++ b/contrib/mm/examples/README
@@ -14,9 +14,9 @@ COVER My general cover macro, this example is using
ms.cov.
 INDA general indexing method, see manual for INITI.
 LT The letter macro.
-LT.se  A Swedish example with the extra
-   Swedish macros for getting a letter conforming
-   to Swedish standard letter, both left and right adjusted.
+LT.se  A Swedish example with extra Swedish macros for
+   composing a letter conforming to Swedish standard style,
+   adjusted to left and right margins.
 ML Marked list, an extended list type.
 MOVE   The MOVE macro, how to begin to print on an exact position.
 MULEnhanced multicolumn mode.
diff --git a/contrib/mm/groff_mm.7.man b/contrib/mm/groff_mm.7.man
index 235b1d7..d2597b3 100644
--- a/contrib/mm/groff_mm.7.man
+++ b/contrib/mm/groff_mm.7.man
@@ -942,7 +942,7 @@ This is used to include external pictures;
 just give the size of the picture.
 .
 .B \-L
-left-adjusts the picture;
+left-aligns the picture;
 the default is to center.
 .
 See
@@ -1041,7 +1041,7 @@ The default is stored in string variable
 Footnote default format.
 .
 Controls the hyphenation (hyphen),
-right margin justification (adjust),
+adjustment to the right margin (adjust),
 and indentation of footnote text (indent).
 .
 It can also change the label justification (ljust).
@@ -3491,7 +3491,7 @@ Default is\~0.
 .
 .TP
 .B Eq
-Equation labels are left-adjusted if set to\~0 and right-adjusted if
+Equation labels are left-aligned if set to\~0 and right-aligned if
 set to\~1.
 .
 Default is\~0.
diff --git a/contrib/mm/m.tmac b/contrib/mm/m.tmac
index 91be07b..84a1e65 100644
--- a/contrib/mm/m.tmac
+++ b/contrib/mm/m.tmac
@@ -880,12 +880,12 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
 .\}
 ..
 .\" external picture
-.\" -L left adjust
+.\" -L left align
 .de EPIC
 .if \\n[.$]<2 .@error "EPIC: Not enough arguments"
 .nr pict*adj 0 \" centered
 .if '\\$1'-L' \{\
-.  shift 1 \" left adjust
+.  shift 1 \" left align
 .  nr pict*adj 1
 .\}
 .if \\n[nl]<0 \&
diff --git a/contrib/mom/om.tmac b/contrib/mom/om.tmac
index 5071325..46868ac 100644
--- a/contrib/mom/om.tmac
+++ b/contrib/mom/om.tmac
@@ -22699,8 +22699,8 @@ does not fit on page \\n[pgnum]\\*[col-num].
 \# default values.  If the first argument is the string 'ragged',
 \# left and right margin notes are printed ragged-right.  If it is
 \# 'symmetric', left margin notes are printed ragged-left and right
-\# margin notes ragged-right.  If omitted, margin notes are left
-\# and right adjusted.
+\# margin notes ragged-right.  If omitted, margin notes are adjusted to
+\# both margins.
 \#
 .de MNinit
 .  nr #MNinit 1
diff --git a/doc/groff.texi b/doc/groff.texi
index 26a06cf..f9115ce 100644
--- a/doc/groff.texi
+++ b/doc/groff.texi
@@ -4327,7 +4327,7 @@ until the first @file{ms} macro is called.  This implies 
that
 also: accessing an undefined register automatically defines it.
 
 @item
-Displays are left-adjusted by default, not indented.  In @acronym{AT}
+Displays are left-aligned by default, not indented.  In @acronym{AT}
 @file{ms}, @samp{.DS} is synonymous with @samp{.DS I}; in @code{groff}
 @file{ms}, it is synonymous with @samp{.DS L}.
 
@@ -7158,7 +7158,7 @@ not write logic to interpret or perform arithmetic on it.
 
 @Defreq {na, }
 Disable output line adjustment.  This produces the same output as
-adjustment to 

[groff] 05/14: groff_ms(7): Use @TMAC_S_PREFIX@.

2021-07-15 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit 9f34f30c3c0fc398054013a81cbbb3cfa0d8f874
Author: G. Branden Robinson 
AuthorDate: Mon Jul 12 05:09:14 2021 +1000

groff_ms(7): Use @TMAC_S_PREFIX@.
---
 tmac/groff_ms.7.man | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tmac/groff_ms.7.man b/tmac/groff_ms.7.man
index beccfff..791df59 100644
--- a/tmac/groff_ms.7.man
+++ b/tmac/groff_ms.7.man
@@ -35,13 +35,13 @@ groff_ms \- GNU roff manuscript macro package for 
formatting documents
 .SH Synopsis
 .\" 
 .
-.SY "groff \-ms"
+.SY "groff \-m@TMAC_S_PREFIX@s"
 .RI [ option
 \&.\|.\|.\&]
 .RI [ input-file
 \&.\|.\|.\&]
 .
-.SY "groff \-m ms"
+.SY "groff \-m m@TMAC_S_PREFIX@s"
 .RI [ option
 \&.\|.\|.\&]
 .RI [ input-file
@@ -2184,7 +2184,7 @@ Names containing only uppercase letters and digits.
 .\" 
 .
 .TP
-.I \%@MACRODIR@/\:s\:.tmac
+.I \%@MACRODIR@/\:@TMAC_M_PREFIX@s\:.tmac
 .I groff
 implementation of manuscript macros.
 .

___
Groff-commit mailing list
Groff-commit@gnu.org
https://lists.gnu.org/mailman/listinfo/groff-commit


[groff] 03/14: [mm]: Refer to self as "mm" internally.

2021-07-15 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit 28c697b384091753f4f18daebbe0a3255289f173
Author: G. Branden Robinson 
AuthorDate: Sun Jul 11 23:16:51 2021 +1000

[mm]: Refer to self as "mm" internally.

...not "mgm".
---
 contrib/mm/Makefile.sim| 2 +-
 contrib/mm/README  | 6 +++---
 contrib/mm/examples/README | 2 +-
 contrib/mm/m.tmac  | 8 
 contrib/mm/mm/0.MT | 6 +++---
 contrib/mm/mm/4.MT | 6 +++---
 contrib/mm/mm/5.MT | 6 +++---
 contrib/mm/mm/ms.cov   | 6 +++---
 contrib/mm/mse.tmac| 6 +++---
 9 files changed, 24 insertions(+), 24 deletions(-)

diff --git a/contrib/mm/Makefile.sim b/contrib/mm/Makefile.sim
index c60f1cc..2d2d6b6 100644
--- a/contrib/mm/Makefile.sim
+++ b/contrib/mm/Makefile.sim
@@ -17,7 +17,7 @@
 #
 # Makefile.sim
 #
-# To install mgm separately as gm.tmac:
+# To install mm separately as gm.tmac:
 # make -f Makefile.sub tmacdir=/usr/local/lib/groff/tmac srcdir=. \
 #  INSTALL_DATA='install -m 644' tmac_m=gm install
 #
diff --git a/contrib/mm/README b/contrib/mm/README
index b3404d7..53244d3 100644
--- a/contrib/mm/README
+++ b/contrib/mm/README
@@ -4,7 +4,7 @@
 are permitted in any medium without royalty provided the copyright
 notice and this notice are preserved.
 
-This is mgm, a macro package for groff.
+This is mm, a macro package for groff.
 
 It is supposed to be compatible with the DWB mm macros,
 and has several extensions.
@@ -13,7 +13,7 @@ Submit bug reports at 
http://savannah.gnu.org/bugs/?group=groff with a
 description of the problem and a sample of text which reproduces the
 error.
 
-Don't forget to mention the version of mgm (look in the beginning
+Don't forget to mention the version of mm (look in the beginning
 of m.tmac) and the version of groff.
 
 Any new ideas or improvements are welcome.
@@ -21,7 +21,7 @@ Any new ideas or improvements are welcome.
 Newest version is available here or at the groff repository.
 ftp://ftp.axis.se/pub/groff/mm.gz
 
-You can install mgm as a separate package without the configure in groff
+You can install mm as a separate package without the configure in groff
 with the following command:
 
 make -f Makefile.sim install
diff --git a/contrib/mm/examples/README b/contrib/mm/examples/README
index 39c3547..1d46e1c 100644
--- a/contrib/mm/examples/README
+++ b/contrib/mm/examples/README
@@ -33,7 +33,7 @@ VERBONBegin verbatim output.
 
 
 And remember, check the manual for all string and number registers,
-I've made sure that mgm is useful in several languages;
+I've made sure that mm is useful in several languages;
 all English output can be redefined.
 
 For Swedish localization, check the manual for groff_mse and the
diff --git a/contrib/mm/m.tmac b/contrib/mm/m.tmac
index 0e4d0d8..91be07b 100644
--- a/contrib/mm/m.tmac
+++ b/contrib/mm/m.tmac
@@ -1,14 +1,14 @@
 .ig
 
 Copyright (C) 1991-2020 Free Software Foundation, Inc.
-mgm is written by J�rgen H�gg 
+mm is written by J�rgen H�gg 
 
-mgm is free software; you can redistribute it and/or modify it under
+mm is free software; you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free
 Software Foundation, either version 3 of the License, or
 (at your option) any later version.
 
-mgm is distributed in the hope that it will be useful, but WITHOUT ANY
+mm is distributed in the hope that it will be useful, but WITHOUT ANY
 WARRANTY; without even the implied warranty of MERCHANTABILITY or
 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 for more details.
@@ -2321,7 +2321,7 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
 .el .LB 0\\$1 0\\$2 0 -1 \& 0 1
 ..
 .\" ### module tbl ###
-.\" This module is copied from groff_ms and modified for mgm.
+.\" This module is copied from groff_ms and modified for mm.
 .\" Yes, it does not resemble the original anymore :-).
 .\" Don't know if I missed something important.
 .\" Groff_ms is written by James Clark.
diff --git a/contrib/mm/mm/0.MT b/contrib/mm/mm/0.MT
index efd79c2..0246bfe 100644
--- a/contrib/mm/mm/0.MT
+++ b/contrib/mm/mm/0.MT
@@ -2,14 +2,14 @@
 .ig
 
 Copyright (C) 1991-2020 Free Software Foundation, Inc.
-mgm is written by J�rgen H�gg 
+mm is written by J�rgen H�gg 
 
-mgm is free software; you can redistribute it and/or modify it under
+mm is free software; you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free
 Software Foundation, either version 3 of the License, or
 (at your option) any later version.
 
-mgm is distributed in the hope that it will be useful, but WITHOUT ANY
+mm is distributed in the hope that it will be useful, but WITHOUT ANY
 WARRANTY; without even the implied warranty of MERCHANTABILITY or
 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 for more details.
diff --git 

Re: Would it be reasonable to list the fonts that are available by default in groff?

2021-07-15 Thread G. Branden Robinson
Wherein I illustrate how well I can count...

At 2021-07-16T04:24:29+1000, G. Branden Robinson wrote:
> Given the coupling between output device and font repertoire, I submit
> that the most appropriate place to document the available repertoire
> is in the man page for the relevant output driver.  Four of our seven
> such pages do in fact cover this material; see grodvi(1), grolbp(1),
> gropdf(1), grops(1), and gxditview(1).

...that's five, not four.

[discussion of grohtml and grotty snipped]
> There are some deficiencies; some pages, like grolbp(1), don't
> actually mention which font family is the default (news flash--it's
> Times).

The missing one is grolj4(1), which claims not one but _two_ man pages
in its demesne, and manages to not cover this material in either.

Someday I reckon I will fix that problem, and due to personal
irascibility, probably also merge lj4_font(5) into grolj4(1).  There's
nothing unique about the _groff_ font description format used by the lj4
driver as far as I can see, and that's not what the page discusses;
instead it's a description of historical developments of the fonts
implemented within the printers.  That's not what section 5 of the
Unix manual is for.  It's interesting reading (I love tech history), but
I see no reason this stuff can't move into grolj4(1)--but not early in
the page, because its audience is surely even narrower than that for the
driver itself.

Regards,
Branden


signature.asc
Description: PGP signature


Re: pdfroff and tables of contents

2021-07-15 Thread G. Branden Robinson
At 2021-07-15T12:34:40-0400, T. Kurt Bond wrote:
> The pdfroff man page says:
> 
> > It transparently handles the mechanics of multiple pass groff
> > processing, when applied to suitably marked up groff source files,
> > such that tables of contents and body text are formatted separately,
> > and are subsequently combined in the correct order, for final
> > publication as a single PDF document.
> 
> What does "suitably marked up" mean?  Looking at pdfmark.ms I see that
> it is marked up with the .XN macro,which it says is to used to
> addressed ms's "standard mechanism for generating a table of contents
> entry based on the text of the section heading; neither is there any
> recognised standard method for establishing a cross reference link to
> the section."  (This seems to ignore the .TC macro entirely, which
> does output a table of contents built from the text of the section
> headings, just at the end of the document, not at the beginning.)
> Other than its use in pdfmark.ms there seem to be no documentation for
> .XN.  The section in pdfmark.ms about .XN has no contents, alas.

Yes.  pdfmark.ms's incompleteness has defeated me more than once.  :(

XN is not a part of any _ms_ implementation I'm aware of, not even
groff's.  It does not appear in 4.2BSD ms or Version 10 Research Unix,
either.

In the groff system, XN is defined in spdf.tmac, which is itself part of
contrib/pdfmark.  There are some good comments in the file, including
one specifically documenting XN, so I won't repeat that material[1]
here.

> Would it be worth mentioning the existence of pdfmark.pdf (and
> pdfmark.ms, since its use of .XN is the only example) in pdfroff(1)?

Yes, I think so; given the tenor of response to other feedback on
pdfroff (sorry, I don't have a link handy), I think this point could
bear some emphasis.  There is a lot about pdfmark, and PDF processing in
general that I don't understand, but the impression I have formed is
that pdfroff and pdfmark are their own mini-ecosystem within groff.  To
some extent, they have to be, to resolve the forward reference problem.
Documenter's Workbench troff had an "mm" command to perform this work,
invoking multiple passes of the formatter to produce an internally
cross-referenced document.  We have the moral equivalent in
mmroff(1)[2].

Sometimes "groff -Tpdf" is all you require, and sometimes it isn't.

Kurt, could you file some Savannah bugs about this and the previous
issue you raised, about font repertoires?  My to-do list grows faster
than I can shrink it, but I do burn items off occasionally.

Regards,
Branden

[1] 
https://git.savannah.gnu.org/cgit/groff.git/tree/contrib/pdfmark/spdf.tmac#n70
[2] I've toyed with the idea of writing an "msroff" script since I've
found I enjoy working with ms(7), and my hair-splitting revision of
Larry Kollar's ms.ms document is reaching the point where I have
little else to do but grapple with the table of contents and
indexing discussions, which are at present insufficiently developed.


signature.asc
Description: PGP signature


Re: Would it be reasonable to list the fonts that are available by default in groff?

2021-07-15 Thread G. Branden Robinson
At 2021-07-15T12:10:05-0400, T. Kurt Bond wrote:
> Perhaps in groff_font(5) and in groff.texi?

Thanks for raising this point; it is a poorly understood one.  And that
likely means we don't document it well enough.

The available font repertoire is specific to each output device, so
groff_font(5) or the corresponding sections of our Texinfo manual are
not, perhaps, the best place.

It's hard to situate the material where you're looking for it, because a
*roff formatter does not enforce the availability of _any_ font or
style.  (There is always a default, but it is determined by the device
description file, "DESC".)  In practice, documents or macro packages
must to do this, by attempting to select a font/style by name and
risking failure.

In _practice_, especially in the years groff has been around, it seems
it's pretty reasonable to assume the availability of styles R, I, B, and
BI.  And for typesetter devices, the impact of PostScript on the digital
typography industry suggests to me that you can assume that the 13 base
fonts of its original specification[1] will be available everywhere,
especially now that metrically-compatible fonts are available as Free
Software.

Given the coupling between output device and font repertoire, I submit
that the most appropriate place to document the available repertoire is
in the man page for the relevant output driver.  Four of our seven such
pages do in fact cover this material; see grodvi(1), grolbp(1),
gropdf(1), grops(1), and gxditview(1).

grohtml(1) and grotty(1) omit this information semi-understandably,
since they're not in control of font rendering in the same way that
other output drivers are.  If we had/have good CSS support in grohtml,
on the other hand, for it this objection evaporates.  But my
understanding of grohtml is terrible.[2]

It's also probably a good idea for grotty(1) to explicitly enumerate the
fonts (really styles) that it supports, particularly since style BI is
always available--though not always exposed by macro packages, because
support for the Linotron 202 which featured this style was a
late-breaking development in the rather logarithmic trajectory of *roff
development.

There are some deficiencies; some pages, like grolbp(1), don't actually
mention which font family is the default (news flash--it's Times).

grodvi(1), gropdf(1), and grops(1) list and describe their available
fonts, and when rendered with themselves, setting them in their own
typeface.  It's a nice effect and one I have preserved despite my broad
agreement with Ingo and others that man pages should be written with
portability foremost in mind.

Moreover, to your overall point, our documentation could make the point
in my first paragraph more clear.

As always, I welcome correction on any point above.

Just as a heads-up, I happen to have been working on groff_font(5) and
its corresponding Texinfo nodes today, but I am not yet tackling the
deficiencies I've noted above.  So fixes for them won't necessarily be
in the next push (groff-commit list traffic) you see.

Regards,
Branden

[1] Take the Cartesian product of Times, Helvetica, and Courier (a
serif, sans-serif, monospaced family, respectively) with the 4
styles noted above--that gets you 12 faces.  The "Symbol" font is
the 13th.

[2] To my delight, Gaius Mulley recently claimed a Savannah ticket to
work on, .


signature.asc
Description: PGP signature


Re: Question about ?roff on Reddit

2021-07-15 Thread G. Branden Robinson
At 2021-07-15T18:09:37+0200, Wim Stockman wrote:
> Hi Peter, it is already a big bunch of comments. Branden replied with
> a cool word count example in groff.
> 
> :-)

Much as I love high fives, I can't claim credit for that one.  First,
OmenBreeze on Reddit appears to be John Gardner, whom we haven't seen on
this list much very recently but who has certainly made some solid
contributions, and also did that awesome device-independent troff
renderer in JavaScript.

Second, I don't even _have_ a Reddit account.

John's a sneaky devil.  I've never seen the .cw request used in anger
before.  :D  I'd link directly to his comment but Reddit doesn't seem to
let me, it just throws up the whole thread.  Maybe "deep linking"
(:rolleyes:) is a privilege reserved to those who are logged in to the
site.

Regards,
Branden


signature.asc
Description: PGP signature


pdfroff and tables of contents

2021-07-15 Thread T. Kurt Bond
The pdfroff man page says:

It transparently handles the mechanics of multiple pass groff  processing,
 when  applied to suitably marked up groff source files, such that tables
of contents and body text are formatted separately, and are subsequently
 combined  in  the  correct order, for final publication as a single PDF
document.


What does "suitably marked up" mean?  Looking at pdfmark.ms I see that it
is marked up with the .XN macro,which it says is to used to addressed ms's
"standard mechanism for generating a table of contents entry based on the
text of the section heading; neither is there any recognised standard
method for establishing a cross reference link to the section."  (This
seems to ignore the .TC macro entirely, which does output a table of
contents built from the text of the section headings, just at the end of
the document, not at the beginning.)   Other than its use in pdfmark.ms
there seem to be no documentation for .XN.  The section in pdfmark.ms about
.XN has no contents, alas.

Would it be worth mentioning the existence of pdfmark.pdf (and pdfmark.ms,
since its use of .XN is the only example) in pdfroff(1)?
-- 
T. Kurt Bond, tkurtb...@gmail.com, https://tkurtbond.github.io


Would it be reasonable to list the fonts that are available by default in groff?

2021-07-15 Thread T. Kurt Bond
Perhaps in groff_font(5) and in groff.texi?
-- 
T. Kurt Bond, tkurtb...@gmail.com, https://tkurtbond.github.io


Re: Question about ?roff on Reddit

2021-07-15 Thread Wim Stockman
Hi Peter, it is already a big bunch of comments. Branden replied with a
cool word count example in groff.

:-)

Op do 15 jul. 2021 02:36 schreef Peter Schaffter :

> On Wed, Jul 14, 2021, Nate Bargmann wrote:
> > I saw the following post on r/linux today:
> >
> >
> https://www.reddit.com/r/linux/comments/ojkjm9/how_do_nrgroff_compare_with_more_modern_text/?utm_source=share_medium=web2x=3
> >
> > Perhaps some of the folks here can provide some insight.
>
> I have no desire to create a Reddit account just to answer this
> thread, but I hope someone else on the list does.  It seems absurd
> that in 2021 people still have notions about groff that were already
> out-of-date twenty years ago.
>
> If someone does respond on Reddit, can said person please notify the
> list so the rest of us can read what's said?
>
> --
> Peter Schaffter
> https://www.schaffter.ca
>
>