From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from zelgadis.fingolfin.org (zelgadis.fingolfin.org [72.14.186.115]) by mandoc.bsd.lv (OpenSMTPD) with ESMTP id c2160b29 for ; Sat, 29 Feb 2020 13:57:22 -0500 (EST) Received: from [192.168.1.106] (96-87-91-58-static.hfc.comcastbusiness.net [96.87.91.58]) by zelgadis.fingolfin.org (Postfix) with ESMTPSA id 3C9DFC0DC; Sat, 29 Feb 2020 18:57:19 +0000 (UTC) From: Robert Mustacchi To: discuss@mandoc.bsd.lv Subject: man_validate.c PP/LP macro confusion Message-ID: Date: Sat, 29 Feb 2020 10:57:18 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 X-Mailinglist: mandoc-discuss Reply-To: discuss@mandoc.bsd.lv MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Hi, While dealing with a number of old manual pages that haven't been converted to mdoc yet, I noticed that when asking mandoc to lint them (mandoc -Tline ), the error message it generates has confused a few folks. The following is the warning: mandoc: abs.3c:10:2: WARNING: skipping paragraph macro: PP after SH The warning itself is clear; however, the source actually uses a .LP macro and not a .PP macro. Most of the time folks know to map the two together, but it would be a little clearer if it listed the actual macro that was present in the document that was invalid. I believe this happens because man_validate() in man_validate.c explicitly converts the .LP macro internally to be treated as a .PP. When it then triggers this check in post_SH(), it uses the modified name to print out the warning. The same appears to be true check_par(). While it's possible to modify things such that the warning generates the right token name, I wasn't sure if such a change would be desired or accepted given the explicit consolidation and transformation for this being done in man_validate(). I'd appreciate hearing what others thought. Thanks, Robert -- To unsubscribe send an email to discuss+unsubscribe@mandoc.bsd.lv