From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id aMuwDFVEj2daUAAAqHPOHw:P1 (envelope-from ) for ; Tue, 21 Jan 2025 06:53:09 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id aMuwDFVEj2daUAAAqHPOHw (envelope-from ) for ; Tue, 21 Jan 2025 07:53:09 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=ZrDGXtMK; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1737442389; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=ZIYoGIbct2CAC6wJbb305rGCFii5tiyUkvVvt4XHdB8=; b=dA5uSNfleX2XUQDtoztaTWzj42ViDA6LCm0VxfVDjcNtq1odjVSdw57BYYDVY5EHIwy3Ey Tc39UdnegubMPKT7TyxH9CYXvFnpGgozsZlhP339ixgaPQvFRuzdsuUGhEHh048R6vdR5Y bsFna4+CuoDzbDI3zAaY+YzF7ht4NhzbQ49xjILlNwVcyx+IE9aR/vLC/M+UbwE4L+4eJE nYn8aWwfsfPZtOHSdZVpanr3MWsURfh/CugtzEAeA4EdLn+KMxXmbGiaU5x3XnTUNozvXw PcXUDdkwqv4pNCc6sLBYz7ZWXnpsul/3uxhG2WLigXbtMt6kIigvs0QmJNuZFQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=ZrDGXtMK; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=key1; d=yhetil.org; t=1737442389; a=rsa-sha256; cv=none; b=WnIycaMH1C74v4oSMdzvkhuAXC89z/xMeiPc/uj772jb63j6sib5WiN3q180hkUJpHmxGk AY20pk/fN7uBxgFEkrI2l51VLxfS4xF0Bb+hFQeQV0tzkZ7XJ3MbSF3QfftAXmfwaTc7YY LxW9nwRI8xq/9wbp/9vWrY80PNpSlet1FO74G3MjxiZVXUNBKahVd08Diy8HokFLSMHvnO KNcsncq/oT1oOT5Smf29KsK2qJ4cg+CrixT9edbXsBDNGD2Y1yCmJpUsDWGIeEeoQnpoNV xKGbzTtLAh2rqF6QMUJfu68xjnYktDsCLwKB9KCL/+Cc9hy784EIy25rvTkaKQ== Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id AF4BA8366D for ; Tue, 21 Jan 2025 07:53:08 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ta87N-00039L-14; Tue, 21 Jan 2025 01:52:09 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ta87L-000398-C7; Tue, 21 Jan 2025 01:52:07 -0500 Received: from mail-oa1-x2a.google.com ([2001:4860:4864:20::2a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ta87J-00006M-AL; Tue, 21 Jan 2025 01:52:07 -0500 Received: by mail-oa1-x2a.google.com with SMTP id 586e51a60fabf-29fc424237bso4797020fac.0; Mon, 20 Jan 2025 22:52:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737442323; x=1738047123; darn=gnu.org; h=in-reply-to:content-disposition:mime-version:message-id:subject:cc :to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=ZIYoGIbct2CAC6wJbb305rGCFii5tiyUkvVvt4XHdB8=; b=ZrDGXtMKhL2GzJoyfp29O9pMLkX0XFmC1fAJTY7rTwummYOVwc4hrWfFQ+W/F+ju/a U8t3hOyp6JnwNS2OKAfRPGMsR0qiaf1i4JlQ1flBQ9WDffONc2ipmifLgINomas8cPsV U3aEi0qVoDSRnhoJieKyShfNoYWkjlrMAyeTZ++ipMfvoUTcxSKHoChgdcLKTszQRi4x PwPDsTibpCUDxJ2rlwNgqLhRt3sWDaahqmPHkoNuqy4BszEjWGxey+cOUcr8ZcY9KQ9e jQ25+5KGEWlkDF+zWrM59r4q8UsLPdckahjiP7cxe+Nqe2qg3zd86JsyCEXKS7KtN0T2 G0nQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737442323; x=1738047123; h=in-reply-to:content-disposition:mime-version:message-id:subject:cc :to:from:date:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ZIYoGIbct2CAC6wJbb305rGCFii5tiyUkvVvt4XHdB8=; b=bZhN4ppIv4QqSedDsCbveRYCENPyRxwcctbxVyraatlSuxTOKwiuT4kbRZabZpxEs5 9qFyrUchJXwmgWyHxQ0v8PCj1oHRaDsnkXWYTLUEwnvpeszZ4xSuZDxbvsu/PgL3BB5U duJ9HrTa15DELSYS8d+Rm6yYPAeWKF/YklDkVqs0mj8r7xehXvZbf/c4uBO4CL4raQ/U IK+QF7y4KPbJuVb7XiUPtoacHCYRT4cKR6jk8agpKwoGbtDnKgwYmSvkDU2wKD97VlMa aj1XAVP1Cz8RPtGT+xe3cajJlfAE1iIQzZs78X3VBs4tHQkARKMce696oVF3oW0zIAKR NPng== X-Forwarded-Encrypted: i=1; AJvYcCV4vMIdvXCLXkp3pn+X2KSkTcDvvOUdh8efkRTRnTJBnHFDSOC+wFq9p4Va/R1Epqrq7dog4A==@gnu.org X-Gm-Message-State: AOJu0YwxnvyHXK9bzVcBbyCpK7+sZj4CCiOUWzRJ1rbuUjW4yHnrWeZr +s3Ooa7ER1efinGCeaheQ/SQtAcqzbGjw7Zear5ma108aM2thu7C X-Gm-Gg: ASbGncs9jfV/TGDOqE5TpWORKfghC2CoMsWnIeu3qdoWUJmNSG5PbXCulJTs/SRyKMf 51xy0/Qqsmj9T8tJJUl3QB1ZoAmEViRvkXBk7AZsEb4C4IZje7WvrRE3fXREZ8efJvBVfaSDWzs 6lvuN8HEdFpAg0bYw+QMWoKwpmwHmc5flWKSQT1b3kMTsJxDgtCsF/0ZsAo3liQkiGr/Zk/DTUV jXUc89QAIDo5/xMaUujHo1xnBkKs80aa7/CL8JMUnZSBDeHL74lj5KBEiUq X-Google-Smtp-Source: AGHT+IEMeijthvsIHhkc348ihGQTSa3YqYKnza4KtRwlx5BFW+FjAuhIEiY++llco0TrPkA9x3QctQ== X-Received: by 2002:a05:6871:d082:b0:296:ee2e:a23c with SMTP id 586e51a60fabf-2b1c099c411mr9806982fac.5.1737442323325; Mon, 20 Jan 2025 22:52:03 -0800 (PST) Received: from illithid ([2600:1700:957d:1d70::49]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-2b1b900bb4bsm3534188fac.47.2025.01.20.22.52.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Jan 2025 22:52:02 -0800 (PST) Date: Tue, 21 Jan 2025 00:52:00 -0600 From: "G. Branden Robinson" To: Ihor Radchenko Cc: emacs-orgmode@gnu.org, groff@gnu.org Subject: Re: [BUG] "\fC" macro in ox-man.el [9.6.15 (release_9.6.15 @ /usr/share/emacs/29.2/lisp/org/)] Message-ID: <20250121065200.al37mk2nirifampi@illithid> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="nj6npxne52gpedt6" Content-Disposition: inline In-Reply-To: <87zfjmc32y.fsf@localhost> Received-SPF: pass client-ip=2001:4860:4864:20::2a; envelope-from=g.branden.robinson@gmail.com; helo=mail-oa1-x2a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -10.08 X-Spam-Score: -10.08 X-Migadu-Queue-Id: AF4BA8366D X-Migadu-Scanner: mx10.migadu.com X-TUID: etTCDHQZszYg --nj6npxne52gpedt6 Content-Type: text/plain; protected-headers=v1; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Subject: Re: [BUG] "\fC" macro in ox-man.el [9.6.15 (release_9.6.15 @ /usr/share/emacs/29.2/lisp/org/)] MIME-Version: 1.0 Hi Ihor, At 2025-01-19T14:04:21+0000, Ihor Radchenko wrote: > "onf" writes: >=20 > >> I am wondering if the situations like the above should be caught by > >> groff linter. Currently, they seem not. > > > > They actually are: > > ... > > troff::2: warning: cannot select font 'C' > > One two three four. >=20 > Sorry, I was not clear. > What I meant is >=20 > \fBbold \fIitalic\fP\fP \fP\fP is effectively a no-op. It switches from the previous font, and then to the previous font, with a sequence point (so to speak) in between that changes the identity of the previous font. Thought of differently, font selection escape sequences, if valid, have immediate effect. The parser doesn't keep scanning ahead to see if the input "really meant it". There's not really any such thing as "the groff linter". There are two systems in place: diagnostic messages at (in practice) two levels: warnings and errors, implemented in the formatter. The other? A macro package can, and in groff man(7)'s case, does, implement checks for idiomatic macro usage. (Actually, all of groff's full-service macro packages do this to some extent.) A macro package has little or no insight into when escape sequences are used, beyond the instant context in which its input tokens are encountered. And to the formatter, the sequence `\fP\fP` is _valid_. It's simply not useful. We don't, at present, have a warning category for valid-but-not-useful constructs. One is hoped for in a future groff release. https://savannah.gnu.org/bugs/?62776 However, I don't see good odds for this becoming such a style warning, because the way GNU troff's recursive-descent parser is written currently doesn't offer any support for recognizing this situation. We _could_ compare the actual current and previous font selections for identity and complain then, but I predict with some confidence that doing so would be a non-starter. A lot of macro packages are designed to "reset" various formatting parameters, when a new paragraph starts for instance. Such a mechanism could not distinguish between: =2Eft R blah blah blah blah =2Eif \n[some-register] .do-something =2Esp =2Eft R =2E..and your \fP\fP example. By the time the formatter reads the second the `\fP` it has long forgotten that it just saw an `\fP`. And in the example above, whether the font selection changed or not depends entirely on what the "do-something" macro did, _and_ on whether "some-register" was assigned a true value. That's a lot of state to track. GNU troff does not keep a history of input tokens it has seen except on very limited, ad-hoc bases to derive semantics from interpretation of the _current_ input token(s). As far as I know, no other *roff keeps such a history either. That's why this is hard and unlikely to happen. Regards, Branden --nj6npxne52gpedt6 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEh3PWHWjjDgcrENwa0Z6cfXEmbc4FAmePRAcACgkQ0Z6cfXEm bc5wtg//byga0KUqen7mCdQRW0AmY6GI+iUb5+JcP7OMUVHYyDfMOcREYIlbaOkl Hh1UXLcdUD31dBukRyvqPnrv46J2235dtzLzY0LNtK+S4no1AwRy+Gwag+yRDUv2 wtND+tAqHK8huxBLJgaeb34quyu+JDibvVmMvpED1kUQGwoA9QlJbnyliG1L33Li ZAdV2ifV3iP+13BUam+br5+NEJcsODjFzSd2V9kNAm9PN2nCFWpRgyUSMLx+UuMM 0lYCCaFwzw9En53MXRapXQv2IbLYhwMJEQYDUJyq7MurHPAszMPCsJmXFApXYGxu uHQJZoJMcI6WH7ZbGx+vuusm58HyBo9tS7/BTQIoTNMB+besjCL7D9JJg/BAjlwX L2HwfZ0aXzpdCcSl+XvXzLzC9/n1iVb/GQTT4c334sjPocAALZw3BgFiesqE2M6o onkxKNXnAUH2C9h+POHNPnAVvzLluyIOgxeMKReCzd+tEfm72wXXPlwBKPz3pS9+ Y0IGsSPSdcVNKxbu0yzwFQfwf4b4OSBzIYu5mrdpjV9g1w8adFA1dNuNaK0VGDkS lOasH9qnvNC+CKS7+CnQ4a1zRxnoeUgF3rfC4BJwgjGuGUFH8bB0IDmftDpXTEhI gr1N9uy47378bkCcIybexi2xP/wRtnNkVjLXx8lqVGq2YtAHh5g= =mV1r -----END PGP SIGNATURE----- --nj6npxne52gpedt6--