[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[groff] 37/51: tmac/mdoc/doc-common (Dt): Fix code style nits.
From: |
G. Branden Robinson |
Subject: |
[groff] 37/51: tmac/mdoc/doc-common (Dt): Fix code style nits. |
Date: |
Sun, 11 Sep 2022 08:15:54 -0400 (EDT) |
gbranden pushed a commit to branch master
in repository groff.
commit 8ff49ba6ccac289e4cfebc913473d1094526e5cd
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Wed Sep 7 23:09:58 2022 -0500
tmac/mdoc/doc-common (Dt): Fix code style nits.
* Use idiomatic indentation.
* Drop excess close-brace escape sequences.
* Stop putting multiple close-brace escape sequences on one input line;
reserve that idiom for special cases like the C switch/case emulation
documented in our Texinfo manual. One instance here _does_ use that
model, but since it has only 3 cases it doesn't need multiple closing
braces. (ie/el covers two cases and requires 0 brace pairs. Three
cases require ie/el/if and one brace pair. A "default" case would
require a final `el` but that situation is not handled here.)
---
tmac/mdoc/doc-common | 25 ++++++++++++++-----------
1 file changed, 14 insertions(+), 11 deletions(-)
diff --git a/tmac/mdoc/doc-common b/tmac/mdoc/doc-common
index 380791bd6..3845a507e 100644
--- a/tmac/mdoc/doc-common
+++ b/tmac/mdoc/doc-common
@@ -472,13 +472,14 @@
. ds doc-section \$2
. ie \B'\$2' \{\
. if ((\$2 >= 1) & (\$2 <= 9)) \{\
-. ds doc-volume "\*[doc-volume-operating-system]
-. if \A'\$3' \{\
-. if d doc-volume-as-\$3 \
-. as doc-volume "/\*[doc-volume-as-\$3]
+. ds doc-volume "\*[doc-volume-operating-system]
+. if \A'\$3' \{\
+. if d doc-volume-as-\$3 \
+. as doc-volume "/\*[doc-volume-as-\$3]
. \}
-. as doc-volume " \*[doc-volume-ds-\$2]
-. \}\}\}
+. as doc-volume " \*[doc-volume-ds-\$2]
+. \}
+. \}
. el \{\
. ie "\$2"unass" \
. ds doc-volume DRAFT
@@ -486,11 +487,13 @@
. ds doc-volume DRAFT
. el .if "\$2"paper" \
. ds doc-volume UNTITLED
-. \}\}
-. if \A'\$3' \{\
-. if d doc-volume-ds-\$3 \
-. ds doc-volume "\*[doc-volume-ds-\$3]
-. \}\}\}
+. \}
+. \}
+. if \A'\$3' \{\
+. if d doc-volume-ds-\$3 \
+. ds doc-volume "\*[doc-volume-ds-\$3]
+. \}
+. \}
.
. if !"\$3"" \
. if "\*[doc-volume]"LOCAL" \
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [groff] 37/51: tmac/mdoc/doc-common (Dt): Fix code style nits.,
G. Branden Robinson <=