From 5e4a5d535e3314b0fd0d56a0d77a5354c423d56a Mon Sep 17 00:00:00 2001
Message-Id: <5e4a5d535e3314b0fd0d56a0d77a5354c423d56a.1719014283.git.mdw@distorted.org.uk>
From: Mark Wooding <mdw@chiark.greenend.org.uk>
Date: Thu, 26 May 2016 09:26:09 +0100
Subject: [PATCH] doc/: Align backslashes in C-macros by the right-hand margin.
Organization: Straylight/Edgeware

From: Mark Wooding <mdw@distorted.org.uk>

Do this in the source, and in the typeset code.
---
 doc/runtime.tex | 24 ++++++++++++------------
 doc/sod.sty     |  1 +
 2 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/doc/runtime.tex b/doc/runtime.tex
index 75055e5..d4a8292 100644
--- a/doc/runtime.tex
+++ b/doc/runtime.tex
@@ -203,8 +203,8 @@ list items of the form
 \end{prog}
 with no separation between them.  For example:
 \begin{prog}
-  \#define example_KWSET(_) @\\                                 \\ \ind
-    _(int, x, 0) @\\                                            \\
+  \#define example_KWSET(_)                             \macsl  \\ \ind
+    _(int, x, 0)                                        \macsl  \\
     _(const char *, y, NULL)
 \end{prog}
 
@@ -562,16 +562,16 @@ particular keyword argument.
     else longjmp(kw_test_jmp, 2);                             \-\\
   \}                                                            \\+
 
-  \#define KW_TEST(flag, set, call) do \{ @\\                   \\ \ind
-    kw_unkhookfn *oldunk = kw_unkhook; @\\                      \\
-    kw_unkhook = kw_test_unknown; @\\                           \\
-    switch (setjmp(kw_test_jmp)) \{ @\\                         \\ \ind
-      case 0: call; abort(); @\\                                \\
-      case 1: flag = 1; break; @\\                              \\
-      case 2: flag = 0; break; @\\                              \\
-      default: abort(); @\\                                   \-\\
-    \} @\\                                                      \\
-    kw_unkhook = oldunk; @\\                                  \-\\
+  \#define KW_TEST(flag, set, call) do \{               \macsl  \\ \ind
+    kw_unkhookfn *oldunk = kw_unkhook;                  \macsl  \\
+    kw_unkhook = kw_test_unknown;                       \macsl  \\
+    switch (setjmp(kw_test_jmp)) \{                     \macsl  \\ \ind
+      case 0: call; abort();                            \macsl  \\
+      case 1: flag = 1; break;                          \macsl  \\
+      case 2: flag = 0; break;                          \macsl  \\
+      default: abort();                                 \macsl\-\\
+    \}                                                  \macsl  \\
+    kw_unkhook = oldunk;                                \macsl\-\\
   \} while (0)                                                  \\+
 
   @/* Example of use */                                         \\
diff --git a/doc/sod.sty b/doc/sod.sty
index 1f653c9..f1ba880 100644
--- a/doc/sod.sty
+++ b/doc/sod.sty
@@ -152,6 +152,7 @@
 \def\@progcr@ii#1{\csname @progcr@#1\endcsname\ignorespaces}
 \@namedef{@progcr@+}{\prog@@cr[\medskipamount]}
 \@namedef{@progcr@-}{\prog@@cr*[\jot]}
+\def\macsl{\`\textbackslash\hskip\leftmargin}
 
 %% Put a chunk of text in a box.
 \newenvironment{boxy}[1][\q@]{%
-- 
[mdw]

