Skip to content

Commit f586952

Browse files
author
Ingo Schwarze
committed
Reduce the man(7) default global indentation from 7n, which was an oddity
in groff-1.01 to groff-1.22.4, to 5n for compatibility with Version 7 AT&T UNIX, 4.3BSD-Reno, groff-1.23.0, and all versions of mdoc(7). OK jmc@ millert@
1 parent c14ce53 commit f586952

File tree

5 files changed

+10
-25
lines changed

5 files changed

+10
-25
lines changed

man_macro.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ blk_exp(MACRO_PROT_ARGS)
317317
if (tok == MAN_RS) {
318318
if (roff_getreg(man->roff, "an-margin") == 0)
319319
roff_setreg(man->roff, "an-margin",
320-
7 * 24, '=');
320+
5 * 24, '=');
321321
if ((head->aux = strtod(p, NULL) * 24.0) > 0)
322322
roff_setreg(man->roff, "an-margin",
323323
head->aux, '+');

man_term.c

+5-10
Original file line numberDiff line numberDiff line change
@@ -153,19 +153,15 @@ terminal_man(void *arg, const struct roff_meta *man)
153153
struct mtermp mt;
154154
struct termp *p;
155155
struct roff_node *n, *nc, *nn;
156-
size_t save_defindent;
157156

158157
p = (struct termp *)arg;
159-
save_defindent = p->defindent;
160-
if (p->synopsisonly == 0 && p->defindent == 0)
161-
p->defindent = 7;
162158
p->tcol->rmargin = p->maxrmargin = p->defrmargin;
163159
term_tab_set(p, NULL);
164160
term_tab_set(p, "T");
165161
term_tab_set(p, ".5i");
166162

167163
memset(&mt, 0, sizeof(mt));
168-
mt.lmargin[mt.lmargincur] = term_len(p, p->defindent);
164+
mt.lmargin[mt.lmargincur] = term_len(p, 7);
169165
mt.offset = term_len(p, p->defindent);
170166
mt.pardist = 1;
171167

@@ -195,7 +191,6 @@ terminal_man(void *arg, const struct roff_meta *man)
195191
print_man_nodelist(p, &mt, n, man);
196192
term_end(p);
197193
}
198-
p->defindent = save_defindent;
199194
}
200195

201196
/*
@@ -504,7 +499,7 @@ pre_PP(DECL_ARGS)
504499
{
505500
switch (n->type) {
506501
case ROFFT_BLOCK:
507-
mt->lmargin[mt->lmargincur] = term_len(p, p->defindent);
502+
mt->lmargin[mt->lmargincur] = term_len(p, 7);
508503
print_bvspace(p, n, mt->pardist);
509504
break;
510505
case ROFFT_HEAD:
@@ -680,7 +675,7 @@ pre_SS(DECL_ARGS)
680675

681676
switch (n->type) {
682677
case ROFFT_BLOCK:
683-
mt->lmargin[mt->lmargincur] = term_len(p, p->defindent);
678+
mt->lmargin[mt->lmargincur] = term_len(p, 7);
684679
mt->offset = term_len(p, p->defindent);
685680

686681
/*
@@ -721,7 +716,7 @@ pre_SH(DECL_ARGS)
721716

722717
switch (n->type) {
723718
case ROFFT_BLOCK:
724-
mt->lmargin[mt->lmargincur] = term_len(p, p->defindent);
719+
mt->lmargin[mt->lmargincur] = term_len(p, 7);
725720
mt->offset = term_len(p, p->defindent);
726721

727722
/*
@@ -805,7 +800,7 @@ pre_RS(DECL_ARGS)
805800
if (++mt->lmarginsz < MAXMARGINS)
806801
mt->lmargincur = mt->lmarginsz;
807802

808-
mt->lmargin[mt->lmargincur] = term_len(p, p->defindent);
803+
mt->lmargin[mt->lmargincur] = term_len(p, 7);
809804
return 1;
810805
}
811806

mandoc.1

+2-6
Original file line numberDiff line numberDiff line change
@@ -287,10 +287,7 @@ arguments are accepted:
287287
.It Cm indent Ns = Ns Ar indent
288288
The left margin for normal text is set to
289289
.Ar indent
290-
blank characters instead of the default of five for
291-
.Xr mdoc 7
292-
and seven for
293-
.Xr man 7 .
290+
blank characters instead of the default of five.
294291
Increasing this is not recommended; it may result in degraded formatting,
295292
for example overfull lines or ugly line breaks.
296293
When output is to a pager on a terminal that is less than 66 columns
@@ -302,8 +299,7 @@ input files in
302299
.Xr mdoc 7
303300
output style.
304301
This prints the operating system name rather than the page title
305-
on the right side of the footer line, and it implies
306-
.Fl O Cm indent Ns =5 .
302+
on the right side of the footer line.
307303
One useful application is for checking that
308304
.Fl T Cm man
309305
output formats in the same way as the

mdoc_term.c

-5
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,6 @@ terminal_mdoc(void *arg, const struct roff_meta *mdoc)
250250
{
251251
struct roff_node *n, *nn;
252252
struct termp *p;
253-
size_t save_defindent;
254253

255254
p = (struct termp *)arg;
256255
p->tcol->rmargin = p->maxrmargin = p->defrmargin;
@@ -275,9 +274,6 @@ terminal_mdoc(void *arg, const struct roff_meta *mdoc)
275274
print_mdoc_nodelist(p, NULL, mdoc, n);
276275
term_newln(p);
277276
} else {
278-
save_defindent = p->defindent;
279-
if (p->defindent == 0)
280-
p->defindent = 5;
281277
term_begin(p, print_mdoc_head, print_mdoc_foot, mdoc);
282278
while (n != NULL &&
283279
(n->type == ROFFT_COMMENT ||
@@ -289,7 +285,6 @@ terminal_mdoc(void *arg, const struct roff_meta *mdoc)
289285
print_mdoc_nodelist(p, NULL, mdoc, n);
290286
}
291287
term_end(p);
292-
p->defindent = save_defindent;
293288
}
294289
}
295290

term_ascii.c

+2-3
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ ascii_init(enum termenc enc, const struct manoutput *outopts)
7272
p->maxtcol = 1;
7373

7474
p->line = 1;
75+
p->defindent = 5;
7576
p->defrmargin = p->lastrmargin = 78;
7677
p->fontq = mandoc_reallocarray(NULL,
7778
(p->fontsz = 8), sizeof(*p->fontq));
@@ -122,10 +123,8 @@ ascii_init(enum termenc enc, const struct manoutput *outopts)
122123
}
123124
#endif
124125

125-
if (outopts->mdoc) {
126+
if (outopts->mdoc)
126127
p->mdocstyle = 1;
127-
p->defindent = 5;
128-
}
129128
if (outopts->indent)
130129
p->defindent = outopts->indent;
131130
if (outopts->width)

0 commit comments

Comments
 (0)