On Mon Nov 18, 2024 at 5:30 PM CET, G. Branden Robinson wrote:
> [...]
> I solicit opinions, from anyone, on the foregoing.
>
> Here's the behavior of the `device` request after this change.
>
> $ printf '.device ps:exec A B\\~C\\ D\\0E\\|F\\^G\\h".5m"I\\v".5m"J\n' | 
> ./build/test-groff -Zww | grep '^x X'
> troff:<standard input>:1: warning: ignoring escaped '0' in device extension 
> command request argument
> troff:<standard input>:1: warning: ignoring escaped 'h' in device extension 
> command request argument
> troff:<standard input>:1: warning: ignoring escaped 'v' in device extension 
> command request argument
> x X ps:exec A B\~C\ DE\|F\^G".5m"I".5m"J
>
> [...]
> One might wonder, what did earlier versions of groff do, before I came
> along and ruined everything with my unthinking, spasmodic recklessness?
>
> $ printf 'foobar\n.device ps:exec A B\\~C\\ 
> D\\0E\\|F\\^G\\h".5m"I\\v".5m"J\n' | ~/groff-1.22.3/bin/groff -Zww | grep '^x 
> X'
> x X ps:exec A B\~C\ D\0E\|F\^G\h".5m"I\v".5m"J
> $ printf 'foobar\n.device ps:exec A B\\~C\\ 
> D\\0E\\|F\\^G\\h".5m"I\\v".5m"J\n' | ~/groff-1.22.4/bin/groff -Zww | grep '^x 
> X'
> x X ps:exec A B\~C\ D\0E\|F\^G\h".5m"I\v".5m"J
> $ printf 'foobar\n.device ps:exec A B\\~C\\ 
> D\\0E\\|F\\^G\\h".5m"I\\v".5m"J\n' | ~/groff-stable/bin/groff -Zww | grep '^x 
> X'
> x X ps:exec A B\~C\ D\0E\|F\^G\h".5m"I\v".5m"J
>
> So there _is_ a difference...older groffs put out `\0`, `\h`, and `\v`
> for an input `\0`, `\h`, and `\v`, and with my pending change, nothing
> will be put out for them, but you'll get a warning (if enabled).
> [...]
> But I can change the output difference back, like this:
>
> $ printf '.device ps:exec A B\\~C\\ D\\0E\\|F\\^G\\h".5m"I\\v".5m"J\n' | 
> ./build/test-groff -Zww | grep '^x X'
> troff:<standard input>:1: warning: not interpreting escaped '0' in device 
> extension command request argument
> troff:<standard input>:1: warning: not interpreting escaped 'h' in device 
> extension command request argument
> troff:<standard input>:1: warning: not interpreting escaped 'v' in device 
> extension command request argument
> x X ps:exec A B\~C\ D\0E\|F\^G\h".5m"I\v".5m"J
>
> The alternative diff is simple:
> [...]
> +         warning (WARN_SYNTAX, "not interpreting escaped '%1' in device"
> +                  " extension command request argument", char(c1));
> +       else
> +         warning(WARN_SYNTAX, "not interpreting escaped control character"
> +                 " (code %1) in device extension command request"
> +                 " argument", c1);

Just a small nitpick, but you should probably do s/(warning) /\1/.

> Which do you prefer?
> [...]

I would prefer the former IF it removed their arguments. Since it
doesn't and the removal is only partial, I prefer the latter.

~ onf

Reply via email to