The discussion about `so` request usage got me to thinking, so I decided
to flag another consequence of the newly consistent system for handling
file name arguments to *roff requests.

The short version is that if you've been doing stuff like this:

.so "5150".lrc

to read a file named "5150".lrc--yes, with the quotation marks truly as
part of the file name--then you will need to migrate to the new
`ds`/`as`-style syntax or you will probably be unhappy.

.so ""5150".lrc

Handling of a neutral double quote in any non-initial position has not
changed.  For example,

.so Planet_"X".lrc

...worked before and will continue to work without change.

How many groff users are in the habit of naming files with a leading
neutral double quote?  Few, I suspect--perhaps fewer than name with
embedded spaces any files the formatter needs to handle.  On the other
hand, neutral double quotes in file names _did_ actually work.  Unless
you got adventurous and combined them with embedded spaces, in which
case things fell apart.

So in groff Git HEAD (actually, in Git for the past few months), you've
been able to do this:

.so Planet "X".lrc

...whereas you could not in groff 1.23 and earlier, or Heirloom Doctools
troff, DWB 3.3 troff, or Solaris 10 troff.

I had thought this was too much of a corner case to flag in NEWS, let
alone at the top of the 1.24 entry as an "incompatible change", but I
got my fingers burnt with the hyphenation-language-as-global-versus-
environmental discussion, so better safe than sorry, I reckon.

Again, for background on this, see comments #2-#6 (or so) of
<https://savannah.gnu.org/bugs/?65108>.  (Most of the discussion in that
ticket is between me and Dave Kemper on with whether and how to get GNU
troff to accept, encode for the C standard library, and report
non-printable byte values in file names.  I think we have a strategy
sorted out, but time ran out to implement it for groff 1.24.)

Here's the NEWS item that should appear in my next push to Git:

* If your roff(7) documents specify a file name that starts with a
  neutral double quote (") to any of the requests `cf`, `hpf`,
  `hpfa`, `mso`, `msoquiet`, `nx`, `open`, `opena`, `so`, `soquiet`, or
  `trf`, you are likely to get a diagnostic message, or the formatter
  will open a file of the same name except for the leading neutral
  double quote.  That is because these requests are now able to process
  file names containing leading space characters.  (This change also
  makes the request syntax consistent with that of `ds`, `as`, and
  others.)  The solution is to add an additional neutral double quote to
  the start of the file name argument.  For example, we would change:

    .so "5150".lrc

  to:

    .so ""5150".lrc

  to tell the formatter to read a file named '"5150".lrc', where the
  neutral single quotes are used to bracket the file name.

Regards,
Branden

Attachment: signature.asc
Description: PGP signature

Reply via email to