summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2023-07-21 14:06:16 +0100
committerColin Watson <cjwatson@debian.org>2023-07-21 14:06:16 +0100
commit902612e4d4f8aad572f6b2e12a4ffe812d37e2d2 (patch)
tree9970351401681d9c5aec344a1b803fd6b57af24f
parent96c156c8c313e249039df80d1bc79ee7cef5f63b (diff)
Include .lf corrections in debugging output
The pipeline command names in `PIPELINE_DEBUG` output are deliberately abbreviated in the cases where the command is inserting data into the `*roff` input stream, in an attempt to convey the essential parts without overwhelming the reader. However, it probably does make sense to include `.lf` corrections there, since if you're relying on the debugging output to construct a manual shell pipeline when debugging an issue with a page, you'll want the `.lf` corrections so that line numbers still come out correctly. * src/man.c (add_roff_line_length, display): Include `echo .lf 1` in command names where appropriate.
-rw-r--r--src/man.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/man.c b/src/man.c
index 067b096c..b14cea16 100644
--- a/src/man.c
+++ b/src/man.c
@@ -742,7 +742,7 @@ static pipecmd *add_roff_line_length (pipecmd *cmd, bool *save_cat_p)
pipecmd_argf (cmd, "-rLL=%dn", length);
pipecmd_argf (cmd, "-rLT=%dn", length);
#elif defined(HEIRLOOM_NROFF)
- name = xasprintf ("echo .ll %dn && echo .lt %dn",
+ name = xasprintf ("echo .ll %dn && echo .lt %dn && echo .lf 1",
length, length);
lldata = xasprintf ("%d", length);
llcmd = pipecmd_new_function (name, heirloom_line_length, free,
@@ -2257,7 +2257,8 @@ static int display (const char *dir, const char *man_file,
/* See also make_roff_command () for the simpler groff case. */
if (!recode && no_hyphenation) {
pipecmd *hcmd = pipecmd_new_function (
- "echo .nh && echo .de hy && echo ..",
+ "echo .nh && echo .de hy && echo .. && "
+ "echo .lf 1",
disable_hyphenation, NULL, NULL);
pipecmd_sequence_command (seq, hcmd);
++prefixes;
@@ -2268,9 +2269,10 @@ static int display (const char *dir, const char *man_file,
pipecmd *jcmd = pipecmd_new_function (
#ifdef TROFF_IS_GROFF
/* Technically only for groff >= 1.23.0. */
- "echo .ds AD l",
+ "echo .ds AD l && echo .lf 1",
#else /* !TROFF_IS_GROFF */
- "echo .na && echo .de ad && echo ..",
+ "echo .na && echo .de ad && echo .. && "
+ "echo .lf 1",
#endif /* TROFF_IS_GROFF */
disable_justification, NULL, NULL);
pipecmd_sequence_command (seq, jcmd);
@@ -2291,7 +2293,8 @@ static int display (const char *dir, const char *man_file,
pipecmd *lcmd;
unpack_locale_bits (page_lang, &bits);
- name = xasprintf ("echo .mso %s.tmac",
+ name = xasprintf ("echo .mso %s.tmac && "
+ "echo .lf 1",
bits.language);
lcmd = pipecmd_new_function (
name, locale_macros, free,