From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=T_SCC_BODY_TEXT_LINE, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 17482 invoked from network); 2 Jun 2022 14:52:14 -0000 Received: from bsd.lv (HELO mandoc.bsd.lv) (66.111.2.12) by inbox.vuxu.org with ESMTPUTF8; 2 Jun 2022 14:52:14 -0000 Received: from fantadrom.bsd.lv (localhost [127.0.0.1]) by mandoc.bsd.lv (OpenSMTPD) with ESMTP id d07f9411 for ; Thu, 2 Jun 2022 09:52:12 -0500 (EST) Received: from localhost (mandoc.bsd.lv [local]) by mandoc.bsd.lv (OpenSMTPD) with ESMTPA id d6dbdb69 for ; Thu, 2 Jun 2022 09:52:12 -0500 (EST) Date: Thu, 2 Jun 2022 09:52:12 -0500 (EST) X-Mailinglist: mandoc-source Reply-To: source@mandoc.bsd.lv MIME-Version: 1.0 From: schwarze@mandoc.bsd.lv To: source@mandoc.bsd.lv Subject: mandoc: Since \. X-Mailer: activitymail 1.26, http://search.cpan.org/dist/activitymail/ Content-Type: text/plain; charset=utf-8 Message-ID: <33659989c9ad882d@mandoc.bsd.lv> Log Message: ----------- Since \. is not a character escape sequence, re-classify it from the wrong parsing class ESCAPE_SPECIAL to the better-suited parsing class ESCAPE_UNDEF, exactly like it is already done for the similar \\, which isn't a character escape sequence either. No formatting change is intended just yet, but this will matter for upcoming improvements in the parser for roff(7) macro, string, and register names. See the node "5.23.2 Copy Mode" in "info groff" regarding what \\ and \. really mean. Modified Files: -------------- mandoc: roff_escape.c chars.c mandoc_char.7 Revision Data ------------- Index: mandoc_char.7 =================================================================== RCS file: /home/cvs/mandoc/mandoc/mandoc_char.7,v retrieving revision 1.78 retrieving revision 1.79 diff -Lmandoc_char.7 -Lmandoc_char.7 -u -p -r1.78 -r1.79 --- mandoc_char.7 +++ mandoc_char.7 @@ -1,8 +1,9 @@ -.\" $Id$ +.\" $Id$ .\" .\" Copyright (c) 2003 Jason McIntyre .\" Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons -.\" Copyright (c) 2011,2013,2015,2017-2020 Ingo Schwarze +.\" Copyright (c) 2011, 2013, 2015, 2017-2020, 2022 +.\" Ingo Schwarze .\" .\" Permission to use, copy, modify, and distribute this software for any .\" purpose with or without fee is hereby granted, provided that the above @@ -220,13 +221,18 @@ where it introduces a request or a macro, and when appearing alone as a macro argument in .Xr mdoc 7 . In such situations, prepend a zero-width space -.Pq Sq \e&. +.Pq Sq \e&.\& to make it behave like normal text. .Pp -Do not use the +Do not use the character pair .Sq \e. -escape sequence. -It does not prevent special handling of the period. +to escape a period because +.Sq \e. +is not a character escape sequence, does not prevent special handling +of the period under normal circumstances, and is only intended to +be used in the very special situation of defining a user-defined +macro that, when called, defines another user-defined macro, which +no manual page is ever supposed to do. .Ss Backslashes To include a literal backslash .Pq Sq \e @@ -326,7 +332,6 @@ Punctuation: .It \e(en Ta \(en Ta en-dash .It \e(hy Ta \(hy Ta hyphen .It \ee Ta \e Ta back-slash -.It \e. Ta \. Ta period .It \e(r! Ta \(r! Ta upside-down exclamation .It \e(r? Ta \(r? Ta upside-down question .El Index: chars.c =================================================================== RCS file: /home/cvs/mandoc/mandoc/chars.c,v retrieving revision 1.79 retrieving revision 1.80 diff -Lchars.c -Lchars.c -u -p -r1.79 -r1.80 --- chars.c +++ chars.c @@ -1,4 +1,4 @@ -/* $Id$ */ +/* $Id$ */ /* * Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2011, 2014, 2015, 2017, 2018, 2020 @@ -92,7 +92,6 @@ static struct ln lines[] = { { "en", "-", 0x2013 }, { "hy", "-", 0x2010 }, { "e", "\\", 0x005c }, - { ".", ".", 0x002e }, { "r!", "!", 0x00a1 }, { "r?", "?", 0x00bf }, Index: roff_escape.c =================================================================== RCS file: /home/cvs/mandoc/mandoc/roff_escape.c,v retrieving revision 1.7 retrieving revision 1.8 diff -Lroff_escape.c -Lroff_escape.c -u -p -r1.7 -r1.8 --- roff_escape.c +++ roff_escape.c @@ -127,6 +127,7 @@ roff_escape(const char *buf, const int l case '\0': iendarg = --iend; /* FALLTHROUGH */ + case '.': case '\\': default: iarg--; @@ -136,7 +137,6 @@ roff_escape(const char *buf, const int l case ' ': case '\'': case '-': - case '.': case '0': case ':': case '_': @@ -481,7 +481,7 @@ out: err = MANDOCERR_ESC_UNSUPP; break; case ESCAPE_UNDEF: - if (buf[inam] == '\\') + if (buf[inam] == '\\' || buf[inam] == '.') return rval; err = MANDOCERR_ESC_UNDEF; break; -- To unsubscribe send an email to source+unsubscribe@mandoc.bsd.lv