help / color / mirror / Atom feed
From: Ingo Schwarze <>
To: "Anthony J. Bentley" <>
Subject: Re: Incorrect column count in lint messages
Date: Fri, 14 Feb 2020 18:06:09 +0100	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <21953-1581656851.930227@-SgG.yrqY.5jf->

Hi Anthony,

Anthony J. Bentley wrote on Thu, Feb 13, 2020 at 10:07:31PM -0700:

> Consider the following example:
> .Dd
> .Oo lorem ipsum dolor sit amet consectetur adipiscing elit sed do eiusmod \
> Ar Ns , Oc
> When run through mandoc -Tlint, this warning appears:
>     mandoc: /tmp/foo.1:4:78: WARNING: skipping no-space macro
> The line number is correct, but the column count wrongly includes the
> length of the previous line.

That is very hard to fix because the trailing backslash requests joining
both lines before further parsing, which is done very early between
the read.c module and the roff(7) preprocessor.  By the time the
mdoc(7) parser gets to see the line, the information which parts
of the line originally were on which input line is no longer
available.  I don't see any way of fixing this short of storing
an input column number for every single character in the parse

There are many more ways to get the input line preprocessed.
They all mangle the column count, for example:

   $ mandoc -mdoc -W all 
  .ds w longword
  .Em \*w Ns .     
  mandoc: <stdin>:2:14: WARNING: skipping no-space macro

The "Ns" is in column 9, not column 14.

I don't think it would be a good idea to even try to fix this.

Preprocessing is not very widespread in well-written manual pages
in the first place, even traling \ is usually best avoided (though
there are a few unusual circumstances where it makes sense), and
improving column numbers in messages eould hardly justify major
complications of the code.

 To unsubscribe send an email to

      reply	other threads:[~2020-02-14 17:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-14  5:07 Anthony J. Bentley
2020-02-14 17:06 ` Ingo Schwarze [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \
    --subject='Re: Incorrect column count in lint messages' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).