source@mandoc.bsd.lv
 help / color / mirror / Atom feed
* mandoc: Reduce the man(7) default global indentation from 7n, which was
@ 2023-11-13 19:13 schwarze
  0 siblings, 0 replies; only message in thread
From: schwarze @ 2023-11-13 19:13 UTC (permalink / raw)
  To: source

Log Message:
-----------
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@

Modified Files:
--------------
    mandoc:
        man_macro.c
        man_term.c
        mandoc.1
        mdoc_term.c
        term_ascii.c

Revision Data
-------------
Index: man_term.c
===================================================================
RCS file: /home/cvs/mandoc/mandoc/man_term.c,v
retrieving revision 1.243
retrieving revision 1.244
diff -Lman_term.c -Lman_term.c -u -p -r1.243 -r1.244
--- man_term.c
+++ man_term.c
@@ -153,19 +153,15 @@ terminal_man(void *arg, const struct rof
 	struct mtermp		 mt;
 	struct termp		*p;
 	struct roff_node	*n, *nc, *nn;
-	size_t			 save_defindent;
 
 	p = (struct termp *)arg;
-	save_defindent = p->defindent;
-	if (p->synopsisonly == 0 && p->defindent == 0)
-		p->defindent = 7;
 	p->tcol->rmargin = p->maxrmargin = p->defrmargin;
 	term_tab_set(p, NULL);
 	term_tab_set(p, "T");
 	term_tab_set(p, ".5i");
 
 	memset(&mt, 0, sizeof(mt));
-	mt.lmargin[mt.lmargincur] = term_len(p, p->defindent);
+	mt.lmargin[mt.lmargincur] = term_len(p, 7);
 	mt.offset = term_len(p, p->defindent);
 	mt.pardist = 1;
 
@@ -195,7 +191,6 @@ terminal_man(void *arg, const struct rof
 			print_man_nodelist(p, &mt, n, man);
 		term_end(p);
 	}
-	p->defindent = save_defindent;
 }
 
 /*
@@ -504,7 +499,7 @@ pre_PP(DECL_ARGS)
 {
 	switch (n->type) {
 	case ROFFT_BLOCK:
-		mt->lmargin[mt->lmargincur] = term_len(p, p->defindent);
+		mt->lmargin[mt->lmargincur] = term_len(p, 7);
 		print_bvspace(p, n, mt->pardist);
 		break;
 	case ROFFT_HEAD:
@@ -680,7 +675,7 @@ pre_SS(DECL_ARGS)
 
 	switch (n->type) {
 	case ROFFT_BLOCK:
-		mt->lmargin[mt->lmargincur] = term_len(p, p->defindent);
+		mt->lmargin[mt->lmargincur] = term_len(p, 7);
 		mt->offset = term_len(p, p->defindent);
 
 		/*
@@ -721,7 +716,7 @@ pre_SH(DECL_ARGS)
 
 	switch (n->type) {
 	case ROFFT_BLOCK:
-		mt->lmargin[mt->lmargincur] = term_len(p, p->defindent);
+		mt->lmargin[mt->lmargincur] = term_len(p, 7);
 		mt->offset = term_len(p, p->defindent);
 
 		/*
@@ -805,7 +800,7 @@ pre_RS(DECL_ARGS)
 	if (++mt->lmarginsz < MAXMARGINS)
 		mt->lmargincur = mt->lmarginsz;
 
-	mt->lmargin[mt->lmargincur] = term_len(p, p->defindent);
+	mt->lmargin[mt->lmargincur] = term_len(p, 7);
 	return 1;
 }
 
Index: man_macro.c
===================================================================
RCS file: /home/cvs/mandoc/mandoc/man_macro.c,v
retrieving revision 1.149
retrieving revision 1.150
diff -Lman_macro.c -Lman_macro.c -u -p -r1.149 -r1.150
--- man_macro.c
+++ man_macro.c
@@ -317,7 +317,7 @@ blk_exp(MACRO_PROT_ARGS)
 		if (tok == MAN_RS) {
 			if (roff_getreg(man->roff, "an-margin") == 0)
 				roff_setreg(man->roff, "an-margin",
-				    7 * 24, '=');
+				    5 * 24, '=');
 			if ((head->aux = strtod(p, NULL) * 24.0) > 0)
 				roff_setreg(man->roff, "an-margin",
 				    head->aux, '+');
Index: mandoc.1
===================================================================
RCS file: /home/cvs/mandoc/mandoc/mandoc.1,v
retrieving revision 1.266
retrieving revision 1.267
diff -Lmandoc.1 -Lmandoc.1 -u -p -r1.266 -r1.267
--- mandoc.1
+++ mandoc.1
@@ -287,10 +287,7 @@ arguments are accepted:
 .It Cm indent Ns = Ns Ar indent
 The left margin for normal text is set to
 .Ar indent
-blank characters instead of the default of five for
-.Xr mdoc 7
-and seven for
-.Xr man 7 .
+blank characters instead of the default of five.
 Increasing this is not recommended; it may result in degraded formatting,
 for example overfull lines or ugly line breaks.
 When output is to a pager on a terminal that is less than 66 columns
@@ -302,8 +299,7 @@ input files in
 .Xr mdoc 7
 output style.
 This prints the operating system name rather than the page title
-on the right side of the footer line, and it implies
-.Fl O Cm indent Ns =5 .
+on the right side of the footer line.
 One useful application is for checking that
 .Fl T Cm man
 output formats in the same way as the
Index: term_ascii.c
===================================================================
RCS file: /home/cvs/mandoc/mandoc/term_ascii.c,v
retrieving revision 1.68
retrieving revision 1.69
diff -Lterm_ascii.c -Lterm_ascii.c -u -p -r1.68 -r1.69
--- term_ascii.c
+++ term_ascii.c
@@ -72,6 +72,7 @@ ascii_init(enum termenc enc, const struc
 	p->maxtcol = 1;
 
 	p->line = 1;
+	p->defindent = 5;
 	p->defrmargin = p->lastrmargin = 78;
 	p->fontq = mandoc_reallocarray(NULL,
 	     (p->fontsz = 8), sizeof(*p->fontq));
@@ -122,10 +123,8 @@ ascii_init(enum termenc enc, const struc
 	}
 #endif
 
-	if (outopts->mdoc) {
+	if (outopts->mdoc)
 		p->mdocstyle = 1;
-		p->defindent = 5;
-	}
 	if (outopts->indent)
 		p->defindent = outopts->indent;
 	if (outopts->width)
Index: mdoc_term.c
===================================================================
RCS file: /home/cvs/mandoc/mandoc/mdoc_term.c,v
retrieving revision 1.382
retrieving revision 1.383
diff -Lmdoc_term.c -Lmdoc_term.c -u -p -r1.382 -r1.383
--- mdoc_term.c
+++ mdoc_term.c
@@ -250,7 +250,6 @@ terminal_mdoc(void *arg, const struct ro
 {
 	struct roff_node	*n, *nn;
 	struct termp		*p;
-	size_t			 save_defindent;
 
 	p = (struct termp *)arg;
 	p->tcol->rmargin = p->maxrmargin = p->defrmargin;
@@ -275,9 +274,6 @@ terminal_mdoc(void *arg, const struct ro
 			print_mdoc_nodelist(p, NULL, mdoc, n);
 		term_newln(p);
 	} else {
-		save_defindent = p->defindent;
-		if (p->defindent == 0)
-			p->defindent = 5;
 		term_begin(p, print_mdoc_head, print_mdoc_foot, mdoc);
 		while (n != NULL &&
 		    (n->type == ROFFT_COMMENT ||
@@ -289,7 +285,6 @@ terminal_mdoc(void *arg, const struct ro
 			print_mdoc_nodelist(p, NULL, mdoc, n);
 		}
 		term_end(p);
-		p->defindent = save_defindent;
 	}
 }
 
--
 To unsubscribe send an email to source+unsubscribe@mandoc.bsd.lv


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-11-13 19:13 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-13 19:13 mandoc: Reduce the man(7) default global indentation from 7n, which was schwarze

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).