Update of bug #68719 (group groff):

                  Status:                    None => Confirmed
                 Summary: [soelim] .so'ed file without a trailing newline is
handled differently => [soelim] appends a newline to included files lacking
them, inconsistently with troff

    _______________________________________________________

Follow-up Comment #1:

[comment #0 original submission:]
> As the info manual notes about the .so request: "Since the formatter replaces
> the entire control line with the contents of a file, FILE must end with a
> newline, or the formatter will continue reading the next input line of the
> 'roff' file as if it were part of the last line of the sourced file."  An
> example demonstrates this.
> 
> However, this behavior changes if the soelim preprocessor is used: soelim
> silently adds a final newline to the interpolated file, even in "raw" mode.
> Consider this example slightly modified from the one in the manual:

> $ printf 'foo' > xxx
> $ soelim -r <<EOF
> The situation is
> .so xxx
> bar.
> EOF
> The situation is
> foo
> bar.


> In 2018, Ralph Corderoy pointed out this difference between how the formatter
> treats .so and how soelim does
> (http://lists.gnu.org/r/groff/2018-08/msg00038.html).  He further observes
> that this is a difference between GNU's soelim and Heirloom's, which does not
> append the newline.  This suggests that GNU soelim behavior might be changed
> to match that of Heirloom (and presumably AT&T).

Right.  That seems like a reasonable expectation.  A set of input files should
be as indifferent as possible to whether they're preprocessed "early" or
"late".

> Even if no code is changed, this difference should be documented.  Currently
> it is not mentioned in the .so section of the info manual, nor in the soelim
> man page.  I've filed this ticket as "Incorrect behaviour" but it can be
> changed to "Documentation" if this option is chosen.

Right.  I think we should fix this in the 1.26 development cycle.

_soelim_(1) and/or GNU _troff_ might also warn about an input file that is
missing a final newline.  Possession of same is, as I recall, part of the
POSIX definition of a "text file".

(Why have both warn?  _soelim_(1) explains how it might be used for general
text file management, with no further expectation of typesetting with *roff.)


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?68719>

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

Attachment: signature.asc
Description: PGP signature

Reply via email to