groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Groff] Strange error messages from Groff 1.22.3


From: Eli Zaretskii
Subject: Re: [Groff] Strange error messages from Groff 1.22.3
Date: Tue, 11 Nov 2014 17:50:40 +0200

> From: Doug McIlroy <address@hidden>
> Date: Sun, 09 Nov 2014 11:54:51 -0500

Sorry to reply only now, but I don't subscribe to the list, so I don't
receive messages unless I'm explicitly CC'ed.

> It is safe to convert backslashes to slashes only when it is
> known that the literal string is indeed a file name.

Indeed.  Which is why the changes I proposed are in 'do_file'
functions and in a small number of other places, where it is known
a-priori that the string in question is a file name.

> "Fixing" .lf commands is of a piece with the maddening AI of
> Microsoft Word and Open Office, which think that they know what you
> mean.*

I don't think the corrections I proposed deserve this comparison.

> If .lf requests get fixed, should not .so requests be fixed too? 
> What happens then to .so \*[input_file]? Treat \* differently
> \f in context? And what if one doesn't use a preprocessor and has
> defined .lf to mean something else?  Special cases multiply 
> without end.

As Werner points out, I didn't suggest to fix '.lf', only the parts in
the programs that format and emit the '.lf' directives whose 2nd
argument is known to be a file name.

> To return to my first sentence. It may be reasonable to canonicalize
> file-name command arguments in groff and preprocessors.

That is exactly what the proposed changes aim at doing.  The main
problem here, as you point out, is how do we tell that a command-line
argument is a file.  That is why the changes are in places that
clearly treat the arguments as files, e.g., by using them in a call to
'fopen'.

> Once done, no further special treatment is required, except at calls
> of the Windows API, for which slashes must get rewritten, which
> apparently happens already.

The Windows file-I/O APIs are happy with forward slashes, so no
rewriting is necessary (and none happens already for that reason).

> * For a ludicrous example, when I type my own name,
>         M. Douglas McIlroy
> at the beginning of a line--as for a signature or author line--
> Open Office thinks that I've begun a paragraph numbered with
> a Roman numeral, and proceeds to tack "MI." onto the beginning 
> of the next line!

AFAIK, you can disable this automation by tweaking the Office's
"auto-correction" options.

> Groff has blessidly little AI. Let's keep it so.

I agree.  The changes I proposed are minimal, and without them file
names with backslashes typed by users on the Groff command line are
simply processed incorrectly.  The changes are nowhere near anything
that could go by the "AI" handle.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]