From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id ID3WAzmid2fxSgEAqHPOHw:P1 (envelope-from ) for ; Fri, 03 Jan 2025 08:39:21 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id ID3WAzmid2fxSgEAqHPOHw (envelope-from ) for ; Fri, 03 Jan 2025 09:39:21 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=FJQfdBWK; 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=1735893561; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to: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=dauHHtfzyxa0P4O1IBVKk5pYxHSqcEUq3fwauCjM2n4=; b=andEczUywGFkliPci26c4CVGOBchdeP9mYGSnoXBhrQnYHl9W0ZFGurSApr5cFJGf1h6hE lksASH3Asz6r5MDU5ouDnH2Nm+1CSwUf0cXBKyTd059f1nM9ZZdfy2fFLK0IFmAQOptQd5 fS86pI4r7xVvwmI15cGTRPKdshWZIR4AVlKMC3f5R+5Vj1x+4FpiFBIM6X3O7yDKQx+XN6 DjpSrFIcYKJ/qUvz/qic5aJc6hEV3MPYSyLgoN1SrHQ82Tn4oNguuDngvizAHG1ahtL2o+ ueL3DIReRZAYhlbL/MdRJcLRPdgk1zedaxLLnGVcF7jGt6BCho/MaCWPNYwzjg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=FJQfdBWK; 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=1735893561; a=rsa-sha256; cv=none; b=XvVs3HaUwPT/2POJglMrmSRqb/t92oJ5ydcVB1DgEM/77qKSIZg01zu1+fdpZafh/idPiV QR331WhYJRxvxPzLXE1FJ8y0Nc6j88NZI52xbJOUv1Wa7v1/nsfRxfQ1Xbc13NMiRjhyT2 gdr3cP4FEPwvUUH95PqVgW7VWmjjTvfX1q7gCsqxzJ1x+ntYJd7yKn3fHDCiftM2tDWVwB Qy4tlWKG5FsIBv40Y3BdP3gcsCZtz8S7iyd6WPldxtJIIUKwLqEFCTtlPJMLkNqO+eL+R6 DZQ2RxSrvD8Q6NAol/Hd69A/OhlPGzwrQHG+FRl2iiWfYAalYOAzugwWrEjqjQ== 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 7154732886 for ; Fri, 03 Jan 2025 09:39:20 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tTdCU-0006v5-O0; Fri, 03 Jan 2025 03:38:34 -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 1tTdCN-0006uV-Or; Fri, 03 Jan 2025 03:38:29 -0500 Received: from mail-oa1-x35.google.com ([2001:4860:4864:20::35]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tTdCL-0004T3-K3; Fri, 03 Jan 2025 03:38:27 -0500 Received: by mail-oa1-x35.google.com with SMTP id 586e51a60fabf-2689e7a941fso3848535fac.3; Fri, 03 Jan 2025 00:38:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1735893503; x=1736498303; darn=gnu.org; h=in-reply-to:content-disposition:mime-version:message-id:subject:to :from:date:from:to:cc:subject:date:message-id:reply-to; bh=dauHHtfzyxa0P4O1IBVKk5pYxHSqcEUq3fwauCjM2n4=; b=FJQfdBWKxkkiPsQxteGe5Q/+W8v4W/8eHq9kcHNgBLwLg70alAYJsCN/3GK8uVPsH1 ybgZJQ1kRBixxuf243U6zLqUuqUq0Z+zq+2lT+GC/kb02dDCY2svFszRK93pKP76S0SL JB6FRpRSxxCcjeyt6cw9lJqvAzIx4HmOf6T5w5m91nZMhrO5iMnialCRsvkXgzeZ588S FDwpmM1Z3nkh8116kg2QrajXnVZs0uZuVXtvTl/SKgd8nPKBZUiocb5bEt0/Kp3bpYWF MF9GN2lIlE2KISyWW2zB3rzPRN662nZ5eQv5/9s3CyvGkILn2bljTCcDx7aKuej1FlM7 KGxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735893503; x=1736498303; h=in-reply-to:content-disposition:mime-version:message-id:subject:to :from:date:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=dauHHtfzyxa0P4O1IBVKk5pYxHSqcEUq3fwauCjM2n4=; b=U/BRn1nT55f/lx3ej2f7jTmI5tUDY0hjgY+NfztHtjWBPbPXDu4HirX2myrzT19EpQ hMFf7ulGpupwc7Cv2ILlrTvoEugdX+SDFe8tIajadOJYX0nbccXkcPwJsqo4GCUYFoUo 9bb60W0ReQbzWqB+MYs1W4xo/olNxCollZVe/tdmeS2Ksf3NtD9SMJFtW8ezrSk+Y5p1 1pYWZvio+TStDq0GFs0scQCeTHVZc36+l3nGockwf0kgkp2JjLfZgWOwQEhlZ53eWw+j r4KZslHiYX92LSzz8Ktmw8c8HOueaJqzUvgCEoSy9t+/8fxFBBXRcuJYLKm8Q0uP7cK5 pP8Q== X-Forwarded-Encrypted: i=1; AJvYcCXjpUefyj0UHsZ0Xz0fTGsbAulZFOfBXkzSw/MP0jPaXOti694oOX0esObwYDRXvM6J4svjUw==@gnu.org X-Gm-Message-State: AOJu0YxERdXnEWqXWYpZBG5M+KZRNaFSA8dih+x42HnGHNkfbi5FQ8ab N+C+jt1VNQ9ZSXq9Iy6m75xfTFlMkP/Qes0JVTbPzRQEG9gl5uV/92LOBw== X-Gm-Gg: ASbGncu7QM379HHWIXmby3FjNux5SKuVzC6QDCrITvonZXy5JdugpR95HTagWz0157Z LOQ3JJjW+RWHolpYNi3LaQWlrmx5kWssl6liqNg1AmAg9M9zQwJZk7hks4ro6RjH4ruQBLLTMBs wlvT6OTiozNyStyTS8z9XoS4fZCB/kPdRsS2+RRrSnEvuhP7cdV84J1Hq6cJ7n8Y8TrKS17dTAL j/XYieJPIOoVWV0nTO5ssP886zSOFk0TP/fWou/G6BRhMM= X-Google-Smtp-Source: AGHT+IHv66uW400J3KSFmUbdFzpHn6Yto3iO2CcOO9rfsb+dU0R2PwYry7d7N8sCife+duTpf0eMEA== X-Received: by 2002:a05:6871:80cc:b0:29e:2bbd:51cb with SMTP id 586e51a60fabf-2a7fb1619cdmr26158693fac.24.1735893503169; Fri, 03 Jan 2025 00:38:23 -0800 (PST) Received: from illithid ([2600:1700:957d:1d70::49]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-2a7d74c20f3sm9527595fac.14.2025.01.03.00.38.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Jan 2025 00:38:21 -0800 (PST) Date: Fri, 3 Jan 2025 02:38:19 -0600 From: "G. Branden Robinson" To: 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: <20250103083819.bvz53fcaluaxyubt@illithid> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="emlkazhcfmwjvxez" Content-Disposition: inline In-Reply-To: Received-SPF: pass client-ip=2001:4860:4864:20::35; envelope-from=g.branden.robinson@gmail.com; helo=mail-oa1-x35.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-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Scanner: mx12.migadu.com X-Migadu-Spam-Score: -7.86 X-Spam-Score: -7.86 X-Migadu-Queue-Id: 7154732886 X-TUID: oWpHKi7usUMF --emlkazhcfmwjvxez 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 onf, [replying to 2 messages] At 2025-01-02T15:29:59+0100, onf wrote: > I don't know why it took me so long, but I think what you're looking > for is this: > \fC\f(CRLorem\fR Not a bad idea, but while you're there, given Ihor's ambitious portability objectives, you might as well scoop up the population of troffs that named the font `CW`.[1] So you'd emit `\fC\fCW\fCRLorem\fR`. > Note that I've used the syntax \f(, not \f[], because older > implementations of troff (such as Plan9 troff iirc) don't support it. Right. Plan 9 troff (whether original or "from User Space"), Solaris 10 troff (also used by Illumos)[2], and DWB 3.3 troff, which as far as I know is not used by anyone for real typesetting purposes, but is a valuable specimen for exploring Kernighan troff behavior. At 2025-01-02T22:51:47+0100, onf wrote: > You might find it easier to omit the \fP escapes, since they have > little effect here anyway. Situation might be different if you're > targetting non-troff man processors too, though; no idea how > robust their handling of font changes is. The only one I'd think of trusting is mandoc(1), and since that project consciously limits its own scope, I wouldn't necessarily expect support for a lot of fancy font tricks. > But I agree; I would track each style change (bold -> not bold, > italic -> not italic) and emit an appropriate \f sequence that > would match the currently active styles after each such change, > like so: > code & bold & italic \f[CBI] > code & bold \fC\f(CB > code & italic \fC\f(CI > code \fC\f(CR > bold & italic \f(BI > bold \fB > italic \fI > none \fR >=20 > Note that \f[CBI] will break in old troffs due to the "new" \f[] > syntax, so a warning should probably be emitted. And I have no > idea how good support for {bold,italic} Courier is in older troffs > either. Poor, in general. Where Courier bold-italic existed, it was sometimes called "CX". > (That is assuming Org-mode markup allows code to be styled like that.) >=20 > Also note that if a change involving italic happens between two > non-whitespace characters, like so: > groff(/7/) >=20 > ...an italic correction should be emitted to prevent the two glyphs > colliding into each other: > groff(\,\fI7\fR\/) > where: > \, is left italic correction > \/ is right italic correction So another thing to know here is that these italic correction escape sequences are, yet again, GNU troff extensions. A legacy formatter is likely to render them as if the backslash were absent, which is very much not what you want in your output. I reiterate that Ihor's objective of "everything working everywhere" is a tall challenge. My advice is to the org-mode project is to limit its compatibility horizon to groff, Heirloom Doctools troff, neatroff, and mandoc. I say that not for self-serving reasons[4] but because other implementations are moribund or not aimed at general-purpose use.[5] If org-mode did that, it could ignore the `CW` font whose history I just went to the trouble to explore, and the problem with `\,` and `\/` escape sequences as well. With a little more research we might find that org-mode could disregard `\fC` as well. Having now seen org-mode's man(7) output in the flesh from my own input, I see plenty of room for easy wins and improvements. I'll venture those in a separate discussion as I make time, or as someone throws me questions to answer or problems to solve. Regards, Branden [1] `CW` was the name used for a long time by Kernighan troff as distributed in Unix System V and therefore overlapped with, or was identical to DWB 2.0 troff. (I'm a little unclear on the precise history.) Anyway, that name was supported on some, but not all, devices. $ git grep -w CW | grep DESC SysVr2.0_32000/SysVr2.0_32000/dwb/troff.d/devX97/X97.tim10p/DESC:fonts 5 R = I B S CW SysVr2.0_32000/SysVr2.0_32000/dwb/troff.d/devX97/X97.tim12p/DESC:fonts 5 R = I B S CW SysVr2.0_32000/SysVr2.0_32000/dwb/troff.d/devaps/DESC:fonts 8 R I B H CW S = S1 GR SysVr2.0_32000/SysVr2.0_32000/dwb/troff.d/devi10/DESC:fonts 8 R I B H HI HK= CW S SysVr2.0_32000/SysVr2.0_32000/dwb/troff.d/devi10/rasti10/aps-i10/DESC:fonts= 55 R I B H CW S S1 GR R.S R.bld I.S I.bld B.S B.bld H.S H.bld S.R GR.R PA.= S PA.bld PB.S PB.bld PI.S PI.bld CE.S CE.bld CI.S CI.bld HI.S HI.bld HB.S H= B.bld G.S G.bld GI.S GI.bld BI.S BI.bld SM.S CT.S C.S C.bld SC.S TB.S TB.bl= d GS.S GB.S MR.S MR.bld MI.S MI.bld MB.S MB.bld MX.S MX.bld sysvr4/svr4/cmd/lp/filter/postscript/buildtables/devpost/DESC:fonts 10 R I = B BI CW H HB HX S1 S sysvr4/svr4/cmd/lp/filter/postscript/font/devpost/DESC:fonts 10 R I B BI CW= H HB HX S1 S sysvr4/svr4/cmd/lp/filter/postscript/font/devpost/DESC.big:fonts 10 R I B B= I CW H HB HX S1 S sysvr4/svr4/cmd/lp/filter/postscript/font/devpost/DESC.small:# space. bigge= stfont is set to the size of the CW font, and will accomodate all sysvr4/svr4/cmd/lp/filter/postscript/font/devpost/DESC.small:fonts 10 R I B= BI CW H HB HX S1 S sysvr4/svr4/cmd/lp/filter/postscript/font/devpostaps/DESC:fonts 8 R I B H C= W S S1 GR sysvr4/svr4/ucbcmd/troff/troff.d/devaps/DESC:fonts 8 R I B H CW S S1 GR In this System V archive, I get hits on `C` in "DESC" files, but not as font names. (The special character name `*C`, capital Greek gamma, is a common hit.) I get no hits on `CR` (in "DESC" files) at all in this archive. The `CW` font name seems to have originated in Unix System III (1980) but my copy of it doesn't have any "DESC" files. Yet it "does" ship the "Addendum to the NROFF/TROFF User's Manual" (April 1980) document that seems to reflect some of Kernighan's changes (like "compacted macros", a feature later dropped). It's very strange to me to see this accompany a "DESC"-less troff installation. I guess I need to consult an AT&T commercial Unix historian. Another note is that DWB 3.3 retained "CW". Oddly, the dev202 support is stripped out from the Free Software version of DWB 3.3. I don't know why that is. Maybe at the time it was released, Mergenthaler Linotron (or its successor-in-interest) was still unhappy with Bell Labs (or Lucent Technologies, its then successor-in-interest) for reverse engineering their fonts.[3] $ git grep -w CW | grep DESC postscript/devLatin1/DESC:fonts 10 R I B BI CW H HI HB S1 S postscript/devopost/DESC:fonts 10 R I B BI CW H HB HX S1 S postscript/devpost/DESC:fonts 10 R I B BI CW H HI HB S1 S text/devnroff-12/DESC:fonts 5 R I B CW S text/troff/makefile:DFILES=3Ddev202/DESC dev202/R dev202/I dev202/B dev202/= S dev202/CW [2] Solaris 11 uses groff for its troff. [3] https://princeton-staging.elsevierpure.com/en/publications/revisiting-a= -summer-vacation-digital-restoration-and-typesetter-f [4] It is true that Heirloom Doctools troff, neatroff, and mandoc support the most important/disruptive syntactical extensions of GNU troff. But that situation eventuated before I joined groff development--by several years in most or all instances. groff's dialect of *roff is as close to a lingua franca for this application domain ("traditional Unix typesetting") as we have. [5] I admit I'm a little fuzzy on Plan 9 from User Space's objectives for its troff. I can say that the pace of its development is not swift. I don't think Plan 9 advocates pick up the system to use its typesetter. --emlkazhcfmwjvxez Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEh3PWHWjjDgcrENwa0Z6cfXEmbc4FAmd3ofMACgkQ0Z6cfXEm bc6u1RAAhGFwQcteCbG7XfW42dWkPmCWDOpaHZGsmlFDbosiq6C5ym3XI/04euog sk0C87vTAQA7ww6a4YKEwhaHYKxw5CTpGo4RG6V74q7A60c1jfA3SaNfXW0XjRvC EfwDW8QnpdREiBSv10TIN34dZGqk33LdtU7W3FZiWvHX9O6ZW8m9wM5boNLmE7kJ bYTD1sDlKjQiI20YR9HD9nhd4FluoHtYg1UlJR7clKJIL5QssLqJ9bt0JS3Vk2Ae olK7v3N6SC3K9RzSGF8iqsZoAJKtFVsX8JzVEAutz00KgP519lKbHyxB5LTHckfL fc7MnLzLnDHPSXwNnAJO2vwgeRjk9u1YugxR7NflClmgE48+WHRRoad0fgqRPfgk YCQuegboxbyvOVCTeo68ALknugsqW1LUICWAcUwgYiB8anckWzykZYWzgjq5nG6m Zn+0JMThY+1X/Ip0EOyJVASC3D4BVjzEdinW6t/BQJbmdp6KykuKhrTyH14HRtdJ QXKnDGpZsbP037VuAYTaqN260y/3t/qiBR+fk1hXmoZFI8oYp4OdXhHDsvtlPl2g N0gvPDqbP1pj55W+Kaxxq4Yrr+oyjJTtC6t1w6valUY9yzyiE72CVrgbEW5LT0nA +B2+A1zBMG93eRumuwzaxvHAsvA48S3kkz8HcoJ+lyoGILcbxqQ= =/QVh -----END PGP SIGNATURE----- --emlkazhcfmwjvxez--