Subject: Re: [PATCH scdoc v1] Emit \(ti and \(ha instead of ~ and ^

From: "Kirill Chibisov" <~sircmpwn/[email-masked]>
Date: Tue, 06 Aug 2024 21:01:31 +0300

--b1b1a64f488a81c5507da9d316ea7517eb9393c6c91a1398eb2482d15e0c
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=UTF-8

> s/ta/to
>
> and I think it's tilde, not tilda.

yeah, indeed, though, I already have v2 fixing the first typo and adding
a test, will send v3 for s/tilda/tilde/.

-- 
Kind Regards,
Kirill Chibisov

--b1b1a64f488a81c5507da9d316ea7517eb9393c6c91a1398eb2482d15e0c
Content-Type: application/pgp-signature; name="signature.asc"

--b1b1a64f488a81c5507da9d316ea7517eb9393c6c91a1398eb2482d15e0c--

---

From: "builds.sr.ht" <~sircmpwn/[email-masked]>
Date: Tue, 06 Aug 2024 16:40:36 +0000

scdoc/patches/.build.yml: SUCCESS in 13s

[Emit \(ti and \(ha instead of ~ and ^][0] from [Kirill Chibisov][1]

[0]: https://lists.sr.ht/~sircmpwn/public-inbox/patches/54315
[1]: mailto:[email-masked]

✓ #1295092 SUCCESS scdoc/patches/.build.yml https://builds.sr.ht/~sircmpwn/job/1295092

---

From: Kirill Chibisov <~sircmpwn/[email-masked]>
Date: Tue, 6 Aug 2024 19:39:36 +0300

Groff since 1.23 maps '^' and '~' by default to U+02C6 and U+02DC
respectively.

The suggestion in groff_man_style(7) is to use \(ti and \(ha when the
latin variants are desired.

Links: https://lists.gnu.org/archive/html/info-gnu/2023-07/msg00001.html
---
 src/main.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/main.c b/src/main.c
index a49cb40..56d4238 100644
--- a/src/main.c
+++ b/src/main.c
@@ -261,6 +261,14 @@ static void parse_text(struct parser *p) {
 			// Suppress sentence spacing
 			fprintf(p->output, "\\&");
 			break;
+		case '~':
+			// Escape tilda ta not make it render with U+02DC
+			fprintf(p->output, "\\(ti");
+			break;
+		case '^':
+			// Escape caret ta not make it render with U+02C6
+			fprintf(p->output, "\\(ha");
+			break;
 		default:
 			last = ch;
 			utf8_fputch(p->output, ch);
-- 
2.44.2

---

From: Rene Kita <~sircmpwn/[email-masked]>
Date: Tue, 6 Aug 2024 19:47:08 +0200

Just because it caught my eye...

On Tue, Aug 06, 2024 at 07:39:36PM +0300, Kirill Chibisov wrote:
[...]

s/ta/to

---

From: "Kirill Chibisov" <~sircmpwn/[email-masked]>
Date: Tue, 06 Aug 2024 19:42:42 +0300

> +			fprintf(p->output, "\\(ha");

I'd add a note that having those characters inside the header won't work
(unicode characters will still be emitted), but I guess a lot of stuff
doesn't work in headers, since parse_text path is not used for the
header text parsing.

-- 
Kind Regards,
Kirill Chibisov