[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] *.man: Break URIs at points specified by the Chicago Style
From: |
G. Branden Robinson |
Subject: |
Re: [PATCH] *.man: Break URIs at points specified by the Chicago Style |
Date: |
Tue, 2 Nov 2021 00:50:41 +1100 |
User-agent: |
NeoMutt/20180716 |
Hi, James!
At 2021-10-18T10:05:55-0400, James K. Lowden wrote:
> Is there a way to say, "set this URL all on one line if at all
> possible, else break at these specific points"? Sort of a ".ne" for
> horizontal space?
Yes, there is!
[man]: Try to minimize the number of times a URI is broken when it has
to be typeset and prevent it from provoking adjustment warnings.
* tmac/an-ext.tmac (UE, ME): Do it. New Boolean register `mL` records
whether the URI will cause a break. New string `m2` contains the
user-specified URI (`m1`) plus the angle brackets around it and any
user-specified trailing punctuation (\$1). New register `mW` stores
the formatted width of `m2`. If the page offset plus the indentation
plus the current horizontal position on the output line plus `mW`
exceeds the output line length, turn off adjustment and break the line
_before_ typesetting `m2`. Then, if we forced a break, restore the
previous adjustment mode. Shift off the first macro parameter and
emit the (undocumented) rest as before.[1]
> I think URLs are easier to read (like any word) on one line. I think
> I would rather see one unbroken, even if it meant the preceding line
> had only the word "at" on it. Whitespace is a lot cheaper today, now
> that ink and paper are mostly made of photons.
I agree, and since I'm one of those weirdos who still lets man pages
undergo adjustment (.ad b), I was exasperated with troff getting cross
when it encountered an un-adjustable line.
Here's how I documented it:
[...]
support ECMA-48 OSC 8 escape sequences (see grotty(1)). When
device support is unavailable or disabled with the U register
(see section “Options” below), .MT and .UR URIs are rendered
between angle brackets after the linked text. If such a URI will
not fit on the remainder of the output line, the macro package
temporarily turns off adjustment (if enabled) and breaks the line
before the URI to minimize the number of output lines over which
it spreads.
[...]
Regards,
Branden
[1]
https://git.savannah.gnu.org/cgit/groff.git/commit/?id=c7efb5fd40aae5293d9de87092b7a4b2be89df91
signature.asc
Description: PGP signature