1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
|
2021-06-25 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/an-old.tmac (TH): When outputting HTML, write the
possibly case-transformed (but not yet abbreviated) page title
as the `title` element instead of the unaltered first argument
to `TH`.
2021-06-25 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/an-old.tmac (an-abbreviate-title): Define with `de`, not
`de1`, since it is not intended for call by traps or users.
2021-06-20 G. Branden Robinson <g.branden.robinson@gmail.com>
* doc/groff.texi (Tab Stops): Fix erroneous claim; tab stops are
not set "every half inch across the page". This is only true in
"line tabs mode", which is not enabled by default. The default
behavior, to keep compatibility with AT&T troff, measures tab
stops relative to the current position on the input line.
2021-06-19 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/mdoc/doc-nroff-u: Set the usekeeps register used by tbl
to the logical complement of the cR (continuous rendering)
register. This prevents blank lines from creeping into tables
in that mode.
2021-06-19 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/an-old.tmac (an-blank-line-trap, an-leading-space-trap):
We say in a comment, "Macros ... that are called by traps of any
kind must be defined with `de1` because they might be called
from a context where compatibility mode is enabled." So do it.
2021-06-19 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/an-old.tmac (an-header): Lightly refactor; tighten.
2021-06-19 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/an-old.tmac (an-write-paragraph-tag): Lightly refactor
for clarity and to reduce code duplicated in both branches of an
`ie`/`el` structure.
2021-06-19 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/an-old.tmac: Rename `an-HF-remap-I-style` register to
`an-remap-I-style-in-headings` for greater clarity.
2021-06-19 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/mdoc/doc-common-u (doc-header, doc-end-macro): Partially
revert bf4b3dde (from 20 May); per Ingo Schwarze, continuous
rendering in mdoc(7) documents has always used only one vee
between headers, footers, and man page body text.
2021-06-19 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/en.tmac: Stop using `do` request; it's unnecessary since
the file is already loaded with compatibility mode off.
2021-06-18 G. Branden Robinson <g.branden.robinson@gmail.com>
[ms]: Fix doc omission; .ID can take an argument.
* doc/groff.texi (ms Document Control Settings) <DI>:
Characterize register setting as a _default_.
(ms Displays and Keeps): Add optional variable "indent" argument
to syntax summary of ".DS I" and ".ID". Note that the given
indentation is used if present, and \n[DI] otherwise.
* doc/ms.ms (Displays and keeps): Add optional variable "indent"
argument to syntax summary of ".ID". Switch fonts more
carefully and apply italic corrections.
* tmac/groff_ms.7.man (Displays and keeps): Sync with doc/ms.ms.
2021-06-17 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/s.tmac: Properly situate devtag flag-related register
names in the package name space. Rename `need_eo_h` to
`s@devtag-needs-end-of-heading'. Rename `need_eo_tl` to
`s@devtag-needs-end-of-title`.
((initialization), par@reset, @SH, par@finish, @NH): Do it.
(par@reset): Test their values more idiomatically.
Fixes last third of <https://savannah.gnu.org/bugs/?42515>.
2021-06-17 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/e.tmac-u (@h): Migrate SCCS revision 2.37 to be idiomatic
for groff (and not throw warnings of type 'mac').
2021-06-17 G. Branden Robinson <g.branden.robinson@gmail.com>
* doc/doc.am: Improve diagnostics during documentation
generation; none should occur normally, but when they do, seeing
troff complain about "<standard input>" is disheartening.
(DOC_GROFF_ONLY): Add -b option so we get backtraces (also kill
off trailing whitespace).
(DOC_GROFF):
(doc/pic.html):
(doc/webpage.html): Add sed expression to inject `lf` request
into the stream to identify the file being processed.
2021-06-17 G. Branden Robinson <g.branden.robinson@gmail.com>
* doc/me-revisions: Supplement history with subsequent BSD work
from versions 2.29 (1988-04-22) to 8.1 (1993-06-05).
2021-06-17 G. Branden Robinson <g.branden.robinson@gmail.com>
* doc/me-revisions: Add 'me' macro package revision log, scraped
from <https://svnweb.freebsd.org/csrg/share/me/revisions>.
* doc/doc.am (DOCFILES): Ship it.
2021-06-17 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/e.tmac-u: Rename registers for clarity. Unlike other
macro packages supplied by groff, "me" mostly remains within the
AT&T 2-character name space, accessing extended names
selectively through `do` and `de1` requests. The package
therefore has no characteristic name prefix.
need_eo_h -> devtag-needs-end-of-heading
need_eo_tl -> devtag-needs-end-of-title
need_tl -> devtag-needs-title
(@html_check_need_title, sh, EQ): The foregoing registers are
effectively Booleans, so perform Boolean-style tests on their
interpolations.
Fixes a second third of <https://savannah.gnu.org/bugs/?42515>.
2021-06-16 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/e.tmac-u: Work in compatibility mode. It seems this was
the intention (reasonable, since "me" originates in pre-groff
BSD Unix), but there were several problems.
(@R): Prefix register existence test with `do`.
(@html_check_need_title): Define with `do` since the macro name
is long, and also with `de1` so that we can freely use groff
extensions within. Drop many `do` requests from macro
definition.
(@check_need_title): Define with `do`, as above. Add comment
explaining why `de1` is not needed for this macro definition.
(@S): Prefix macro/string existence test with `do`. Remove
spurious space so that the argument string name is truly defined
as empty.
(nm, n1, n2): Prefix handling of long register names `_#p` and
`_#f` with `do` request.
(top level): Prefix `mso` request with `do`.
((x-html): Define with `do` and `de1` instead of `de`. Drop
now-unnecessary `do` requests from macro body.
()x-html): Define with `do` and `de1` instead of `de` for
symmetry.
(xp-html): Define with `do` and `de1` instead of `de`. Drop
now-unnecessary `do` requests from macro body.
Fixes <https://savannah.gnu.org/bugs/?60785>.
2021-06-16 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/devtag.tmac: Work in compatibility mode; define macros
with the `de1` instead of the `de` request.
2021-06-16 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/refer-me.tmac:
* tmac/refer.tmac: Add include guards.
2021-06-16 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/refer-me.tmac: Handle being loaded in compatibility mode.
2021-06-16 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/an-old.tmac: Properly situate devtag flag-related
register names in the package name space. Rename `need_eo_h` to
`an-devtag-needs-end-of-heading'. Rename `need_col2` to
`an-devtag-needs-second-column`.
(an-input-trap, SH, SS, HP, (initialization)): Do it.
(an-input-trap): Test their values more idiomatically.
Fixes one third of <https://savannah.gnu.org/bugs/?42515>.
2021-06-16 G. Branden Robinson <g.branden.robinson@gmail.com>
* src/roff/troff/input.cpp (do_if_request): Improve diagnostic
message; say "conditional operator", not just "conditional".
2021-06-16 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/an-old.tmac (an-end, an-header): In continuous rendering
mode, use same spacing amount after header and before footer as
mdoc in its own continuous rendering mode. Thanks to Ingo
Schwarze for the suggestion.
Fixes <https://savannah.gnu.org/bugs/?60653>.
2021-06-16 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/an-old.tmac (P): Define this as the "canonical"
paragraphing macro.
(LP, PP): Make these aliases of P.
2021-06-16 G. Branden Robinson <g.branden.robinson@gmail.com>
* src/roff/troff/input.cpp (spring_trap): Tighten lexical
discipline; describe macro as "trap-called" rather than
"trap-invoked".
2021-06-15 G. Branden Robinson <g.branden.robinson@gmail.com>
[man]: Don't spuriously break a page after a paragraph tag when
the tag is short enough to fit within the paragraph's
indentation.
* tmac/an-old.tmac (an-write-paragraph-tag): Reserve ("need") 2
vees plus 1 basic unit of vertical space regardless of the width
of the tag. In the short tag case, we reverse space by one vee
after outputting the diversion in which the tag is stored, but
it will always contain a break, and by the time we reverse, we
might have already hit a page location trap
{an-break-body-text}, and by then it's too late to back up.
* tmac/tests/an-old_no-break-after-short-paragraph-tags.sh: Test
it.
* tmac/tmac.am (tmac_TESTS): Run test.
Fixes <https://savannah.gnu.org/bugs/index.php?60624>.
2021-06-15 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/an-old.tmac: Rename environments to be more descriptive.
an-env -> an-env-header-or-footer
an-2 -> an-env-paragraph-tag
(an-header, an-footer, an-write-paragraph-tag): Do it.
2021-06-14 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/s.tmac: Add diagnostic error if .EQ used within .TS/.TE.
Introduce register `tbl@within-table` to track whether we're
inside a table.
(@EQ): Check register and issue error if it is true.
(@TS): Set register.
(@TE): Clear register.
Prompted by Savannah #55754.
2021-06-14 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/s.tmac: Permit document to start with .PS.
(cov*ab-init): Alias PS to @PS.
(PS): Call LP, then re-execute (aliased) self as TS does.
(TS): Update comment to parallel the one in PS.
2021-06-11 Tadziu Hoffmann <hoffmann@usm.uni-muenchen.de>
Indent an IP paragraph based on the type size of the paragraph
text, not a preceding heading. We have to delay evaluating IP's
argument until the font size has been reset, which I've
attempted to do by simply passing the argument unevaluated down
the call hierarchy, instead of saving it in a number register
right away, as appears customary in this ms implementation.
However, par@reset is called from a great number of places, and
these usually set the indent registers beforehand. I've left
this as it is, so now two ways of setting the indents exist: via
register and optionally via argument.
* tmac/s.tmac (par@reset): Move font-size setting stuff before
indent-setting stuff; set registers from optional arguments with
default "n" scaling indicator before setting indents.
(par*start, par@finish): Don't set registers, but instead pass
arguments to par@reset.
(@IP): Pass argument unevaluated to par*start.
Fixes <https://savannah.gnu.org/bugs/index.php?59604>.
2021-06-11 Tadziu Hoffmann <hoffmann@usm.uni-muenchen.de>
* tmac/s.tmac (@QP, @XP): Be more scrupulous about using "u"
scaling indicator.
2021-06-11 G. Branden Robinson <g.branden.robinson@gmail.com>
Add regression test for Savannah #59604.
* tmac/tests/s_IP-indents-using-paragraph-type-size.sh: Add it.
* tmac/tmac.am (tmac_TEST): Run it.
2021-06-08 G. Branden Robinson <g.branden.robinson@gmail.com>
Refactor grog even more aggressively. Make the tedious search
for subs.pl unnecessary by inlining it into grog.pl directly.
This makes the script stand alone and much more convenient to
work with, and doesn't contribute to bloat, in my
opinion--subs.pl was 10 times the size of grog.pl, and most of
the code in the latter was dedicated to trying to locate
subs.pl.
* Makefile.am: Delete references to $(grog_dir).
* configure.ac: Delete call of `GROFF_GROGDIR_DEFAULT` macro.
* m4/groff.m4: Delete definition of same.
* src/roff/grog/grog.am (GROG, dist_grog_DATA, grogdir): Drop
variables.
(grog): Remove target's dependency on `$(GROG)`. Remove sed
expression replacing `@grog_dir@` with `$(grog_dir)` in grog.pl.
* src/roff/grog/grog.pl: Inline most of subs.pl (except for
author/license comment banenr). Delete sub-hunting logic.
* src/roff/grog/subs.pl: Delete.
2021-06-08 G. Branden Robinson <g.branden.robinson@gmail.com>
* doc/pic.ms (Basic PIC Concepts, Decorating Objects/Filled
Objects, PIC Reference/Semi-Formal Grammar): Fix error: the
keyword "solid" sets a line style, not a fill for a closed
figure. Thanks to Dave Kemper and Wim Stockman for reporting
and researching this issue.
Fixes <https://savannah.gnu.org/bugs/index.php?60470>.
2021-06-06 G. Branden Robinson <g.branden.robinson@gmail.com>
* NEWS:
* doc/webpage.ms:
* man/groff.7.man (Registers/Read-only registers) <.U>:
* man/groff_diff.7.man (Language/New number registers) <.U>: Fix
error; the sense of this Boolean variable was backwardly
documented {perhaps due to an implementation detail from 2004
that was reversed in commit 7a0e2f15, 26 February 2008}.
2021-06-05 G. Branden Robinson <g.branden.robinson@gmail.com>
* src/roff/groff/groff.cpp: Revise usage message.
(synopsis): Set primary synopsis on a single output line, for
convenience of parsing and also because we have no control over
the width of the program name in character cells; it comes from
argv[0] and is under user control. There is thus no point in
trying to get pretty formatting. Also include separate synopsis
lines for short and long help options. Use opposite case from
option flags for option arguments.
(help): Collate option flags in English lexicographic order.
Include space after flag letters for options that take
arguments. Consistently use capitals for option arguments
because they are space-separated here. Illustrate longer forms
of -d and -r options. Update language (some, like "tmac.name",
was very old). Add reference to groff(1) man page at end.
(usage): Drop appendnment of notice regarding -h option; this is
now covered in `synopsis()` unconditionally.
2021-06-05 G. Branden Robinson <g.branden.robinson@gmail.com>
Eliminate "groff_opts_no_arg.txt" and "groff_opts_with_arg.txt"
files from distribution. They are not needed by any live code
in the tree; possibly only groffer ever used them.
* src/roff/groff/groff.am (GROFF_OPTS_OUTPUT, groffoptsdir,
groffopts_DATA): Delete variables.
(MOSTLYCLEANFILES): Stop adding to target.
(groff_opts.tmp, groff_opts_no_arg.txt,
groff_opts_with_arg.txt): Delete targets.
2021-06-05 G. Branden Robinson <g.branden.robinson@gmail.com>
* src/roff/grog/subs.pl (version): Report version information in
a format consistent with our other programs.
2021-06-05 G. Branden Robinson <g.branden.robinson@gmail.com>
* src/roff/grog/grog.pl: Refactor initialization so that the
program can be run from a build tree--and tested. Drop much
cruft from before Bertrand Garrigues's 2018 work to adopt
`git-version-gen`.
2021-06-04 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/tests/an-old_title-abbreviation-works.sh: Log more
accurate messages in test failures.
2021-06-03 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/an-old.tmac (an-abbreviate-title): Add new internal macro
to reduce the length of a man page title (i.e., the "ls" in
"ls(1)", if it is too wide to fit in the page header (and would
overwrite the center header material, usually the title of the
manual section). Since the beginning and end of the title might
be important for disambiguation, truncation at either end would
be unwise; replace the middle of the title with an ellipsis.
Define new an-pageref and an-title-abbv strings for use by other
macros and user-defined PT and BT traps.
(PT, an-footer): Use new an-pageref string for economy.
(an-header): Call an-abbreviate-title after setting the title
length.
* tmac/tests/an-old_title-abbreviation-works.sh: Test it.
* tmac/tmac.am (tmac_TESTS): Run test.
Fixes <https://savannah.gnu.org/bugs/index.php?43532>.
2021-06-03 G. Branden Robinson <g.branden.robinson@gmail.com>
* man/groff.7.man (Copy mode): Add new section.
2021-06-03 G. Branden Robinson <g.branden.robinson@gmail.com>
* src/roff/troff/input.cpp (else_request, while_request,
pipe_source, open_request, opena_request, pipe_output,
system_request): Update diagnostic messages to not presume the
identities of the control or escape characters.
2021-06-01 G. Branden Robinson <g.branden.robinson@gmail.com>
* doc/groff.texi (Conventions Used in This Manual): Add node.
2021-05-31 G. Branden Robinson <g.branden.robinson@gmail.com>
* src/roff/groff/groff.1.man: Expand to aid beginners.
(initialization): Define `TeX` string.
(Usage): Rewrite.
(Usage/Getting started): Add "Hello, world!" example using
multiple output devices (formats).
(Usage/Using groff as a REPL): Add example of likely interest to
programmers. Or so I hope. It illustrates the Turing
fundamentals; we read, store, test, and branch.
2021-05-29 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/papersize.tmac: Improve diagnostic message; when
complaining about unrecognized input, report back the input we
actually received, not what it looks like after we transform it.
Also add name of macro package to diagnostic so the user knows
who is speaking, continuing the long process of fixing Savannah
#52463.
2021-05-29 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/groff_ms.7.man (Usage/Paragraphs) <QP>: Fix error: .QP
paragraphs are indented by \n[QI], not \n[PI].
2021-05-27 G. Branden Robinson <g.branden.robinson@gmail.com>
* src/libs/libdriver/input.cpp (do_file): Make fatal diagnostic
from output driver when the device description file "DESC" can't
be found more informative by including the name of the device
for which the input was prepared. Also makes malformed input of
intermediate format more obvious.
2021-05-27 G. Branden Robinson <g.branden.robinson@gmail.com>
* src/preproc/tbl/tbl.1.man (Miscellaneous): Add paragraph
cautioning users against making tbl(1) tables conditional
document content.
2021-05-25 G. Branden Robinson <g.branden.robinson@gmail.com>
[man]: Add style warnings for documents with input lines that
are blank or have leading spaces, since they can cause
surprising rendering; enabled if the CHECKSTYLE register is
greater than 2.
* tmac/an-old.tmac (an-blank-line-trap, an-leading-space-trap):
Issue style warning if enabled (and only if fill mode enabled in
leading space trap); in any event, recreate the default *roff
behavior.
(TH): Install traps.
* doc/andoc.tmac (reload-doc): Remove man(7) traps before
loading doc.tmac.
2021-05-25 G. Branden Robinson <g.branden.robinson@gmail.com>
* doc/andoc.tmac (reload-doc): Fix spurious blank line.
2021-05-25 G. Branden Robinson <g.branden.robinson@gmail.com>
* doc/groff.texi (Operators in Conditionals):
* man/groff.7.man (Control structures/Conditional expressions):
Fix omission; the conditional operators "F", "m", and "S" also
accept optional spaces and/or tabs between themselves and their
arguments.
2021-05-25 G. Branden Robinson <g.branden.robinson@gmail.com>
* man/groff.7.man (Requests/Request short reference) <.ta>:
Describe the request as tersely as possible without omitting its
essential syntax and semantics. (The AT&T troff "+" relative
prefix for normally absolute positions ".ta 1i +1i +1i" and
alignment-specifying suffixes "L", "R", and "C" had both been
omitted.)
2021-05-25 G. Branden Robinson <g.branden.robinson@gmail.com>
* man/groff.7.man (Registers/Writable registers): Fix error:
\n[nl] interpolates the current vertical position, not the
vertical position of the "last printed text baseline"; the
latter is \n[.h].
2021-05-25 G. Branden Robinson <g.branden.robinson@gmail.com>
* doc/groff.texi (Manipulating Filling and Adjustment): Update
inter-sentence space example to be more illustrative. Thanks to
Dave Kemper and Doug McIlroy for the discussion.
Fixes <https://savannah.gnu.org/bugs/index.php?60404>.
2021-05-23 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/mdoc/doc-common-u: Add comment warning source divers that
\n[doc-header-space] is re-used for a purpose for which it is
not documented.
* tmac/mdoc/doc-nroff-u: Initialize doc-{header,footer}-space
registers, which define the vertical spacing between body text
and the relevant titles (not between the titles and the page
margins) to 1v instead of 0.5i. This is what mdoc(7) has always
done in practice, per Ingo Schwarze.
2021-05-23 G. Branden Robinson <g.branden.robinson@gmail.com>
* src/devices/grohtml/post-html.cpp (assert_state::add): Avoid
potential deallocation of statically-allocated strings. Use
strsave() to duplicate them so that they can be safely handed to
a_delete(). Also update diagnostic message to report name of
complaining program (continuing the long process of fixing
Savannah #52463).
Fixes <https://savannah.gnu.org/bugs/index.php?55693>. Thanks
to Petru-Florin Mihancea for the report.
2021-05-23 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/troffrc-end: Fix transposition error (in commit a248aa33
on 15 January) that broke most table image generation in HTML
output.
Fixes <https://savannah.gnu.org/bugs/index.php?60656>.
2021-05-23 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/an-ext.tmac (UE, ME): Replace calls to HTML-NS macro for
emissions of HTML 'A' tags with direct usage of \X device
control escapes. Replace .nop requests with text lines since
this file is supposed to be maximally portable to other *roffs.
2021-05-22 G. Branden Robinson <g.branden.robinson@gmail.com>
* src/preproc/html/pre-html.cpp (main): Call `scanArguments()`
earlier, before trying to load a font description, so that -v,
--version, and --help work.
2021-05-22 G. Branden Robinson <g.branden.robinson@gmail.com>
[grohtml]: Add -C and -G options to postprocessor, to suppress
output of CreationDate and Creator HTML comments, respectively.
These can inject unwanted noise into build artifacts.
* src/devices/grohtml/post-html.cpp: Add static globals
`do_write_creator_comment` and `do_write_date_comment`.
(html_printer::{do_file_components,~html_printer}): Write
comments per corresponding global variables.
(main): Add to `getopt_long()` call parameter and set as needed.
(usage): Document them.
* src/preproc/html/pre-html.cpp (scanArguments): Add to
`getopt_long()` parameter, but ignore.
* src/devices/grohtml/grohtml.1.man (Synopsis, Options):
Document them.
* src/roff/groff/tests/output_driver_C_and_G_options_work.sh:
Test them.
* tmac/tmac.am (groff_TESTS): Run test.
Fixes 1/3rd of <https://savannah.gnu.org/bugs/index.php?60655>.
2021-05-22 G. Branden Robinson <g.branden.robinson@gmail.com>
* src/preproc/html/pre-html.cpp (usage):
* src/devices/grohtml/post-html.cpp (usage): Fix inaccuracies in
supported option summary.
2021-05-22 G. Branden Robinson <g.branden.robinson@gmail.com>
* src/preproc/html/pre-html.cpp (scanArguments):
* src/devices/grohtml/post-html.cpp (main): Use libgroff's
warning() instead of printf() to emit diagnostic about
unrecognized paramter to `-x` option. This sends the diagnostic
to the standard error stream and continues the long process of
fixing Savannah #52463.
2021-05-22 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/groff_www.7.man: Stop using the "www" macro package. The
macros it exposes are not part of the quasi-standardized man(7)
language, and thus should not be used in man(7) documents. See
groff_man_style(7) for portability advice. Besides, the
extension macros in the permissively-licensed an-ext.tmac are
sufficient to support URL and email hyperlinks, and our SH and
SS macro implementations already support anchor placement
without requiring explicit effort from page authors.
(initialization): Stop sourcing www.tmac. Stop calling .LK and
.HR; the page-internal navigation links were being placed after
the apropos line instead of at the beginning of the page,
contradicting the comment that was there (possibly a bug).
(Requests) <URL, LK>: Stop calling .TAG.
<LK>: Drop paragraph advising reader to format page for groff's
HTML output device to observe the navigation links at that point
in the test.
2021-05-22 G. Branden Robinson <g.branden.robinson@gmail.com>
* doc/groff.texi (Comments): Fix error in description of parser
operation; '.\"' is an effective whole-line comment not because
it is a call of an undefined macro named '\"' (no 'mac' warning
is emitted when that warning type is enabled), but because the
comment escape is recognized normally and what remains is
handled as the empty request. Clarify that the optional
argument to the .ig request is the name of a macro (which will
be called normally _and_ end the ignored region; this is
analogous to ".de foo bar").
2021-05-22 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/an-ext.tmac (UR, UE, MT, ME): Rename environment and
diversion for clarity; they apply to the link text, not the URL
{or email address}. The latter might not visibly appear,
depending on the output driver.
2021-05-20 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/an-old.tmac (TH): Remove extraneous right-brace escape.
Fixes <https://savannah.gnu.org/bugs/?60651>. Thanks to Bjarni
Ingi Gislason for catching it.
2021-05-20 G. Branden Robinson <g.branden.robinson@gmail.com>
* doc/groff.texi (Copy Mode): Fix omissions from list of escape
sequences interpreted even in copy mode. Add \g, \V, "\.",
'\"', \#, \a, \e and \E (with caveat), and \t. Parallels
groff(7) now. Add cross reference to "Character Translations"
node.
2021-05-20 G. Branden Robinson <g.branden.robinson@gmail.com>
* man/groff.7.man (Escape Sequences): Fix omission; the escape
character in an unrecognized escape sequence is not merely
ignored; the sequence produces a warning diagnostic, albeit of a
type that is disabled by default.
(Escape Sequences/Escape short reference): Fix omissions; \# and
\V are interpreted even in copy mode.
2021-05-20 G. Branden Robinson <g.branden.robinson@gmail.com>
* man/groff.7.man (Escape Sequences/Escape short reference): Fix
errors in descriptions of \d, \r, \u escapes; they move in vees,
not ems.
Fixes <https://savannah.gnu.org/bugs/?60602>.
2021-05-20 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/an-old.tmac (an-header): Fix missing brace escape.
2021-05-20 G. Branden Robinson <g.branden.robinson@gmail.com>
[man]: Slightly refactor footer spacing management when
continuously rendering.
* tmac/an-old.tmac (an-end): Increase the page length _after_
flushing a pending output line. Do so only by the amount of
spacing we actually perform next. Make the scaling indicator on
the .sp request explicit. The amount seemed magical because it
was accounting for the one line to be consumed by output of the
footer title line. Instead, move that further increase of the
page length from here...
(an-footer): ...to here (~250 lines away), before calling BT.
2021-05-20 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/mdoc/doc-common-u (doc-end-macro): When continuously
rendering and after flushing the last line of the body text of a
page, vertically space by 3 vees instead of 1, for consistency
with our man(7) implementation. Also increase page length by
same amount _after_ flushing a pending output line, for symmetry
with other spacing requests (and to prevent nasty surprises
analogous to those in Savannah #60611).
(doc-header): Put 3 vees of space after the header in continuous
rendering mode, not 1 (and increase page length accordingly).
2021-05-20 G. Branden Robinson <g.branden.robinson@gmail.com>
[man]: Add warnings for macros deprecated in groff_man(7),
emitted if the CHECKSTYLE register is greater than 1.
* tmac/an-old.tmac (an-deprecation-warn): New macro emits
diagnostic.
(DT, PD): Call the foregoing, re-using arguments.
2021-05-20 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/an-old.tmac: Refactor to move bodies of DT and PD into
private macros.
(an-reset-tab-stops, an-reset-paragraph-spacing): New names for
the former DT and PT.
(TH): Call these new macro names.
(DT, PD): Wrap the corresponding private macros.
2021-05-20 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/an-old.tmac (an-bp): In continuous rendering mode, draw
a horizontal line between a page footer of one man page document
and the header of the next, but only if multiple documents are
being rendered.
(initialization): Use variable to ensure we don't draw this line
after finishing the only document we render.
Fixes other half of <https://savannah.gnu.org/bugs/?60611>.
2021-05-20 G. Branden Robinson <g.branden.robinson@gmail.com>
[man]: Fix stochastic vertical space loss problems in continuous
rendering mode by being more scrupulous about extending the page
length. As noted in Savannah #60611, sometimes the vertical
space between a header line and the first section heading
{"Name"} would be reduced or removed altogether, in a way that
was highly sensitive to circumstances. As far as I can tell,
the problem is that this vertical space disappeared only when we
were in double-secret probation no-space mode; this is the
special non-spacing mode {not apparent with inspection of
\n[.ns]} that happens when the stealth internal page location
trap is sprung. This trap does not appear in .ptr output but
can be disabled with ".vpt 0", which is an alternative fix for
this problem {because continuous rendering mode does not use
vertical position traps at all}. Another fix might have been to
simply call the moral equivalent of ".pl MAXINT" as soon as
continuous rendering mode was decided upon.
* tmac/an-old.tmac (an-header): In continuous rendering mode,
extend the page length by one line before calling PT to output
the page header, and afterwards, extend the page length by 3
vees and space by that amount (instead of half an inch).
Fixes half of <https://savannah.gnu.org/bugs/?60611>.
2021-05-20 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/an-old.tmac (an-header, an-footer): Drop no-op .tl
requests.
2021-05-20 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/an-old.tmac (an-footer): Improve symmetry with an-header.
If rendering to HTML, don't bother setting the
an-outer-footer-text, an-extra1, and an-extra2 strings to empty
values; instead don't call BT, just as we don't call PT in
an-header.
2021-05-19 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/an-old.tmac (an-end): Drop needless .nr % assignment.
Call our (wrapped) bp instead of the .pl request directly.
(an-bp): Drop needless .br and (aliased) real .bp request.
2021-05-19 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/an-old.tmac (an-footer): Refactor complex conditional.
2021-05-19 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/tests/an-old_X-register-works.sh: Add test for footer
creeping into page content.
2021-05-19 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/an-old.tmac (initialization): Ignore P and X rendering
parameter registers if specified with continuous rendering
enabled (the default in the nroff mode used for terminals), and
emit diagnostic.
2021-05-19 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/tests/an-old_X-register-works.sh: Rewrite. Increase test
coverage and stop assuming that -rcR=1 and -rX=anything is a
supported combination. (Continuous rendering is supposed to
suppress the printing of page numbers anyway.)
2021-05-19 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/an-old.tmac (initialization): Refactor handling of P and
X rendering parameter register validation in preparation for
disabling them in continuous rendering mode, where they don't
make any sense.
2021-05-19 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/tests/an-old_TH-repairs-ad-damage.sh: Tweak test
internals to make troubleshooting easier.
2021-05-18 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/an-old.tmac (TH): Relocate some initialization logic to
be adjacent to (most of) the rest of it.
2021-05-18 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/an-old.tmac (TH): Remove useless .if. Its condition is
always true now in the wake of the fix for Savannah #60609.
2021-05-18 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/an-old.tmac: Rename many package macros, strings, and
registers (and the lone named environment) to be more expressive
of their function. "an-footer" is now the proper complement of
"an-header" (setting up an environment and calling a
user-redefinable trap macro).
an-first -> an-is-first-page-of-document
an-html -> an-is-output-html
an-footer -> an-break-body-text
an-p-footer -> an-footer
an-set-margin -> an-reset-margin-and-inset-level
an-level -> an-inset-level
an-tag-sep -> an-tag-separation
an-no-space-flag -> an-need-no-space-mode
an-break-flag -> an-need-break
an-div? -> an-is-in-diversion
an-page-string -> an-outer-footer-text
an-trap -> an-input-trap
an-do-tag -> an-write-paragraph-tag
an-1 -> an-env
* tmac/andoc.tmac (reload-doc): ...as above for the exposed
parts of the interface.
an-footer -> an-break-body-text
an-p-footer -> an-footer
2021-05-18 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/an-old.tmac: Rearrange alternating font macros to be in
alphabetical order (and the order documented in groff_man(7).
2021-05-18 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/an-old.tmac: Refactor alternating font macros. These
macros are hard enough to understand without adding gratuitous
structural differences to the reader's burden. Make their
implementations rigidly parallel. Update comments.
(RI, IR, IB, BI, RB, BR): Always define the `an-result` string
as empty except for a non-printing input break for the sake of
compatibility mode.
(RI, IR, IB, BI): Defer interpolation of the first argument to
the while loop if there are at least two (like the existing RB,
BR). This way the the font escape style names in the appendment
to `an-result` match the order of the letters in the macro name
{useful to make sense of diffs}.
(RI, IR, IB, BI, RB, BR): Always remove the `an-result` string
after interpolating it.
(RB, BR): Only do work if there are any arguments.
2021-05-18 G. Branden Robinson <g.branden.robinson@gmail.com>
[man]: Apply italic corrections more consistently.
* tmac/an-old.tmac (BI, IB, IR, RI): Apply italic corrections
more consistently. Add lengthy comment rationalizing approach.
(RI, BI): An italic correction is now applied after the last
argument if it is of even parity (i.e., the 2nd, 4th, 6th, ...).
* tmac/groff_man.7.man.in (Description/Font style macros): Note
that italic corrections are applied.
Fixes <https://savannah.gnu.org/bugs/index.php?53541>.
Thanks to Bjarni Ingi Gislason for the report and a suggested
patch.
2021-05-17 G. Branden Robinson <g.branden.robinson@gmail.com>
[man]: Ignore FT register when appropriate.
* tmac/an-old.tmac (initialization): Validate user-specified
value of \n[FT]. Continuous rendering ignores FT (page location
traps are not used for footers in that mode). Measuring a
footer distance from the page top isn't done. A footer distance
of over half the page length is unlikely. A footer distance of
less than one line height is too. Issue diagnostics in all of
these cases.
* tmac/tests/tmac/tests/\
an-old_FT-bad-value-should-not-trash-titles.sh: Test it.
* tmac/tmac.am (tmac_TESTS): Run test.
Fixes <https://savannah.gnu.org/bugs/index.php?60612>.
2021-05-17 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/an-old.tmac (TH): Plant the an-footer trap (where we
schedule a break in the page text prior to spacing down to the
footer) at twice the value of \n[FT], not a hard-coded -1i.
This way, the user can't make the an-p-footer trap (planted at
\n[FT]) spring before the an-footer trap that should precede it.
* tmac/groff_man.7.man.in (Options) <-rFT>: Document this.
2021-05-16 G. Branden Robinson <g.branden.robinson@gmail.com>
* m4/groff.m4 (GROFF_GHOSTSCRIPT_VERSION_CHECK): Add new
autoconf macro to check Ghostscript version. Versions 9.00 <= x
< 9.54 suffer from a rendering glitch that affects the AT&T
troff (and groff) special character \(lh; see
<https://bugs.ghostscript.com/show_bug.cgi?id=703187>. Store
the result of the check.
(GROFF_GHOSTSCRIPT_VERSION_NOTICE): Add new macro to report the
problem detected by GROFF_GHOSTSCRIPT_VERSION_CHECK to the user.
* configure.ac: Call the macros in appropriate places.
Fixes <https://savannah.gnu.org/bugs/index.php?59531>.
2021-05-16 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/andoc.tmac (reload-man): Remove removal of RI macro, made
unnecessary by commit 551f138 (15 May).
2021-05-16 G. Branden Robinson <g.branden.robinson@gmail.com>
* m4/groff.m4 (GROFF_HTML_PROGRAMS, GROFF_PDFDOC_PROGRAMS):
Tweak autoconf warning messages when Ghostscript (gs) command
missing to be more mutually congruent.
(GROFF_URW_FONTS_CHECK): Tweak to note that gs is only run to
locate the URW fonts if gs is available.
2021-05-16 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/tests/an-old_AT-and-UC-footer-saved-and-restored.sh:
Tweak to be more helpful when troubleshooting exasperating
header/footer problems as in Savannah #60609.
2021-05-16 G. Branden Robinson <g.branden.robinson@gmail.com>
[man]: Fix missing page footers when continuously rendering
multiple documents. Resolving this uncovered entangled header
and footer management bugs with batch processing even when _not_
continuously rendering.
* tmac/an-old.tmac (an-start-new-document): New macro clears
header trap so it doesn't get called with stale information.
{The TH macro already replants a header trap with every man
page if not continuously rendering.) This macro also absorbs
the break-page and page number incrementation logic from TH.
(TH): Adapt semantics of "an-first" register to mean not "first
page rendered" (apparently) but "first page of new document".
If we are _not_ on the first page of a new document and the TH
macro is called, we must be batch processing: force the previous
man page to end (call an-end if continuously rendering, or
an-start-new-document if not). After all the header and footer
strings have been configured for the man page, call an-header if
we're on the first page of the document, not (just) if we're
continuously rendering. Zero an-first register at end of macro
here unconditionally instead of conditionally in .an-header.
(an-header): Drop conditional on continuous rendering.
When I batch-render our 62 man pages to the terminal, I do note
one cosmetic regression: the lj4_font(5) page, when continuously
rendered in batch processing, has no space between its header
line and first section heading ("Name"). Another cosmetic issue
in this scenario is that the footers for every rendered page but
the last, which had (wrongly) been absent entirely, are set with
no space after them and the header of the next.
* tmac/tests/an-old_page-footers-present.sh:
* tmac/tests/an-old_page-header-has-current-data.sh: Add man
page header/footer regression tests.
* tmac/tmac.am (tmac_TESTS): Run the tests.
Fixes <https://savannah.gnu.org/bugs/index.php?60609>.
2021-05-15 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/an-old.tmac (initialization): Key the reprocessing guard
{like a C language #include guard} on the existence of the TH
macro instead of RI. The latter seemed kind of random and TH
is even more guaranteed to exist; it is the macro name most
characteristic of the man(7) language and the andoc.tmac
superstructure relies on it.
(initialization): Relocate load of devtag package; we don't
need it before entering compatibility mode. Move assignment of
format of an-page-letter register from a "loose declaration"
amid macro definitions to within existence test of X register.
Stop initializing an-extra[123] strings outside of any macro;
they need to be reinitialized at every TH call when batch
rendering.
(TH): Call DT in a less surprising place.
(TH): Initialize all header/footer-related strings before
calling header macros, even those not needed for the default
header configuration.
(TH): Add style warnings for underspecified arguments.
(an-ne): Rename register from "an-need", which is pretty
confusing in context, to "an-amount", since (1) a (vertical)
amount is what it is, and (2) it's only used within this macro.
Also due to factor (2), remove the register after using it.
2021-05-15 G. Branden Robinson <g.branden.robinson@gmail.com>
* m4/groff.m4 (GROFF_URW_FONTS): Update configure script check
for URW fonts to recognize recent releases of the URW Base 35
fonts from Artifex Software. Look for the AR (Arial roman
equivalent) font under all of the names recognized by
fonts/devpdf/Foundry.in.
* m4/groff.m4 (GROFF_URW_FONTS_CHECK): Update wording of notice
when URW fonts are not found. Replace dead URL with working
one. Try to hedge against the future, but the Web is an
ephemeral place, as are the file names Artifex gives to its
fonts. Thanks to T. Kurt Bond and Thomas Dupond for reporting
and investigating the problem.
Fixes <https://savannah.gnu.org/bugs/index.php?60604>.
2021-05-13 G. Branden Robinson <g.branden.robinson@gmail.com>
* doc/groff.texi (ms Document Control Settings) <DI>:
* doc/ms.ms (Document control settings, Displays and keeps)
<DI>:
* tmac/groff_ms.7.man (Document control settings, Displays and
keeps) <DI>: Document this register; it had been mentioned only
in passing.
2021-05-13 G. Branden Robinson <g.branden.robinson@gmail.com>
* doc/groff.texi (ms Document Control Settings) <DD>:
* doc/ms.ms (Document control settings) <DD>:
* tmac/groff_ms.7.man (Document control settings) <DD>: Fix
error; changes to \n[DD] take effect at the next display
boundary (including the end of the active one), not the next
"paragraph" (paragraph macros cannot be called inside a display
anyway).
2021-05-12 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/andoc.tmac (reload-man): Delete no-op line that attempts
to restore compatibility mode. Individual pages have to do
this, and ".do cp \n(.C" is not effective for the reason
discussed in the 2020-04-16 ChangeLog entry.
2021-05-08 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/s.tmac (@RT): Delete definition; make it an alias for
par@finish. Until commit 021ba0e7 (1 May), they had identical
definitions. I find it difficult to imagine what use it would
be to have an undocumented reset macro that resets everything
_except_ the deeply internal \n[.ev]:ai.
2021-05-08 G. Branden Robinson <g.branden.robinson@gmail.com>
[man]: Handle HF strings with an embedded font family when
applying italic-to-bold-italic remapping; the feature now works
on troff devices as well.
* tmac/an-old.tmac (initialization): Do more validity checking.
Store heading family in new string \*[an-heading-family]. Clean
up after self.
(SH, SS): Include the heading family in the remapping target.
* tmac/groff_man.7.man.in (Description/Document structure
macros) <.SH, .SS>: Document it.
2021-05-07 G. Branden Robinson <g.branden.robinson@gmail.com>
* man/groff_char.7.man (Glyph tables/Mathematical symbols): Fix
errors in special character descriptions; \[sqrt] is a "special"
glyph (that is, it uses mathematical metrics on typesetter
devices), and \[radicalex) is not (and is thus a "text" glyph).
See Werner Lemberg's ChangeLog entry of 2003-01-05. Problem
dates to 07a6233ad, 27 May 2014.
The overloaded use of the word "special" really pinches here.
2021-05-07 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/tty.tmac: Replace fallback glyphs for radical extension
and square root extension; use \[rn] instead, which works fine.
Now the only glyph in the page that doesn't render on a UTF-8
terminal (if one's font has adequate coverage) is the Bell
Systems logo.
2021-05-07 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/tty.char: Add fallback characters for \[fm] and \[sd].
2021-05-06 G. Branden Robinson <g.branden.robinson@gmail.com>
[man]: If \*[HF] is a bold style, substitute bold italics for
italics in section and subsection headings, keeping the font
weight consistent.
* tmac/an-old.tmac (initialization): Set a flag for this based
on the interpolation of \*[HF] matching "B" as its last
character.
(SH, SS): Apply and reverse font remapping based on this flag.
2021-05-06 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/an-ext.tmac (EX): Work around Savannah #59522 by changing
fonts differently on DVI output, avoiding a font warning.
2021-05-06 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/an-ext.tmac: If in nroff mode, remap font CBI to BI.
* tmac/dvi.tmac: Remap font CBI to CWI. (Computer Modern
Constant Width has no bold styles.)
2021-05-05 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/s.tmac (NL, SM, LG): Issue warning diagnostic if macro
called with arguments.
(par*define-font-macro): Construct font macro with diagnostic to
warn if called with excess arguments.
(UL, BX): Issue warning diagnostic if macro called with excess
arguments.
Fixes <https://savannah.gnu.org/bugs/index.php?60522>.
2021-05-05 G. Branden Robinson <g.branden.robinson@gmail.com>
* doc/groff.texi: Delete redefinition of \putwordAppendix
Texinfo macro. This restores the word "Appendix" to the names
of all appendices and fixes two bad internal links to Appendix
E, the Register Index, in the DVI and PDF output formats. Per
consultation with Texinfo maintainer Gavin Smith, it's difficult
to get the behavior we want, so give up trying for now.
2021-05-05 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/s.tmac (@MC): Actually diagnose and recover when user
tries to .MC inside a diversion.
2021-05-05 G. Branden Robinson <g.branden.robinson@gmail.com>
* doc/groff.texi (Differences from AT&T ms):
* doc/ms.ms (Differences from AT&T ms):
* tmac/groff_ms.7.man (Differences from AT&T ms): Document our
different default (empty) for the center footer in nroff mode;
this behavior appears to date back to June 1991 or earlier,
drawing few complaints.
Fixes <https://savannah.gnu.org/bugs/?59826>.
2021-05-02 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/tests/*: Rename files to use consistent scheme; one
underscore to separate the package name from the test objective,
dashes to otherwise separate words.
* tmac/tmac.am (tmac_TESTS): Use new names.
2021-05-02 G. Branden Robinson <g.branden.robinson@gmail.com>
[ms]: Restore support for AT&T ms PN register.
* tmac/s.tmac (pg): Make register PN an alias of %.
* doc/groff.texi (Differences from AT&T ms):
* doc/ms.ms (Differences from AT&T ms):
* tmac/groff_ms.7.man (Differences from troff ms): We don't need
PN, and it was removed in commit 08291b40 (25 October 2020), but
since it is documented in Lesk 1978 we're stuck with it. Advise
users to stick with %. Also warn them of the hoop they must
jump through if they redefine the page trap macro PT, which Lesk
1978 also encourages.
* tmac/tests/s_PN-works.sh: Test it.
* tmac/tmac.am (tmac_TESTS): Run test.
Fixes <https://savannah.gnu.org/bugs/?59823>.
2021-05-01 G. Branden Robinson <g.branden.robinson@gmail.com>
[ms]: Restore default IP paragraph indentation after an SH call.
* tmac/s.tmac (par@finish): Set "ai" register for the current
environment to the paragraph indent (PI) setting for the current
environment.
* doc/groff.texi (Highlighting in ms) <IP>:
* doc/ms.ms (Highlighting) <IP>:
* tmac/groff_ms.7.man (Usage/Highlighting) <IP>: Update
documentation.
* tmac/tests/s_SH_resets_IP_indentation_amount: Test it.
* tmac/tmac.am (tmac_TESTS): Run test.
Fixes <https://savannah.gnu.org/bugs/?60222>.
2021-05-01 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/s.tmac (DS): Issue diagnostic and attempt recovery if
document attempts to start a display within another display.
Fixes <https://savannah.gnu.org/bugs/?55136>.
2021-04-30 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/s.tmac: Implement alternative rendering for automatic
footnote numbers in nroff mode, inspired by Heirloom Doctools
ms; since superscripting is not univerally available on
terminals, surround number with square brackets instead.
(fn@init): New macro finishes initializing footnote module,
setting up aliases to par@sup-{start,end} strings in troff mode
and otherwise defining fn@sup-{start,end} as brackets. Define *
string here, using new strings.
(par): Call fn@init after par@sup-{start,end} are defined, and
prior to other footnote integration material.
(par*fp!0): Migrate from par@sup-{start,end} to
fn@sup-{start,end}.
* doc/groff.texi (ms Document Control Settings) <FF>:
* doc/ms.ms (Footnotes) <FF>:
* tmac/groff_ms.7.man (Usage/Footnotes) <FF>: Document it.
Fixes <https://savannah.gnu.org/bugs/?60228>.
2021-04-30 G. Branden Robinson <g.branden.robinson@gmail.com>
* test-groff.in: Stop passing the built groff executable -b and
-ww options by default. This reverses a change from 2017. Dave
Kemper has convincingly argued that there's no way to override
-b and turn backtraces on warnings/errors back off, and that the
built groff should behave as much like a "normal" one as
possible. The latter factor is of added importance now that we
are using test-groff for generation of documents.
* src/roff/groff/tests/regression_savannah_58153.sh: Adapt.
2021-04-30 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/s.tmac (BX): Add alternative implementation for terminal
{nroff} devices. Store width of boxed text, adding .4m only on
troff devices (to make room for the vertical box lines). Break
long input line in troff implementation. If not in troff mode,
use ISO 6429 color escapes to render boxed text in black on
white. Use the \Z escape to match breaking semantics of macro
in troff mode.
* doc/groff.texi (Highlighting in ms) <BX>:
* doc/ms.ms (Highlighting) <BX>:
* tmac/groff_ms.7.man (Usage/Highlighting) <BX>: Document it.
Fixes <https://savannah.gnu.org/bugs/?60477>.
2021-04-30 G. Branden Robinson <g.branden.robinson@gmail.com>
* doc/doc.am: Make $(PROCESSEDDOCFILES) depend on all the same
targets as $(PROCESSEDEXAMPLEFILES); this way the me, ms, and
pic.ms manuals are all regenerated upon changes to their
underlying macro packages.
2021-04-22 G. Branden Robinson <g.branden.robinson@gmail.com>
* INSTALL.extra: Update.
(Evaluation): New section updates material on "test-groff"
script. Also tell people how to preview our Texinfo manual (in
info, text, DVI, PDF, and HTML formats).
(In Case of Trouble): New section updates bug reporting URL.
Fixes <https://savannah.gnu.org/bugs/?57863>.
2021-04-21 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/s.tmac: Make the FAM string work more sensibly; it now
applies to headers, footers, and footnotes only if set
before the first call of a sectioning, paragraphing, or
{non-date} document description macro.
(PT, BT): Set the font family to that saved for titles.
(fn*do-FS): Set the font family to that saved for footnotes.
(par@init): Copy the document font family to independent strings
for titles and footnotes.
(par@reset): If in a footnote environment, set the font family
to that saved for footnotes; otherwise use \*[FAM].
* tmac/groff_ms.7.man (Differences from troff ms/Text settings):
Describe placement-dependent effect of FAM string setting.
* doc/groff.texi (Highlighting in ms):
* doc/ms.ms (Highlighting): As above, and suggest different
occasions in which ".ds FAM C" and "CW" are convenient.
Fixes <https://savannah.gnu.org/bugs/?60422>.
2021-04-19 G. Branden Robinson <g.branden.robinson@gmail.com>
* src/roff/troff/input.cpp (source, source_quietly,
macro_source, macro_source_quietly): Use idiomatic Boolean
literals.
2021-04-17 G. Branden Robinson <g.branden.robinson@gmail.com>
* doc/groff.texi: Drop workarounds for Texinfo pre-5.0 versions;
our local macros produced many warnings during generation of our
Texinfo manual.
(Langlemacro):
(Ranglemacro):
(Lparenmacro):
(Rparenmacro):
(Lbrackmacro):
(Rbrackmacro): Delete. Replace call sites with literals.
(Lbracemacro):
(Rbracemacro): Delete. Replace call sites with @lbracechar{}
and @rbracechar{}.
(angles): Reimplement in terms of @guilsinglleft{} and
@guilsinglright{}. Flesh out comment.
Fixes remainder of <https://savannah.gnu.org/bugs/?59524>.
2021-04-17 Dave Kemper <saint.snit@gmail.com>
* doc/meintro.me:
* doc/meref.me: Correct and make consistent usage of the term
"point size".
Fixes <https://savannah.gnu.org/bugs/?60403>.
2021-04-17 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/an-old.tmac (SS): Add devtags support. Set a subsection
title as a second-level heading and add it to a table of
contents, if any. Prompted by a query from Hans Unzner to the
groff mailing list. Thanks, Hans!
2021-04-17 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/an-old.tmac (SH): Fix apparent thinko. Pass the devtags
macro a literal "1" argument. Passing it \n[an-level] wasn't
correct (it stores the relative inset level, not a sectioning
level), and was useless anyway: SH has already called
.an-set-margin by this point, which resets \n[an-level] to 1.
man(7) does not support nesting of SH macros. Also call
.DEVTAG-NH by its alias .DEVTAG-SH since section headings are
not numbered in man(7).
2021-04-15 G. Branden Robinson <g.branden.robinson@gmail.com>
[tmac]: Adjust editor file encoding hints.
* tmac/cs.tmac: Tell Vim the file is "iso-8859-2" (ISO Latin-2).
* tmac/en.tmac: Stop telling Emacs the file is "latin-1"; it's
ASCII.
* tmac/fr.tmac: Tell Vim file is "iso-8859-15" (ISO Latin-9).
Vim users may need to use ":e ++enc=iso-8859-2", for instance,
to see correct glyphs.
2021-04-15 G. Branden Robinson <g.branden.robinson@gmail.com>
Determine the groff locale (default input language) using the
system locale. Use the environment if possible. Try LC_ALL
first, then LANG. "C" means English (en). Otherwise, only the
first two characters of the locale name are used.
Unrecognized locales (those without a supporting xx.tmac file)
are ignored, and groff falls back to English.
Those who want groff's default locale to differ from LC_ALL/LANG
should edit the troffrc file to source the appropriate groff
locale macro file (cs.tmac, de.tmac, den.tmac, fr.tmac, ja.tmac,
sv.tmac, zh.tmac).
The first-order determinant of hyphenation points is language,
not territory. Use ISO 639 2-letter language codes for
hyphenation and exception patterns instead of ISO 3166 2-letter
territory codes.
* tmac/*.us: Rename *.us files to *.en.
* tmac/troffrc: Change hyphenation language "us" to "en".
* tmac/en.tmac: Add English localization file. Set hyphenation
mode to 4.
* tmac/troffrc: Derive groff locale from system.
* doc/groff.texi (Manipulating Hyphenation):
* man/groff.7.man (Hyphenation):
* man/groff_diff.7.man (Implementation differences): Refer to
"U.S. English" hyphenation patterns as simply "English"; they
will be mostly correct for Commonwealth English as well, and no
alternative English hyphenation patterns for other territories
are available.
* doc/groff.texi (Manipulating Hyphenation):
* man/groff_diff.7.man (New requests): Note that default
hyphenation mode depends on the language used on the system.
Add concept index entry for localization. Add file index
entries for the locale macro files (cs.tmac, etc.). Add
environment variable index entries for LANG and LC_ALL.
Describe how groff's idea of the locale is determined. Update
to reflect rename of English hyphenation patterns and .hla
identifier from "us" to "en".
* src/roff/groff/tests/localization_works.sh: Add 10 test cases.
* src/roff/groff/groff.am (groff_TESTS): Run test.
* tmac/LOCALIZATION: Rewrite.
Fixes <https://savannah.gnu.org/bugs/?59814>.
2021-04-12 Dave Kemper <saint.snit@gmail.com>
* doc/meref.me: Correct various small issues.
Fixes <https://savannah.gnu.org/bugs/?60379>.
2021-04-12 Dave Kemper <saint.snit@gmail.com>
* man/groff.7.man (Registers/Writable registers) <year, yr>:
Drop discussion of Y2K issues.
Fixes <https://savannah.gnu.org/bugs/?60372>.
2021-04-11 G. Branden Robinson <g.branden.robinson@gmail.com>
* doc/groff.texi (Setting Registers) <rnn>: Fix error: the
request is not ignored if the second argument (the new name)
does not exist. Problem dates back to 52a6d12a (11 May 2000).
2021-04-09 G. Branden Robinson <g.branden.robinson@gmail.com>
Implement new .soquiet and .msoquiet requests.
Needed for two planned developments: {1} the i18n patch in
Savannah #59814 can use this to quietly attempt to open a
localization file. groff only supports a few locales, so people
with LANG=es_ES, for instance, would ordinarily see warning
diagnostics on every groff startup; and {2} system- or
site-configurable support of per-user {.,}troffrc or man.local
files, gracefully failing if they don't exist.
* src/roff/troff/input.cpp:
(do_source): Add new function, taking boolean "quietly"
parameter and absorbing function of source(), with added
conditional.
(source): Convert into a wrapper to call do_source() unquietly.
(source_quietly): Wrap do_source(), quietly.
(do_macro_source, macro_source, macro_source_quietly): Analogous
to the foregoing.
(init_requests): Hook "msoquiet" to macro_source_quietly() and
"soquiet" to "source_quietly().
* doc/groff.texi (I/O):
* man/groff.7.man (Requests/Request short reference):
* man/groff_diff.7.man (Language/New requests): Document them.
* src/roff/groff/tests/msoquiet_works.sh:
* src/roff/groff/tests/soquiet_works.sh: Test them.
* src/roff/groff/groff.am (groff_TESTS): Add tests.
Fixes <https://savannah.gnu.org/bugs/?59973>.
2021-04-08 G. Branden Robinson <g.branden.robinson@gmail.com>
* doc/groff.texi (ms Document Control Settings) <FF>: Update
description to cover application of footnote format to footnote
markers in general, not just numbers. Clarify different
behavior of format 1 with respect to automatic numbers and other
markers.
(ms Footnotes) <*>: Describe string operation in more detail.
<FS>: Describe more precisely how the optional argument is
handled.
* doc/ms.ms (Footnotes): Synchronize with doc/groff.texi. Add
example using document's own text as a model.
* tmac/groff_ms.7.man (Usage/Footnotes): Resync relevant
portions with doc/ms.ms.
Fixes <https://savannah.gnu.org/bugs/?60227>.
2021-04-06 Dave Kemper <saint.snit@gmail.com>
* src/roff/nroff/nroff.sh: Recognize -k and -K options and pass
them through to troff. Document them in usage message.
* src/roff/nroff/nroff.1.man: Document new -k and -K options.
Fixes <https://savannah.gnu.org/bugs/?60349>.
2021-04-06 G. Branden Robinson <g.branden.robinson@gmail.com>
* doc/groff.texi (Manipulating Hyphenation):
Recast introductory paragraph to better distinguish between the
automatic breaking of words and placement of hyphens at
user-specified hyphenation points (done with the \% escape) and
automatic determination of hyphenation points within words (what
the pattern files and most of the hyphenation mode parameters
are for). Clarify that what our manual calls "automatic
hyphenation" pertains only to the latter.
<hw> Correct over-general claim; hyphenation exceptions defined
with the .hw request _do_ honor .hy value 2 (don't break a word
at the bottom of a page), but none of the others.
<\%> Recast description of escape to emphasize independence of
its two uses (e.g., "\%pseudo\%unununium" is hyphenated only
after "pseudo-", if at all).
<\:> Clarify that escape is an input word boundary.
<shc> Clarify that the soft hyphen glyph is applied to manual as
well as automatically-determined hyphenation points.
<hy> Recharacterize as setting the _automatic_ hyphenation mode.
Note that restrictions apart from value 2 are not applied to
words with manually-assigned hyphenation points.
<nh> Note that request affects only automatic hyphenation.
* man/groff.7.man (Requests/Request short reference) <.hy,.nh>:
Clarify that requests deal with _automatic_ hyphenation.
(Registers/Read-only registers) <.hy>:
Clarify that register applies to _automatic_ hyphenation.
(Hyphenation): Add new introductory paragraph summarizing manual
hyphenation support and features, including notice that breaking
at explicit hyphens is performed in fill mode, i.e., even if
_automatic_ hyphenation is disabled.
Thanks to Peter Schaffter for the report.
Fixes <https://savannah.gnu.org/bugs/?60332>.
2021-03-27 Deri James <deri@chuzzlewit.myzen.co.uk>
Changes to the ghostscript fontnames (9.53.3).
* font/devpdf/Foundry.in: HI and HBI switch to using
Italic rather than Oblique.
2021-03-24 G. Branden Robinson <g.branden.robinson@gmail.com>
* doc/groff.texi (Manipulating Filling and Adjustment):
* man/groff_diff.7.man (Language/Extended requests): Fix
incorrect claim that additional inter-sentence space is applied
only in fill mode. Drop word "parameter" from description of
unit used in .ss request arguments; it is a needlessly specific
reference to the font file format. Tighten wording.
* man/groff.7.man (Control Characters): Fix incorrect claim that
end-of-sentence detection is attempted only in fill mode. Note
that .ss request also affects inter-word spacing.
* man/groff_diff.7.man (Language/Extended requests):
- Drop example.
- Move discussion of AT&T vs. GNU troff difference in .ss
handling from here...
(Implementation Differences): ...to here.
Thanks to Dave Kemper for his continued scrutiny!
2021-03-20 G. Branden Robinson <g.branden.robinson@gmail.com>
* doc/groff.texi (ms Cover Page Macros):
* doc/ms.ms (Cover page macros):
* tmac/groff_ms.7.man (Usage/Cover page macros): Revise and
rename (sub)sections to "Document description macros".
2021-03-15 Dave Kemper <saint.snit@gmail.com>
* Makefile.am: Fix typos. Thanks to Bjarni Ingi Gislason for
the report.
Fixes <https://savannah.gnu.org/bugs/?59457>.
2021-03-14 Dave Kemper <saint.snit@gmail.com>
* man/groff_tmac.5.man: Correct erroneous reference to PSPIC
where PDFPIC was intended. Fix numerous smaller style and
content problems.
Fixes <https://savannah.gnu.org/bugs/?60229>.
2021-03-03 G. Branden Robinson <g.branden.robinson@gmail.com>
* doc/groff.texi (Optional man extensions) <CW, EX, PN, Pn>:
(Highlighting in ms) <CW>:
(Additional ms macros) <CW>: Use "monospaced" to refer to font
selected, retaining "constant-width" term only where it explains
the macro mnemonic. Thanks to Dave Kemper for pointing out the
issue. Also fix error: .CW in the ms package seems to have
originated with Research Unix, not Berkeley.
* doc/ms.ms (Highlighting) <CW>: Sync with our Texinfo manual.
* tmac/groff_ms.7.man: Sync with ms.ms, omitting FAM advice.
Fixes <https://savannah.gnu.org/bugs/?60037>.
2021-03-02 G. Branden Robinson <g.branden.robinson@gmail.com>
* doc/groff.texi (Identifiers, Strings, Writing Macros,
Diversions): Improve cross-linkage of documentation regarding
shared name space of macros, strings, diversions, and boxes.
Fixes <https://savannah.gnu.org/bugs/?58995>.
2021-03-01 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/s.tmac: Improve diagnostic messages.
(@diag): New macro wraps .tm request, always prefixing it with
the name of the macro package, as well as file and line
indicators only if these are set to non-empty or non-zero
values, respectively.
(@error, @warning): Call @diag instead of .tm directly.
(@fatal): Retire; it had only one call site and it would have
greatly complicated @diag to support calling .ab instead of .tm.
An ugly alternative would have been to call .ab with a redundant
message after calling @diag.
(@divert): New macro wraps .di request, remembering the name of
the current file (\n[.F]) when a diversion is started.
(@error-recover): Call .ab instead of (deleted) @fatal.
(pg@super-eject): Tell user what the last file name seen was
when recovering from an unfinished diversion when processing
ends.
Fixes <https://savannah.gnu.org/bugs/?55099>.
2021-02-25 G. Branden Robinson <g.branden.robinson@gmail.com>
Fix bug where having line numbering off but the output line
number register \n[ln] set to a positive value would cause
tbl(1) table rows to spontaneously become numbered. Use new
\n[.nm] register to determine whether line numbering is enabled.
* src/preproc/tbl/table.cpp (table::init_output, table::do_row,
table::do_bottom): Predicate all conditions on \n[ln]
additionally on \n[.nm].
Thanks to Olle Lögdahl for the report. Problem appears to date
back to commit b69062693d3360efce9d4d63fac337be21e07db7, 20 July
2011.
Fixes <https://savannah.gnu.org/bugs/?59812>.
2021-02-25 G. Branden Robinson <g.branden.robinson@gmail.com>
Add regression test for Savannah #59812.
* src/preproc/tbl/tests/cooperate-with-nm-request.sh: Do it.
* src/preproc/tbl/tbl.am (tbl_TEST): Run test.
2021-02-25 G. Branden Robinson <g.branden.robinson@gmail.com>
Implement new read-only register ".nm". It reports the
enablement status of output line numbering (caused by the .nm
request) irrespective of the temporary suspension of numbering
with the .nn request. Needed because there was no way to
introspect its state, tbl(1) needs to do so, and the writable
line number register \n[ln] is not a reliable proxy for it.
* src/roff/troff/env.h: Add get_numbering_nodes(), returning
`int`, to public interface of `environment` class.
* src/roff/troff/env.cpp: Implement get_numbering_nodes().
* src/roff/groff/tests/dot-nm_register_works.sh: Test it.
* src/roff/groff/groff.am (groff_TESTS): Run test.
* doc/groff.texi (Miscellaneous):
* man/groff_diff.7.man (Language/New number registers):
* man/groff.7.man (Registers/Read-only registers): Document it.
* NEWS: Add item.
2021-02-23 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/s.tmac: Emit warning diagnostic when using a multi-page
table with a repeating header (".TS H").
(KS): Rename diversion from "kp*div" to "kp@div" since the name
is now referenced outside the keep module.
(KF): ...similarly for kp@fdiv.
(generally): Update diversion dereference sites and derived
names.
(@TS): When handling "H" argument, check identity of current
diversion and emit appropriately worded warning.
2021-02-14 G. Branden Robinson <g.branden.robinson@gmail.com>
* FOR-RELEASE: Add more procedures and information related to
incrementing groff's version number.
2021-02-14 G. Branden Robinson <g.branden.robinson@gmail.com>
* src/libs/libgroff/searchpath.cpp (search_path::open_file,
search_path::open_file_cautious): Save errno before calling
free() and restore it afterwards. A future version of POSIX
will require that free() not change errno if it succeeds[1];
some C library implementations, including recent versions of
glibc[2], lack this property. free() is called in these
libgroff functions to clean up after an unsuccessful fopen() of
a heap-allocated file name string, and because the errno from
fopen() may be passed to strerror() in a diagnostic message, it
needs to be accurate. I checked the rest of groff's codebase
and found no other instances of free() being used to clean up
after fopen() failure.
[1] https://www.austingroupbugs.net/view.php?id=385
[2] https://sourceware.org/bugzilla/attachment.cgi?id=13073
2021-02-11 G. Branden Robinson <g.branden.robinson@gmail.com>
Address build failure on macOS.
Follow the advice of the gnulib manual ("Changing your source
for use with gnulib") more scrupulously; include config.h in
more files.
* src/libs/libgroff/curtime.cpp [HAVE_CONFIG_H]:
* src/libs/libgroff/device.cpp [HAVE_CONFIG_H]:
* src/libs/libgroff/fatal.cpp [HAVE_CONFIG_H]:
* src/libs/libgroff/string.cpp [HAVE_CONFIG_H]:
* src/libs/libgroff/strsave.cpp [HAVE_CONFIG_H]:
* src/preproc/eqn/other.cpp [HAVE_CONFIG_H]:
* src/preproc/eqn/text.cpp [HAVE_CONFIG_H]:
* src/preproc/pic/object.cpp [HAVE_CONFIG_H]: Do it.
* src/libs/libgroff/assert.cpp [HAVE_CONFIG_H]:
* src/libs/libgroff/errarg.cpp [HAVE_CONFIG_H]:
* src/libs/libgroff/error.cpp [HAVE_CONFIG_H]: #include
config.h using angle brackets instead of quotation marks.
Fixes <https://savannah.gnu.org/bugs/?60035>.
2021-02-11 G. Branden Robinson <g.branden.robinson@gmail.com>
Add regression test for Savannah #60025.
* tmac/tests/doc_Mt-works.sh: Do it.
* tmac/tmac.am (tmac_TESTS): Run test.
2021-02-11 G. Branden Robinson <g.branden.robinson@gmail.com>
[ms]: Demote definition of \[yogh] special character escape from
unconditional availability to be defined only if the output
device defines it or if .AM macro is called to enable support
for Berkeley-style accent marks.
See
https://lists.gnu.org/archive/html/groff/2021-01/msg00000.html
and follow-ups for discussion.
* tmac/s.tmac (initialization): Move definition of \[yogh] (only
if the output device doesn't already define it) from here...
(AM): ...to here.
2021-02-08 G. Branden Robinson <g.branden.robinson@gmail.com>
* doc/ms.ms: Use \[ps] special character instead of local
character definition using numeric code point escape, which is
less portable.
Fixes <https://savannah.gnu.org/bugs/?59528>.
2021-02-04 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/s.tmac (initialization): Call par*define-font-macro with
arguments "CW" and "R" in nroff mode to silence font warnings
from documents using .CW macro in nroff mode.
2021-02-03 G. Branden Robinson <g.branden.robinson@gmail.com>
* src/preproc/tbl/table.cpp (table::init_output): Save value of
hyphenation maximum consecutive line count register (\n[.hlm])
more carefully to keep it from being incorrectly parsed as a
decrement, because negative values of \n[.hlm] are valid (in
fact, "-1" is the default). In documents with a large number of
tables, this can lead to a Persian chessboard problem and an
integer overflow (at the groff language level, caught and
handled by src/roff/troff/number.cpp:parse_term()).
It is wise to wrap a non-literal second argument to the .nr
request in parentheses if assignment is desired and its value
can be negative. See section 5.6.1 ("Setting Registers") of the
groff Texinfo manual.
Fixes <https://savannah.gnu.org/bugs/?59993>.
2021-02-03 G. Branden Robinson <g.branden.robinson@gmail.com>
* test-groff.in: Add support for rfc1345.tmac.
2021-02-02 G. Branden Robinson <g.branden.robinson@gmail.com>
Integrate rfc1345.tmac into build system.
* contrib/rfc1345/rfc1345.am: Do it.
* Makefile.am: Include contrib/rfc1345/rfc1345.am.
2021-02-01 G. Branden Robinson <g.branden.robinson@gmail.com>
* src/roff/troff/input.cpp (open_mac_file): Report problem when
attempting to open macro files (-m arguments) and the error is
something other than ENOENT.
(process_macro_file): Update diagnostic to be more precise; the
file couldn't be _opened_, not necessarily _found_, and clarify
that the string being reported back to the user is the argument
to the -m option, not a file name.
(macro_source): Update diagnostic to report that the file
couldn't be _opened_, not necessarily _found_, and include the
nature of the problem.
2021-01-30 G. Branden Robinson <g.branden.robinson@gmail.com>
[tbl]: Save and restore hyphenation parameters.
* src/preproc/tbl/table.cpp (table::init_output): When starting
a table, save the hyphenation parameters (\n[.hy], \n[.hla],
\n[.hlm], \n[.hym], \n[.hys]). Restore them in the table reset
macro (confusingly called "3init"), which is called before
performing each diversion and before exiting a table.
This enables people to, e.g., turn off hyphenation in a table
text block with .nh, just as they can turn off adjustment with
.na, without having to manually reset it. The next text block,
and the material after the table, will not be affected.
Fixes <https://savannah.gnu.org/bugs/?59971>.
2021-01-30 G. Branden Robinson <g.branden.robinson@gmail.com>
Add regression test for Savannah #59971.
* src/preproc/tbl/tests/\
save-and-restore-hyphenation-parameters.sh: Do it.
* src/preproc/tbl/tbl.am (tbl_TEST): Run test.
2021-01-30 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/tmac.am ($(TMACSTRIPFILES)):
($(TMACMDOCSTRIPFILES)): Remove unidiomatic for loop which
frustrated parallel make operation.
Thanks to an anonymous contributor for the report and patch.
Fixes <https://savannah.gnu.org/bugs/?59958>.
2021-01-29 G. Branden Robinson <g.branden.robinson@gmail.com>
* doc/ms.ms (Document control settings): Document old FAM string
and new FR string.
2021-01-29 T. Kurt Bond <tkurtbond@gmail.com>
[ms]: Add new string FR to hold an expression for computing the
footnote length relative to the line length, consistently for
single- and multi-column modes, which \n[FL] has never done.
* tmac/s.tmac: Initialize FR string to "11/12".
(@MC): Compute footnote column width using \*[FR] instead of a
hard-coded "11/12" expression.
(par@init): Compute default \n[FL] using \*[FR] instead of a
hard-coded "11/12" expression.
* doc/groff.texi (Macro Packages/ms/Document control settings):
* tmac/groff_ms.7.man (Usage/Document control registers):
Document it.
Fixes <https://savannah.gnu.org/bugs/?59605>.
2021-01-25 G. Branden Robinson <g.branden.robinson@gmail.com>
* src/roff/troff/env.cpp: Add ADJUST_MAX enumeration constant to
record maximum valid numerical adjustment mode.
(adjust): Verify numeric argument against ADJUST_MAX instead of
a numeric literal. Ignore excessively large values instead of
setting adjustment mode to "right". Update warning diagnostic.
2021-01-25 G. Branden Robinson <g.branden.robinson@gmail.com>
Add regression test for .ad and .na requests.
* src/roff/groff/tests/adjustment_works.sh: Do it.
* src/roff/groff/groff.am (groff_TESTS): Run test.
2021-01-24 G. Branden Robinson <g.branden.robinson@gmail.com>
* doc/groff.texi (Manipulating Filling and Adjustment):
* man/groff.7 (Requests/Request short reference): Clarify
behavior of ".na" and ".ad l".
Thanks to Bjarni Ingi Gislason for pointing out the potential
for confusion and for his careful review of the new text.
Fixes <https://savannah.gnu.org/bugs/?59795>.
2021-01-20 G. Branden Robinson <g.branden.robinson@gmail.com>
* src/roff/grog/grog.pl: Report program name in fatal error
diagnostics. Also drop sentence-ending punctuation since Perl
supplies additional information.
Continues the long process of fixing Savannah #52463.
2021-01-19 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/an-old.tmac (RE): Style-warn if macro arguments are out
of range or redundant.
Fixes <https://savannah.gnu.org/bugs/?55320>.
2021-01-15 G. Branden Robinson <g.branden.robinson@gmail.com>
Improve style of troffrc{,-end} files. Follow established
idioms and make them consistent with each other.
* tmac/troffrc:
* tmac/troffrc-end:
- Identify files in header comments as part of GNU troff.
* tmac/troffrc:
- Clarify purpose of .do request.
- Identify .X (set by groff -X) as a register, not a string.
- Remove temporary registers one per line to make
synchronization with foregoing logic easier. Fixes name
space management nits: an undefined string troffrc!Xps was
being removed, and troffrc!{ascii,latin1,utf8,cp1047} were
not being removed despite being defined.
* tmac/troffrc-end:
- Clarify that file is read after -m file arguments (not "all
macro sets", which can be loaded with .mso after this file
is processed).
- Advise usage of .do for groff extensions.
- Line-break one-off conditionals as troffrc does.
- Add empty string comment to empty string definitions.
2021-01-14 Dave Kemper <saint.snit@gmail.com>
Commit 87edb525, from 2003, added character U+2026 (HORIZONTAL
ELLIPSIS) to most base groff fonts, but there has been no
kerning information for this character. To produce consistent
typography, it should be kerned the same way as the period,
which is in 818 kern pairs across all the devps fonts.
Apply the following shell command to the groff description files
of the PostScript fonts.
for file in font/devps/*[A-Z]
do sed -Ei\~ 's/(.*)(^| )\. (.*)/&\n\1\2u2026 \3/' $file
done
* font/devps/AB:
* font/devps/ABI:
* font/devps/AI:
* font/devps/AR:
* font/devps/BMB:
* font/devps/BMBI:
* font/devps/BMI:
* font/devps/BMR:
* font/devps/HB:
* font/devps/HBI:
* font/devps/HI:
* font/devps/HNB:
* font/devps/HNBI:
* font/devps/HNI:
* font/devps/HNR:
* font/devps/HR:
* font/devps/NB:
* font/devps/NBI:
* font/devps/NI:
* font/devps/NR:
* font/devps/PB:
* font/devps/PBI:
* font/devps/PI:
* font/devps/PR:
* font/devps/TB:
* font/devps/TBI:
* font/devps/TI:
* font/devps/TR:
* font/devps/ZCMI: Apply above script.
Fixes <https://savannah.gnu.org/bugs/?58897>. However, this
will need to be done again if afmtodit is used to regenerate the
above files, or afmtodit will need to be modified to add this
kerning information itself.
2021-01-12 G. Branden Robinson <g.branden.robinson@gmail.com>
* src/libs/libgroff/relocate.cpp (set_current_prefix) [_WIN32]:
Move declaration of `pathextstr` to lie within preprocessor
conditional, since it is dereferenced only there.
2021-01-10 G. Branden Robinson <g.branden.robinson@gmail.com>
Add support for strsignal().
POSIX.1-2008 added strsignal() to the C library and recommended
its use over sys_siglist[], but groff's pipeline management
hadn't been updated in that respect since that time.
* configure.ac: Check for strsignal().
* src/roff/groff/pipeline.c (xstrsignal): Return strsignal() if
it is defined.
Thanks to an anonymous contributor for the report and the patch.
Fixes <https://savannah.gnu.org/bugs/?59835>.
2021-01-06 G. Branden Robinson <g.branden.robinson@gmail.com>
* src/libs/libgroff/relocate.cpp (relocatep): Add assertion to
identify logic error if `curr_prefix` is unexpectedly a null
pointer.
(set_current_prefix) [_WIN32]: Allocate memory from heap for
`curr_prefix` only on Windows; on other systems, this file's
searchpath() is used to populate `curr_prefix`, and that
function (except on Windows) performs its own allocation. Fixes
memory leak noted by Ingo Schwarze.
(set_current_prefix) [!_WIN32]: Move logic attempting to set
`curr_prefix` by calling searchpathext() from here...
[WIN32]: ...to here. The PATHEXT environment variable has
semantics only under Windows, not POSIX systems, so the
placement of this code seemed erroneous.
See <https://savannah.gnu.org/bugs/?55475>.
2021-01-06 Colin Watson <cjwatson@debian.org>
* contrib/glilypond/glilypond.pl:
* contrib/gperl/gperl.pl:
* contrib/gpinyin/gpinyin.pl:
* tmac/hyphenex.pl: Avoid Perl's unsafe "<>" operator.
The "<>" operator is implemented using the two-argument form of
"open", which interprets magic such as pipe characters, allowing
execution of arbitrary commands which is unlikely to be
expected. Perl >= 5.22 has a "<<>>" operator which avoids this,
but also forbids the use of "-" to mean the standard input,
which is a facility that the affected groff programs document.
ARGV::readonly would probably also fix this, but I fundamentally
dislike the approach of escaping data in preparation for a
language facility to unescape it, especially when the required
escaping is as non-obvious as it is here. (For the same reason,
I prefer to use subprocess invocation facilities that allow
passing the argument list as a list rather than as a string to
be interpreted by the shell.) So I've abandoned this dubious
convenience and changed the affected programs to iterate over
command-line arguments manually using the three-argument form of
open.
glilypond doesn't need the initial unshift since that's already
handled in contrib/glilypond/args.pl.
Fixes <https://savannah.gnu.org/bugs/?55557>.
2021-01-06 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/s.tmac: Set footnote line length in multi-column
environments to 11/12ths of the text line length for consistency
with earlier change to FL register default.
Thanks to T. Kurt Bond for bringing this issue to my attention.
2021-01-04 John Gardner <gardnerjohng@gmail.com>
* tmac/strip.sed: Escape '.' wildcard when matching lines using
.as and .ds requests.
Fixes <https://savannah.gnu.org/bugs/?59498>.
2021-01-04 G. Branden Robinson <g.branden.robinson@gmail.com>
Document use of SOURCE_DATE_EPOCH and TZ.
The semantics of SOURCE_DATE_EPOCH to groff were not established
with respect to time zone selection, prompting divergent
interpretations; Debian and distributions derived from it have
for several years patched groff to implicitly use UTC as the
time zone when interpreting the current time (or
SOURCE_DATE_EPOCH) as a local time. While a convenient and
defensible choice for reproducible build efforts[1], it runs
against the grain of user expectations. Systems programmers
like monotonically increasing clocks; the broader user base
usually prefers a clock that follows an applicable civil
calendar. To the latter audience, a difference between
$ date "+%Y-%M-%d %H:%m:%S"
and
$ groff <<EOF
.af year 0000
.af mo 00
.af dy 00
.af hours 00
.af minutes 00
.af seconds 00
.tm \n[year]-\n[mo]-\n[dy] \n[hours]:\n[minutes]:\n[seconds]
EOF
is difficult to explain.
* doc/groff.texi (Environment):
* src/devices/grohtml/grohtml.1.man (Environment):
* src/devices/gropdf/gropdf.1.man (Environment):
* src/devices/grops/grops.1.man (Environment):
* src/roff/groff/groff.1.man (Environment):
* src/roff/troff/troff.1.man (Environment): Expand description
of use of SOURCE_DATE_EPOCH to note that it converts the time
{as seconds since the Epoch} to local time, which motivates
documentation of the TZ environment variable. Explain what the
time stamps are used for: troff merely stores the human-readable
time components in registers; the grohtml, gropdf, and grops
output drivers write the information to the output in comments.
Fixes <https://savannah.gnu.org/bugs/?57218>.
[1] https://reproducible-builds.org/docs/source-date-epoch/
2020-12-25 G. Branden Robinson <g.branden.robinson@gmail.com>
* doc/doc.am (.texi.dvi): Call texi2dvi with FORCE_SOURCE_DATE=1
in the environment, avoiding an embedded timestamp in the
generated groff.dvi file, which frustrated reproducible builds.
Thanks to Werner Lemberg for the suggestion.
* src/roff/groff/tests/string_case_xform_unicode_escape.sh: Fix
test to no longer use Bash process substitution, resulting in
nondeterministic file descriptor numbers appearing in test logs,
frustrating reproducible builds.
* contrib/pdfmark/pdfmark.am (PDFROFF): Call pdfroff without
`--keep-temporary-files` option. Temporary directories are
created with mktemp(1) and files with an embedded process
identifier, which frustrates reproducible builds.
See <https://savannah.gnu.org/bugs/?57218>.
2020-12-21 Dorai Sitaram <ds26gte@yahoo.com>
* tmac/s.tmac (@IP): Handle inter-sentence space correctly in
paragraph tags by copying \n[.sss] from the enclosing
environment to that used to format the paragraph tag.
Fixes <https://savannah.gnu.org/bugs/?59742>.
2020-12-21 G. Branden Robinson <g.branden.robinson@gmail.com>
Add regression test for Savannah #59742.
* tmac/tests/s_IP_respects_inter-sentence_space_in_tags.sh: Do
it.
* tmac/tmac.am (tmac_TESTS): Run it.
2020-12-21 Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
* src/utils/addftinfo/addftinfo.cpp (usage): Use size_t for loop
index when iterating over a count of size_t items. Quiets
signedness mismatch compiler warning.
Fixes <https://savannah.gnu.org/bugs/?59583>.
2020-12-20 Colin Watson <cjwatson@debian.org>
* src/devices/gropdf/gropdf.pl:
* src/utils/afmtodit/afmtodit.pl: Sort Perl hash keys. Hash
iteration order may differ between runs, which makes builds
harder to reproduce. Sort hash keys in gropdf and afmtodit
output to avoid this.
2020-12-20 G. Branden Robinson <g.branden.robinson@gmail.com>
* doc/ms.ms (Basic Information): Tweak unit definitions. groff
defines a typesetter's point as precisely 1/72 inches. Also use
the correct symbol for inch units--strictly, it's the same as
that for "seconds" as in subdivisions of the degree, and not a
typographical quote of any sort.
Fixes <https://savannah.gnu.org/bugs/?59463>.
2020-12-20 G. Branden Robinson <g.branden.robinson@gmail.com>
[ms]: Set footnote line length to AT&T default.
groff ms has since its initial implementation used a default
footnote line length of 5/6ths of the text line length; this may
correspond to an early AT&T ms default (perhaps documented in
the 1974 version of the M. E. Lesk paper, "Typing Documents on
the UNIX System"[1]). However, as early as V6 Unix (1975), AT&T
ms actually used a footnote line length of 11/12ths of the text
line length instead[2].
Heirloom Doctools and neatroff ms also use this default.
* tmac/s.tmac: Set default footnote line length to 11/12ths of
the text line length.
* doc/groff.texi (ms Document Control Settings):
* doc/ms.ms (Document control registers): Document new default.
[1] https://www.troff.org/using-ms.pdf
[2] https://minnie.tuhs.org/cgi-bin/utree.pl?file=V6/usr/lib/tmac.s
2020-12-09 G. Branden Robinson <g.branden.robinson@gmail.com>
Lower new unplanted trap error to 'mac' warning.
* src/roff/troff/div.cpp (top_level_diversion::change_trap):
Change error upon invalid attempt to move an unplanted trap into
a warning of type 'mac'.
* doc/groff.texi (Warnings):
* src/roff/troff/troff.1.man (Warnings): Recast description of
'mac' warning type to include the above scenario.
Thanks to Bjarni Ingi Gislason for reporting the diagnostic
arising in real life, and to Peter Schaffter for the discussion
and recommendation. Some bike sheds get painted quickly!
Fixes <https://savannah.gnu.org/bugs/?59573>.
2020-12-05 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/groff_mdoc.7.man: Tweak mandatory macro explanations.
Update descriptions and template of .Dd, .Dt, .Os usage to
reflect recent changes and recommended conventions.
Thanks to Ingo Schwarze, Colin Watson, and Alan D. Salewski for
the discussion, and Florent Rougon and Robert Bihlmeyer (many
years ago) for the original report.
Fixes <https://bugs.debian.org/284002>.
2020-12-01 G. Branden Robinson <g.branden.robinson@gmail.com>
* src/utils/xtotroff/xtotroff.c (MapFont): Avoid writing past
the end of a static buffer. Problem found and patch supplied by
Bjarni Ingi Gislason. I tweaked it to comment it differently
{in case the buffer ever needs to grow, but the prospects of
future X11 server-side font rendering development seem dim} and
use snprintf() instead of retaining the existing sprintf().
Fixes <https://savannah.gnu.org/bugs/?55257>.
2020-12-01 G. Branden Robinson <g.branden.robinson@gmail.com>
* src/utils/xtotroff/xtotroff.c (CanonicalizeFontName,
FontNamesAmbiguous, MapFont, main): Format diagnostic messages
more consistently with GNU Coding Standards. Prefix with name
of complaining command. Put argument literals in quotation
marks. Put each messge on one line only.
2020-11-28 G. Branden Robinson <g.branden.robinson@gmail.com>
* doc/groff.texi (Parameters): Fix error in example. Arguments
to .als were in the wrong order (.als is not ln(1)). Also mark
output to the standard error stream using the @error Texinfo
command instead of @result.
Thanks to Dorai Sitaram for finding this error.
Fixes <https://savannah.gnu.org/bugs/?59566>.
2020-11-28 G. Branden Robinson <g.branden.robinson@gmail.com>
* doc/groff.texi (Debugging): Update with a more helpful
introduction, summarizing available procedures. Mention
backtracing since it is much more useful now (post-groff
1.22.4.)
* man/groff.7 (Debugging): Add new section summarizing
material added to our Texinfo manual.
* man/groff_diff.7.man (Debugging): Add new section describing
groff extensions.
2020-11-22 G. Branden Robinson <g.branden.robinson@gmail.com>
* doc/groff.texi (Traps): Update. Organize subsubsections "Page
Location Traps" and "Diversion Traps" under new subsection node
"Vertical Position Traps" to make the conceptual organization
more clear. Define and discuss trap visibility earlier.
Document unit used for page location trap reporting. Introduce
analogy of .wh and .ch requests as queue operations. Document
what happens when the same macro is planted as a trap in
multiple locations; supply example. Supply example of .itc
usage. Consistently refer to an end-of-input macro as such, to
contrast it with the "end macro" that can be used with, e.g.,
.de and .ig requests.
* man/groff.7 (Traps): Add new section summarizing
language feature.
2020-11-18 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/mdoc/doc-common-u (doc-footer): When performing
double-sided page layout, set page number on outside of _recto_
{odd-numbered} pages, as is conventional and for consistency
with man(7).
* tmac/groff_mdoc.7.man
(Formatting with groff, troff, and nroff): Document what
double-sided layout (not "printing") means. Also correct
description of continuous rendering, which implied that page
headers and footers were not written at all, and used an
incorrect groff driver name.
Fixes <https://bugs.debian.org/919890>. Also see:
https://lists.gnu.org/archive/html/groff/2019-01/msg00021.html
Thanks to Ralph Corderoy for the discussion.
* tmac/tests/doc-D_places_page_numbers_correctly.sh: Test it.
* tmac/tmac.am (tmac_TESTS): Run test.
2020-11-18 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/mdoc/doc-common-u (doc-header): Fix infinite loop when
attempting to trim header string (like "FTP(1)") to fit when the
available title length won't allow even extreme shortening.
Measure the string before and after calling .substring on it,
and break out of loop if it didn't get shorter.
Problem dates back to at least
ed63b0ae76a611b581601a1afc192f6a7367be6f (7 July 2002), possibly
as far as the Great Mdoc Rewrite of
058f72af832fc68488d33cd09ec819e5c560fa09 (23 March 2001).
One can never check loop invariants too many times...
Fixes <https://bugs.debian.org/411227>.
* tmac/tests/\
doc-do_not_loop_infinitely_when_shortening_headers.sh: Test it.
* tmac/tmac.am (tmac_TESTS): Run test.
2020-11-18 G. Branden Robinson <g.branden.robinson@gmail.com>
* src/roff/nroff/nroff.sh: Recognize -b and -z options and pass
them through to troff. Document them in usage message.
* src/roff/nroff/nroff.1.man: Document new -b and -z options.
2020-11-17 G. Branden Robinson <g.branden.robinson@gmail.com>
* src/roff/troff/div.cpp (top_level_diversion::change_trap):
Emit error diagnostic if an attempt is made to move an unplanted
macro. This could have been a warning, as it's pretty harmless
{though possibly a big surprise to anyone who was wondering why
their .ch was a no-op}, but there's no good warning category for
this kind of problem and I am not about to start a bike shed
discussion about it right now.
2020-11-15 G. Branden Robinson <g.branden.robinson@gmail.com>
* doc/groff.texi: Update. Add introductory material. Rewrite
the first section of the "gtroff Reference" chapter of our
Texinfo manual. It is written as an introduction for readers
who want to go straight to "raw" troff without knowing much or
anything about existing macro packages. Thanks to Dave Kemper
and John Gardner for feedback and support.
Clarify whitespace usage. "Whitespace" is defined in this
manual as "spaces, tabs, and newlines". Say only "spaces and
tabs" when newlines should not be included.
Rename "Font Files" to "Device and Font Files".
Rename "Manipulating Filling and Adjusting" to "Manipulating
Filling and Adjustment".
Update discussion of "copy mode". Rename from "copy-in mode",
which I don't think eludicdated anything; is there a "copy-out
mode"? Rename nodes accordingly. Attempt to explain more
clearly. Recast to shift emphasis to what _isn't_ merely copied
in copy mode, since that is what seems to cause confusion among
the inexperienced.
Update "Conditionals and Loops". Add introductory paragraph.
Add nodes/subsections "if-then" and "Conditional Blocks". Add
subsection "Conditional Blocks" to explain the behavior of the
\{ and \} escapes much more precisely. I don't think this
syntactical area is well understood. Supply examples.
2020-11-14 G. Branden Robinson <g.branden.robinson@gmail.com>
Add style checks to man(7) macro package.
Not otherwise documented yet; experimental--subject to change.
* tmac/an-old.tmac: Initialize CHECKSTYLE to false if not
already set.
(an-style-warn): New macro emits diagnostic of type "style" when
called if CHECKSTYLE register is true.
(TH): Call an-style-warn if fewer than two or more than five
arguments are seen.
(RI, IR, IB, BI, RB, BR): Call an-style-warn if fewer than two
arguments are seen.
2020-11-11 Bertrand Garrigues <bertrand.garrigues@laposte.net>
Update copyright.
* update-copyright.sh: use gnulib's 'update-copyright' script.
Pass this script in directories 'arch', 'contrib', 'font',
'man', 'tmac', 'src' and on a list of extra files.
* FOR-RELEASE: mention this point.
2020-11-11 G. Branden Robinson <g.branden.robinson@gmail.com>
* src/preproc/preconv/preconv.1.man (Description): Fix error:
groff's -K option, not -k, specifies a character econding (and
overrides GROFF_ENCODING in the environment). Also explain how
valid encoding strings are determined.
Thanks to Bjarni Ingi Gislason for the report.
Fixes <https://savannah.gnu.org/bugs/?59445>.
2020-11-11 G. Branden Robinson <g.branden.robinson@gmail.com>
* src/preproc/tbl/table.cpp (table::compute_separation_factor):
Add word "table" to diagnostic message to better cue the user
that it is produced by roff that has been injected into the
document by the tbl(1) preprocessor. The other 3 such possible
diagnostic messages already do this. Thanks to Bjarni Ingi
Gislason for bringing the inconsistency to light.
Fixes <https://savannah.gnu.org/bugs/?59443>.
2020-11-07 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/groff_mdoc.7.man (Predefined strings): Ensure the table
fits even on ASCII and Latin-1 terminals. Thanks to Bjarni Ingi
Gislason for the report.
Fixes <https://savannah.gnu.org/bugs/?59424>.
2020-11-01 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/groff_mdoc.7.man (General text domain/Enclosure and
Quoting Macros): Fix errors in macro descriptions.
<.Dq>: Encloses its arguments in directional double quotes where
available.
<.Eq>: Misrendered example; say "XstringY" rather than
"XXstring".
<.Sq>: Encloses its arguments in directional single quotes where
available.
2020-10-31 G. Branden Robinson <g.branden.robinson@gmail.com>
Add support for CS and CT registers to mdoc(7), just like in
man(7), from a year ago.
* tmac/doc.tmac-u (doc-print-recursive): Call .stringup on each
argument if register doc-do-capitalize is true.
* tmac/mdoc/doc-common-u (Dt): Call .stringup on
doc-document-title if \n[CT] is true.
(Sh): Set doc-do-capitalize to value of \n[CS]. Set
doc-do-capitalize false before returning.
* tmac/mdoc/doc-ditroff-u:
* tmac/mdoc/doc-nroff-u: Set CS and CT registers to 0 (false)
if the user has not defined them.
* tmac/groff_mdoc.7.man \
(Formatting with groff, troff, and nroff): Document it.
* tmac/tests/doc-CS_works.sh:
* tmac/tests/doc-CT_works.sh: Test it.
* tmac/tmac.am (tmac_TESTS): Run tests.
2020-10-31 G. Branden Robinson <g.branden.robinson@gmail.com>
* src/roff/troff/input.cpp (do_overstrike, do_bracket,
do_name_test, do_expr_test, do_zero_width, do_width, do_special,
do_if_request, read_color_draw_note): Improve diagnostic
messages for missing closing delimiters by describing the
incomplete structure and the problem token.
(read_rgb, read_cmy, read_cmyk, read_gray): Improve English
syntax of diagnostic message when color definition missing.
2020-10-31 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/mdoc/doc-ditroff-u:
* tmac/mdoc/doc-nroff-u: Recognize but ignore the groff_man(7)
string HF and registers FT, IN, P, SN, and X (by initializing
them empty or zero if they are not set). This reserves them so
that they don't become used for divergent purposes. man(1)
programs set these and other parameters already handled (like
LL) to configure page rendering, and it would break the
macro-package agnosticism afforded by andoc.tmac to expose
different externally-programmable registers and strings.
* tmac/groff_mdoc.7.man \
(Formatting with groff, troff, and nroff): Document this.
2020-10-31 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/s.tmac: Implement \*< and \*> strings for subscripting.
groff ms has had (extension) strings for superscripting since
1991 at the latest, and the asymmetry possessed me of a madness.
Both pairs of string names follow similar usage in Eric Allman's
"me" macros.
* NEWS:
* doc/groff.texi:
* tmac/groff_ms.7.man: Document it.
2020-10-31 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/groff_mdoc.7.man (Predefined strings): Fix error: the
\*[Lq] and \*[Rq] strings degrade to neutral double quotes (")
on "nroff" devices (-Tascii and -Tlatin1), not "``" and "''".
2020-10-31 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/s.tmac (ds*end!0): Improve diagnostic to mention .RD.
2020-10-30 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/s.tmac: Revise diagnostic messages. Define a common
prefix string, starting all such messages with "s.tmac".
Continues the long process of fixing Savannah #52463. Drop the
word "macro" from diagnostic since this will now be clear from
the prefix. Prefix every macro name in a diagnostic message
with a leading dot; this was already done in four cases.
(cov*first-page-init): Use temporary string to avoid multi-line
diagnostic message.
(@NH): Use temporary string to prevent overlength line.
A further benefit of this revision is that index information
produced by ms's .IX macro (which writes to the standard error
stream) will now be trivially easy to extract even for documents
that cause diagnostic messages. One can simply filter them with
grep -v '^s\.tmac:'
or similar.
2020-10-28 Ingo Schwarze <schwarze@openbsd.org>
* man/roff.7.man, tmac/groff_man.7.man.in: Correct man(7)
history.
2020-10-26 G. Branden Robinson <g.branden.robinson@gmail.com>
Fix ms .R macro to work as documented, by handling its arguments
instead of ignoring them.
* tmac/s.tmac (R): Delete. During set up, call
par*define-font-macro for R font just as we do for B, I, and BI.
Problem dates back at least to groff 1.02, June 1991.
* tmac/tests/s_R-handles-its-arguments.sh: Test it.
* tmac/tmac.am (tmac_TESTS): Run test.
Fixes <https://savannah.gnu.org/bugs/?59348>.
2020-10-25 G. Branden Robinson <g.branden.robinson@gmail.com>
Fix ms .TC macro by allowing it to actually use lowercase Roman
numerals for the page(s) of the table of contents when a custom
title (header or footer) is defined containing '%'.
As a side effect, eliminate the PN register, which was
apparently misused because it was undocumented and had a name
just long enough to be both suggestive and ambiguous. Another
pin goes into my Ken Thompson voodoo doll.
* tmac/s.tmac (IX): Write out page number of index term(s) using
the % register (instead of PN), obtaining whatever format is
assigned to the register at that time.
(CH): Similarly, output %, not PN, in the center of the default
heading.
(PT): Save the format of %, set it to decimal, copy its value to
a new register, pg*page-number-in-decimal, then restore %'s
previous format. Compare the new register, not %, to 1 to
determine whether special page one behavior should be used.
(pg*end-page): Assign pg*next-format to %, not PN.
(XA): Define toc*num with the interpolation of %, not PN.
* tmac/tests/s_TC-works-with-percent-in-custom-titles.sh: Test.
* tmac/tmac.am (tmac_TESTS): Run test.
Problem appears to be very old; as I read it, Larry Kollar was
complaining of it in his ms.ms document over 20 years ago.
Fixes <https://savannah.gnu.org/bugs/?59345>.
2020-10-25 G. Branden Robinson <g.branden.robinson@gmail.com>
* man/groff.7 (Requests/Request short reference) <.af>: Fix
error; "l" is not a valid register format. Explain what the
request does, and the default format, as tersely as possible.
2020-10-22 G. Branden Robinson <g.branden.robinson@gmail.com>
Use only malloc() and free() to manage memory of paths opened by
the parser instead of mixing in C++ new/delete management under
some runtime-dependent circumstances.
* src/libs/libgroff/relocate.cpp (relocatep): Use malloc(), not
new.
* src/roff/troff/input.cpp (process_macro_file,
process_startup_file, macro_source): Use free(), not (a_)delete.
Thanks to an anonymous contributor for the report and patch.
Fixes <https://savannah.gnu.org/bugs/index.php?56694>.
2020-10-22 G. Branden Robinson <g.branden.robinson@gmail.com>
* man/groff_char.7.man (Description/Special character escape
forms): Clarify discussion of Unicode Normalization Form D and
its applicability to code points acceptable in Unicode numeric
special character escapes. Also document that these escapes
must use uppercase hexadecimal digits.
Attempts once again to slay the unkillable beast that is
<https://savannah.gnu.org/bugs/index.php?57618>.
2020-10-21 Ingo Schwarze <schwarze@openbsd.org>
On systems without NAME_MAX, use FILENAME_MAX as a last resort.
Problem reported by Eli Zaretskii <eliz at gnu dot org>
on MS Windows in https://savannah.gnu.org/bugs/?55449
2020-10-20 G. Branden Robinson <g.branden.robinson@gmail.com>
* src/roff/troff/env.cpp (environment::possibly_break_line):
Emit break warning and return if the output width is not
positive. The code assumes that it will be and loops infinitely
if it isn't. I _think_ this is because we're not able to get
width data for (some?) CJK glyphs. Based on a patch by Osamu
Sayama.
* src/roff/groff/tests/\
do_not_loop_infinitely_when_breaking_cjk.sh: Test it.
* src/roff/groff/groff.am: Run test.
Fixes <https://savannah.gnu.org/bugs/index.php?44018>.
2020-10-20 G. Branden Robinson <g.branden.robinson@gmail.com>
* src/preproc/tbl/table.cpp (table::init_output): Save the value
of \n[.tabs] when starting a table. In the reset macro, restore
the saved value.
Based on a patch by Bjarni Ingi Gislason (tweaked to use a more
normative preprocessor symbol; "REG"s aren't "NAME"s).
* src/preproc/tbl/tests/save-and-restore-tab-stops.sh: Test it.
* src/preproc/tbl/tbl.am (tbl_TESTS): Run test.
Fixes <https://savannah.gnu.org/bugs/index.php?42978>.
2020-10-20 G. Branden Robinson <g.branden.robinson@gmail.com>
* src/roff/nroff/nroff.sh: Recognize -E option and pass it
through to troff. Document it in usage message.
* src/roff/nroff/nroff.1.man: Document new -E option.
Based on a patch by Ingo Schwarze.
Fixes <https://savannah.gnu.org/bugs/index.php?44289>.
2020-10-18 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/an-old.tmac: Stop remapping ` and '. Our own pages now
appear to be clear of wrong-quote problems, so let's make them
visible if they recur. Those who don't want to fix bad man
pages (distributors, site admins) can restore the mappings in
their man.local files.
2020-10-18 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/an-old.tmac (an-warn): New; emits warning diagnostic.
(R): Use new macro instead of .tm* requests directly.
2020-10-18 Ingo Schwarze <schwarze@openbsd.org>
#include "config.h" before <stdio.h>
Required with e.g. gcc 4.2.1 because gnulib/lib/stdio.in.h
uses the "restrict" keyword since this gnulib commit:
commit 182afcba2635cbff91240656c7fb3742dd23ab6f
Author: Bruno Haible <bruno@clisp.org>
Date: Sat Feb 22 20:57:30 2020 +0100
Otherwise, the build may die from the declaration of
various printf-like functions with messages like:
./lib/stdio.h:851: error: expected ',' or '...' before 'fp'
* src/libs/libgroff/assert.cpp, src/libs/libgroff/errarg.cpp,
src/libs/libgroff/error.cpp, src/preproc/eqn/eqn.ypp:
#include "config.h".
2020-10-18 Bertrand Garrigues <bertrand.garrigues@laposte.net>
hpftodit: incorrect 'delete' after new[]
* src/utils/hpftodit/hpftodit.cpp (output_font_name): use
'delete[]'.
Fixes bug #55331. Found by David Binderman, fixed by Ingo
Schwarze.
2020-10-18 Bertrand Garrigues <bertrand.garrigues@laposte.net>
preconv: don't use libuchardet if input is stdin
* src/preproc/preconv/preconv.cpp (do_file): don't call
detect_file_encoding if input file is "-"
This fixes the failure on MS-Windows described #55334, however
this does not fix the encoding detection with uchardet if the
input is stdin (the user would have to pass with -D the correct
encoding as explained in the man page).
2020-10-17 G. Branden Robinson <g.branden.robinson@gmail.com>
* src/preproc/eqn/lex.cpp (troff_defs): Set the "..." token on
the baseline, not vertically centered, aligning the actual
behavior with what our eqn(1) man page has claimed since 2007.
Fixes <https://savannah.gnu.org/bugs/index.php?59285>.
2020-10-17 G. Branden Robinson <g.branden.robinson@gmail.com>
* src/devices/grops/grops.1.man
(Usage/TrueType and other font formats): Remove dead URL to
ttftot42 utility. Update URL to fontforge tool. Replace much
of the discussion with an example, motivated by Jordan Torbiak's
"groff-install-font" script on GitHub Gist, of how to add the
Roboto Slab Regular font to a user-local groff font directory
{and how to test it, too}.
Fixes <https://savannah.gnu.org/bugs/index.php?58077>.
2020-10-17 G. Branden Robinson <g.branden.robinson@gmail.com>
* src/utils/afmtodit/afmtodit.pl: Report program name in warning
diagnostics.
Continues the long process of fixing Savannah #52463.
2020-10-17 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/an-old.tmac: Add fallback for lq, rq strings.
Define \*(lq and \*(rq as '"' if the output device has no \(lq
or \(rq special character escapes defined (respectively).
This is a bit belt-and-suspenders for groff since our output
devices all guarantee availability of these glyphs, but if this
macro file gets used with other implementations (and if they
support the 'c' conditional), it should prevent the strings from
producing empty output.
Man page writers should simply use \(lq and \(rq unless they are
aiming for pathological levels of portability (e.g., composing
man pages today for consumption on simulators of 1980s Unix
systems).
2020-10-16 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/an-old.tmac: Define an-end with .de1. We need to define
an-end with de1 (execute macro with compatibility mode off)
because, as of 37b4180a27a6eeaea429e40ec278abefcda7f3a7 (11
October), it can now be called from a trap executing in a
context whence compatibility mode might be on (namely,
"reload-doc" in andoc.tmac).
2020-10-16 G. Branden Robinson <g.branden.robinson@gmail.com>
* src/preproc/eqn/main.cpp (main):
* src/preproc/pic/main.cpp (main):
* src/preproc/tbl/main.cpp (main):
* tmac/eqnrc:
* tmac/troffrc: Perform checks of register and macro definitions
with a .do request, since we might be in compatibilty mode.
2020-10-16 G. Branden Robinson <g.branden.robinson@gmail.com>
* src/roff/troff/input.cpp (do_if_request): Emit warning of type
"syntax" if a groff conditional expression extension is used
when compatibility mode is active.
* doc/groff.texi:
* src/roff/troff/troff.1.man: Update description of "syntax"
warning type to be more general. It was inaccurate, referring
only to "dubious syntax in numeric expressions", which was not
the case. Instead it was being used only for poor construction
of character classes with the .class request.
2020-10-16 G. Branden Robinson <g.branden.robinson@gmail.com>
* src/preproc/tbl/main.cpp (main): Stop ignoring -T. GNU tbl
was undocumentedly ignoring the -T option; apparently IRIX tbl
implemented it, something on the system called tbl with that
option (I'm guessing IRIX's man(1)) and its users spammed James
Clark with bug reports. We can probably weather the volume of
such spurious reports from IRIX users today.
2020-10-16 G. Branden Robinson <g.branden.robinson@gmail.com>
* src/preproc/tbl/main.cpp (main): Clarify fatal diagnostic in
generated document by informing the user that the program is
aborting, and also that it is groff extensions that are required
rather than GNU troff per se (since Heirloom Doctools troff
claims groff extension support via the .g register).
2020-10-14 Ingo Schwarze <schwarze@openbsd.org>
In groff(1), fix the combination of -v with -k, -j, and -J.
* src/roff/groff/groff.cpp: Pass the -v option through to the
preconv, chem, and ideal preprocessors, just like for all
other preprocessors, to print the version of the preprocessor
and to avoid garbage output.
Bugfix patch from Eli Zaretskii <eliz at gnu dot org>
submitted in: https://savannah.gnu.org/bugs/?55297
2020-10-12 Bertrand Garrigues <bertrand.garrigues@laposte.net>
Update 'gnulib' submodule.
* gnulib: now points on d60a35e94c4f5b8f09f15828242418f5073d46e7
from 'gnulib' repository.
* configure.ac: minimum autoconf version is now 2.64 due to
gnulib upgrade.
* FOR-RELEASE: add the gnulib update to the checklist.
2020-10-11 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/andoc.tmac: When switching between macro packages in
andoc and using continuous-rendering mode, flush any partially
collected output line and write page footer.
(reload-doc): Call an-end if it is defined.
(reload-man): Call doc-end-macro if it is defined.
* tmac/tests/andoc-flush-between-packages.sh: Add regression
test.
* tmac/tmac.am (tmac_TESTS): Run test.
Fixes <https://savannah.gnu.org/bugs/index.php?59106>.
2020-10-11 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/andoc.tmac: Remove traps set by mdoc package by the names
they actually use.
* tmac/tests/andoc-clear-doc-traps.sh: Add regression test.
* tmac/tmac.am (tmac_TESTS): Run test.
Fixes <https://savannah.gnu.org/bugs/index.php?59246>.
2020-10-10 G. Branden Robinson <g.branden.robinson@gmail.com>
* src/preproc/tbl/table.cpp (table::init_output): In the release
macro written to the output, reword the warning diagnostic that
is emitted when a table row is to be output without enough room
before the next page location trap. The former wording said
that a "text block" would not fit on the page, and that is
normally how table rows grow longer than one line in the first
place. However, there are other ways the conditional can be
satisfied, as witnessed in Savannah #57665, so simply say what
is known; that the table _row_ overruns the space to the next
trap (we say the row won't "fit on [the] page").
Fixes <https://savannah.gnu.org/bugs/index.php?59233>.
2020-10-10 G. Branden Robinson <g.branden.robinson@gmail.com>
* src/preproc/tbl/table.cpp
(double_line_entry::double_line_entry):
(double_line_entry::simple_print): Remove garbage lines
inadvertently added in previous commit.
2020-10-09 G. Branden Robinson <g.branden.robinson@gmail.com>
Stop tbl from injecting spurious blank lines (and emitting
spurious warnings about tables and "text blocks" not "fitting on
a page") into long tables in man pages when continuous rendering
is used (the default for nroff output devices).
* src/preproc/tbl/table.cpp (USE_KEEPS_REG): New preprocessor
symbol stores name of groff register for dynamic determination
of keep usage.
(table::init_output): If the NOKEEP flag is not set, then in
generated groff output, see if the usekeeps register is defined;
if not, define it and enable usage of keeps.
(table::do_row): In groff output, check usekeeps register before
calling keep and release macros.
(table::do_bottom): In groff output, check usekeeps register
before calling release macro.
* tmac/an-old.tmac (TS): Set the usekeeps register used by tbl
to the logical complement of the man(7) cR (continuous
rendering) register.
* tmac/tests/an-old_TS_do_not_keep_tables_when_cR_set.sh: Add
regression test.
* tmac/tmac.am (tmac_TESTS): Run test.
Problem appears to date back to the introduction of continuous
rendering in groff 1.17 (3 May 2001).
Fixes <https://savannah.gnu.org/bugs/index.php?57665>.
2020-10-09 G. Branden Robinson <g.branden.robinson@gmail.com>
* src/preproc/tbl/table.cpp (simple_entry::position_vertically):
(block_entry::position_vertically):
(table::determine_row_type):
(printfs): Update assertions to indicate what actually went
wrong.
2020-10-02 G. Branden Robinson <g.branden.robinson@gmail.com>
* src/roff/troff/node.cpp: Make diagnostics slightly more
informative in unusual error cases.
(real_output_file::~real_output_file): If ferror() reports error
status on a stream say that, instead of "error writing". If it
does not, but fflush() fails on the stream, describe the flush
as failing, and use strerror() since fflush() sets errno. If
pclose() fails, say that we were unable to close a pipe instead
of repeating the name of the C library function to the user, who
might not be a C programmer. Report strerror() in this case and
for a failing fclose().
(real_output_file::flush): Repeat updated fflush() logic from
previous function.
2020-09-30 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/an-old.tmac (register setup): Make interaction of \n[C]
register and HTML output more clear in code and comments.
2020-09-30 G. Branden Robinson <g.branden.robinson@gmail.com>
* src/roff/groff/tests/regression_savannah_59202.sh: Reduce test
case.
2020-09-29 G. Branden Robinson <g.branden.robinson@gmail.com>
Fix SEGV arising from recursing destructor.
* src/roff/troff/node.h (output_file): Add class member
`is_dying` to track whether destructor has already been entered;
initialize false.
* src/roff/troff/node.cpp (real_output_file::~real_output_file):
Set `is_dying` true when destructor entered.
* src/roff/troff/div.cpp (cleanup_and_exit): Only delete
`the_output` object if it is not already being destroyed.
* src/roff/groff/tests/regression_savannah_59202.sh: Add test.
* src/roff/groff/groff.am (groff_TESTS): Run test.
Thanks to "hackerb9" for reporting the problem. Problem appears
to date back to groff 1.02 (June 1991) or earlier.
Fixes <https://savannah.gnu.org/bugs/index.php?59202>.
2020-09-28 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/an-old.tmac (register setup): Condition decisions on
\n[an-html] rather than a string comparison using \*[.T]; that
is what the register is there for.
2020-09-28 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/andoc.tmac: Save alias to .ne request.
(reload-doc): Restore .ne request, which an-old.tmac meddles
with if continuous rendering is used. (The meddling ultimately
dates back to 777e2d262862621966c18d685a000cc88f432bc6, 26
January 2002, which simply redefined .ne as empty on nroff
devices.)
2020-09-27 G. Branden Robinson <g.branden.robinson@gmail.com>
Ship tests in distribution archive.
* src/preproc/preconv/preconv.am (EXTRA_DIST):
* src/roff/groff/groff.am (EXTRA_DIST):
* src/roff/nroff/nroff.am (EXTRA_DIST):
* tmac/tmac.am (EXTRA_DIST): Add
$({preconv,groff,nroff,tmac}_TESTS), as appropriate.
* src/roff/nroff/nroff.am (MOSTLYCLEANFILES): Stop adding
$(nroff_TESTS), which can only have unhappy consequences.
2020-09-27 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/tmac.am: Fix problem with recently-relocated mdoc macro
files not ending up in the right place in the distribution
archive.
(dist_tmac_DATA): Also include $(TMACUNSTRIPFILES).
(TMACMDOCSTRIPFILES): Rename from $(TMACMDOCFILES). Update
interpolation sites.
(TMACMDOCUNSTRIPFILES): New variable holds mdoc macro files in
the tmac/mdoc subdirectory. Stop adding these files to
$(TMACUNSTRIPFILES) since those reside in tmac/ directly.
(EXTRA_DIST): Add $(TMACMDOCUNSTRIPFILES).
($(TMACSTRIPFILES)): Depend only on $(TMACUNSTRIPFILES).
($(TMACMDOCSTRIPFILES)): Add new rule, much like the foregoing.
Depend on $(TMACMDOCUNSTRIPFILES) and copy files into tmac/mdoc.
(dist-hook, tmac-dist-hook): Remove; they no longer do any
distinct work.
Fixes <https://savannah.gnu.org/bugs/index.php?59186>.
2020-09-26 G. Branden Robinson <g.branden.robinson@gmail.com>
* src/preproc/tbl/table.cpp (table::init_output):
(table::compute_expand_width):
(table::compute_separation_factor): Use consistent format for
diagnostic messages.
- Do not spread a single diagnostic across multiple lines.
- Report messages in GNU Coding Standards format, that is:
- Report the name of the file the problem is in...
- ...then the line number...
- ...then the diagnostic severity level...
- ...then the specific problem.
2020-09-26 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/an-old.tmac: Emit warnings when configuration registers
are ignored when producing output for HTML.
2020-09-25 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/an-old.tmac (an-p-footer): Define \*[an-page-string] if
(1) the output device is not HTML; (2) \n[X] has been defined;
and (3) the page number has not yet reached the threshold
defined by \n[X].
Fixes <https://savannah.gnu.org/bugs/index.php?59179>.
2020-09-25 G. Branden Robinson <g.branden.robinson@gmail.com>
Add regression test for Savannah #59179.
* tmac/tests/an-old_X_register_works.sh: Do it.
* tmac/tmac.am (tmac_TESTS): Run it.
2020-09-25 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/an-old.tmac:
* tmac/doc.tmac-u: Emit more informative fatal diagnostic when
installed version of groff is too old. Report the version found
and explicitly note consequent abort.
2020-09-25 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/tmac.am: Regenerate stripped macro files upon changes to
any of their unstripped counterparts. This is crude, but they
weren't being regenerated at _all_. Defeating a central
function of Make is bad.
(TMACUNSTRIPFILES): New variable. Populate with -u files.
($(TMACMDOCFILES) $(TMACSTRIPFILES)): Depend on
$(TMACUNSTRIPFILES).
2020-09-25 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/an-old.tmac:
* tmac/andoc.tmac:
* tmac/doc.tmac-u:
* tmac/s.tmac: Clarify fatal diagnostics by informing the user
that the program is aborting.
2020-09-25 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/www.tmac.in: Revise diagnostic message handling.
(www:fatal): New macro handles fatal macro usage errors.
(www:lenstr): Use www:fatal instead of writing to standard error
with .tm (rather than www:error) and then calling .ab without
arguments, which produces an unsightly "User Abort." message.
(www:lenstr):
(www:splitstr):
(www:url_breaks):
(www:url_breaks_split):
(LINKSTYLE): Report expected number of arguments in diagnostics.
(www:fontstyle): Shorten diagnostic message.
2020-09-25 G. Branden Robinson <g.branden.robinson@gmail.com>
* src/roff/troff/div.cpp
(top_level_diversion::clear_diversion_trap): Fix copy and paste
error in diagnostic, which wrongly reported that a top-level
diversion trap couldn't be "set" when "clear"ed was meant.
2020-09-19 G. Branden Robinson <g.branden.robinson@gmail.com>
* src/preproc/grn/main.cpp (conv):
* src/roff/troff/node.cpp (suppress_node::tprint): Remove
embedded newlines from diagnostic messages.
2020-09-18 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/an-old.tmac: Move setup of remaining rendering option
parameters (registers C, D, P, and X) to end of file.
2020-09-17 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/an-old.tmac (TH): Move setup of rendering parameter
registers IN and SN from here to the end of the file. Update
comments.
2020-09-17 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/an-old.tmac: Drop \*[an-empty] string. This string is
documented as preventing "looping" (presumably infinitely) if
someone calls a two-font macro with an inconvenient parameter;
the example shown is ".RB ( \\ )". This string was being
interpolated at the end of each argument pair to the two-font
macros BI, BR, IB, RB, and RI. This code dates back to groff
1.10 (dc5351364982f78f8c630f1e856d692d4a82666f, 26 November
1995). Did you notice a two-font macro missing? It was: IR.
Using it with the proscribed input fails to cause a problem; the
others similarly operate just fine when the empty string
interpolation is removed. Presumably at some point in the past
25 years, this workaround became unnecessary.
(BI, BR, IB, RB, RI): Remove interpolations of string.
* tmac/tests/an-old_avoid_two-font_denial_of_service.sh: Add
regression test.
* tmac/tmac.am (tmac_TESTS): Run test.
2020-09-16 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/an-old.tmac: Refactor continuous rendering handling.
Relocate set up of \n[cR] to end of file in parallel with other
rendering parameter management. Instead of conditionally
defining the an-ne and an-bp macros, define them
unconditionally. Also define them with .de instead of .de1,
since they will only be called within the contexts of macros
that are already running with compatibility mode off (i.e., the
public interface macros). Relocate definition of an-end to sit
alongside these other continuous-rendering-mode specific macros
and avoid a forward reference and scattering of \n[cR]
conditionals around the file.
(an-set-up-continuous-rendering): Define new macro to move
macros (and end macro) into place. Call it at the end of the
file only if cR eventually winds up being true.
2020-09-16 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/an-old.tmac: Improve name space management. Rename .ne
request to .an-ne instead of outright clobbering it (and in
parallel with .an-bp). Rename 'an-ne' register to 'an-need' to
prevent confusion with renamed request.
2020-09-16 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/an-old.tmac: Drop .ll hack for LL register.
Drop the .ll hack for setting the line length on nroff devices.
Once upon a time, the only way to get man pages to render on a
terminal at any width other than the nroff default of 65n was to
put an .ll request into the page--a mortal sin against
portability--or your man(1) program could sneak such a request
into nroff's input stream.
Also, long ago, John Eaton of UT Austin wrote a man(1) program.
In a few years this implementation branched into two lines of
development, which I'll call man-db man (Wilford/Polacco/Watson)
and another, Brouwer/Lucifredi man, which as of this writing saw
its last release in 2011 (1.6g).
The man and mdoc macros of groff 1.18 (July 2002) introduced an
LL register to configure the line length, respecting an -rLL
command-line option. The source change was made by Werner
Lemberg on 3 May 2002 and Colin Watson updated man-db man(1)--on
the same day!--to synthesize the option when calling groff.
Later, in August 2005, Keith Marshall, a user of vesion 1.5m of
Brouwer/Lucifredi man(1), which did not set the LL register,
suggested that the existing .ll setting (technically, the value
of \n[.l], the only way the result of an .ll request could be
introspected) be honored in the absence of the LL register.
However, it is impossible to distinguish a user-supplied ".ll
65n" request from nroff's default setting, which was in that
case overridden to the modern default of 78n.
And so, in what is now git commit
f9d5df4aebd3d834b4084ffefa52a115e00dce38 (1 September 2005), it
was done.
This led to (1) surprising behavior for users accustomed to old
methods and desirous of the nroff default and (2) lengthy
apologia in groff source code comments and the groff_man(7) man
page.
Ironically, Brouwer/Lucifredi man(1) had already added support
for the LL register by the time of its 1.6 release two months
earlier (20 June 2005). (Curiously, it did so similarly to the
old .ll hack, by injecting an '.nr LL' request into groff's
input stream, rather than using the -r command-line option.)
Moreover, Marshall and the groff list were already aware of
this, but the change was accepted anyway because version 1.6
was "too new"! (Distributions are slow sometimes, true...)
Let us survey the field in 2020. man-db man(1) has supported
the LL register for eighteen years, and Brouwer/Lucifredi man(1)
for fifteen. Heirloom Doctools's man macros set the line length
to 78n on nroff devices unconditionally. mandoc(1) similarly
also always formats for 78 columns on terminals. groff's
mdoc(7) macros grew support for LL in parallel with man(7) in
2002 and never added the \n[.l] introspection at all.
There no longer seems to be any reason to preserve this hack.
* tmac/an-old.tmac (initialization): Drop complex setup of LL
register.
(TH): Relocate line length reset; no behavior change.
(after .mso man.local): Initialize LL only if the user hasn't;
use device default in troff mode, and 78n in nroff mode.
* tmac/groff_man.7.man.in (Options) <-rLL>: Stop documenting .ll
hack.
Fixes <https://savannah.gnu.org/bugs/index.php?58992>.
2020-09-16 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/tests/an-old_LL_init_sanely.sh: Add test.
* tmac/tmac.am (tmac_TESTS): Run test.
2020-09-15 G. Branden Robinson <g.branden.robinson@gmail.com>
* src/devices/xditview/GXditview.ad: Widen the default geometry
to accommodate the width of a page rendered using the X100-12
device. Display devices these days have much greater horizontal
resolution than they did 20 years ago.
2020-09-14 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/an-old.tmac: Use correct point size default for
X{75,100}-12 devices.
2020-09-14 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/mdoc/doc-common-u (doc-prepare-section-heading): New
macro defines new string doc-sec-head to enable recognition of
mixed-case section headings in mdoc man pages. For example,
"Name" and "Description" are now recognized in addition to
"NAME" and "DESCRIPTION".
(doc-section-{name,synopsis,library,description,see-also,files,
authors}): Redefine strings to be mixed-case. Add trailing
comment guard per recommended best practice.
(Sh): Call doc-prepare-section-heading instead of
doc-first-parameter, and compare predefined section strings to
doc-sec-head instead of doc-str-dfp.
* tmac/tests/doc-accept-mixed-case-section-headings.sh: Test it.
* tmac/tmac.am (tmac_TESTS): Run test.
* tmac/tests/doc-smoke-test.sh: Use mixed-case section headings.
2020-09-03 G. Branden Robinson <g.branden.robinson@gmail.com>
* makevarescape.sed: Use \[] form of special character escapes.
The only man page we have that doesn't turn compatibility mode
off (neqn) also doesn't use any sed-substituted patterns where
characters replaced by a \[] special character escape form are
likely to be used.
The @g@ command prefix is the main avenue for intrusion of such
escapes, but I think it improbable that many people are going to
include apostrophes, double quotes, carets, grave accents, or
tildes in the command prefix; some or all of these will pick
fights with the shell and require quoting that we don't
represent in man page text anyway.
On top of that, neqn is largely a stub page.
If it's a problem, a better fix than reverting this is to make
neqn switch out of compatibility mode like our other man pages.
2020-09-03 G. Branden Robinson <g.branden.robinson@gmail.com>
* FOR-RELEASE: Start a release checklist. We probably should
have done the afmtodit.tables update for 1.22.4. There were no
AGL changes and the Unicode decomposition changes were limited
to additions for Balinese (11), CJK compatibility ideographs
(5), and 13 code points outside the Basic Multilingual Plane.
2020-09-02 G. Branden Robinson <g.branden.robinson@gmail.com>
* src/utils/afmtodit/afmtodit.tables: Regenerate using Unicode
13.0.0.
2020-09-02 G. Branden Robinson <g.branden.robinson@gmail.com>
make-afmtodit-tables: Automate AGL reassignments.
Automate the procedure done manually in
b72b91e85e80a69304e6569db535bcca0e0ecab5 (9 April 2007), so that
it doesn't regress when we regenerate afmtodit.tables.
* src/utils/afmtodit/make-afmtodit-tables: Do it.
* src/utils/afmtodit/afmtodit.tables: Regenerate it.
2020-09-02 G. Branden Robinson <g.branden.robinson@gmail.com>
* src/roff/groff/groff.1.man (Options) <-E>:
* src/roff/troff/troff.1.man (Options) <-E>: Document that -E
implies -Ww.
Fixes <https://savannah.gnu.org/bugs/index.php?59030>.
2020-09-01 G. Branden Robinson <g.branden.robinson@gmail.com>
* man/groff_char.7.man: Revise glyph descriptions.
Fixes <https://savannah.gnu.org/bugs/index.php?59031>.
2020-09-01 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/tty.tmac: Define fallback glyphs for Bell Systems logo
{non-breaking adjustable space} and radical extension and square
root extension (both non-printing input breaks) to suppress
warnings from groff_char(7). As none of these are encoded in
Unicode it seems unlikely they will become supported soon.
2020-08-30 G. Branden Robinson <g.branden.robinson@gmail.com>
* src/roff/troff/troff.1.man (Options) <-I>: The current working
directory is searched _last_, not first, unless the order is
altered with "-I .".
* src/roff/groff/groff.1.man (Options) <-I>: Rearrange
description.
2020-08-25 G. Branden Robinson <g.branden.robinson@gmail.com>
Update mdoc package to honor HY register as man does now, per
suggestion from Colin Watson. Recognize but ignore AD string
for man package compatibility (essentially "reserving" it),
though mdoc intentionally does not permit configuration of
adjustment.
* tmac/mdoc/doc-ditroff-u:
* tmac/mdoc/doc-nroff-u: Do it.
* tmac/mdoc/doc-common-u: Initialize \n[doc-hyphen-flags] from
\n[HY].
* tmac/groff_mdoc.7.man \
(FORMATTING WITH GROFF, TROFF, AND NROFF): Document it.
2020-08-25 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/an-old.tmac (TH): Reset inter-word and inter-sentence
spacing to default with each new page rendered.
{To observe the problem prior to this change,
$ groff -mandoc groff_mmse.7 $any_other_man_page
groff_mmse(7) loads sv.tmac, which changes the sentence
spacing.}
2020-08-25 G. Branden Robinson <g.branden.robinson@gmail.com>
* PROBLEMS: Undocument the problem with test-groff and mdoc.
It's resolved.
Fixes <https://savannah.gnu.org/bugs/index.php?51073>.
2020-08-25 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/tmac.am (NORMALFILES, MDOCFILES): Drop unused variables.
($(TMACMDOCFILES) $(TMACSTRIPFILES)): Scrub trailing whitespace.
Wrap long line.
2020-08-25 G. Branden Robinson <g.branden.robinson@gmail.com>
mdoc: Relocate within build tree.
The (modern) mdoc macro package has not been usable within the
build tree, unlike the others. This makes it more troublesome
to test changes, and frustrates deploying our test
infrastructure against it. Re-arrange the build tree to
resemble an installation tree closely enough for the macro
package to load.
* tmac/doc-common-u:
* tmac/doc-ditroff-u:
* tmac/doc-nroff-u:
* tmac/doc-syms-u: Rename to...
* tmac/mdoc/doc-common-u:
* tmac/mdoc/doc-ditroff-u:
* tmac/mdoc/doc-nroff-u:
* tmac/mdoc/doc-syms-u: ...these.
* tmac/tmac.am (TMACMDOCFILES): Look for files in tmac/mdoc.
($(TMACMDOCFILES)): Create tmac/mdoc in build tree.
Fixes <https://savannah.gnu.org/bugs/index.php?51003>.
2020-08-25 G. Branden Robinson <g.branden.robinson@gmail.com>
Add regression test for usable in-tree mdoc.
* tmac/tests/doc-smoke-test.sh: Add test.
* tmac/tmac.am (tmac_TESTS): Run test.
2020-08-22 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/tests/an-old_TH_repairs_ad_damage.sh:
* tmac/tests/an-old_TH_repairs_hy_damage.sh: Add tests.
* tmac/tmac.am (tmac_TESTS): Run tests.
2020-08-22 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/an-old.tmac (TH): Set hyphenation mode to user preference
with each new page rendered, in case a hostile page meddled with
'.hy' or '.nh'.
(after .mso man.local): Relocate setting of default hyphenation
mode here (instead of just before .mso man.local). Eliminate
conditional on \n[an-html]; this doesn't matter because
grohtml(1) doesn't support hyphenation anyway. If it does learn
to hyphenate, we should treat it the same as other output
devices in any case. Add comment explaining why we fall back to
different defaults depending on \n[cR].
2020-08-22 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/an-old.tmac (TH): Set adjustment to user preference with
each new page rendered, in case a hostile page meddled with
'.ad' or '.na'.
(after .mso man.local): Set the default adjustment mode only if
a -d option or man.local did not. Also do the same for the HF
string; relocate its definition here and make it similarly
conditional. Also update comment on setting of CS and CT
registers and style their conditionals consistently with the
rest of the package.
* tmac/groff_man.7.man.in (Strings) <\*(AD>: Document it.
(Strings) <\*(HF>: Parallelize language with new \*(AD.
(Options) Expand introductory sentence to discuss -d and -r
options.
(Options) <-dAD>: Document default and likely values. Nobody
right-justifies or centers man page text; send the curious to
groff(7) for '.ad' request documentation.
(Options) <-dHF>: Document default and steer people to groff(7)
for '.ft' request documentation.
2020-08-21 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/an-old.tmac (set-an-margin): Rename...
(an-set-margin): ...to this. It was the only package-internal
register, macro, string, or diversion that wasn't named using
the "an-*" schema.
(TH, SH, SS): Update call sites.
2020-08-16 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/an-ext.tmac (.ME, .UE): Restore hyphenation after
"punctuation" arguments have been output. The next token will
always be a space node, the end of the document, or similar.
* tmac/tmac.am (tmac_XFAIL_TESTS): Mark the punctuation
hyphenation tests as expected to fail, because they now do.
2020-08-16 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/ps.tmac: Define ordinary hyphen-minus as fallback
character for U+2011 (non-breaking hyphen). Prompted by
discussion with Dave Kemper in Savannah #58390.
2020-08-15 G. Branden Robinson <g.branden.robinson@gmail.com>
Fix hyphenation bug. The UR/UE and MT/ME macros were much too
aggressive about turning hyphenation off. Disable it only when
writing the actual URL or email address.
* tmac/an-ext.tmac (.MT, .UR): Stop disabling hyphenation here.
(.ME, .UE): Disable hyphenation right before output of
URL/address; restore it right before output of supplementary
arguments ("punctuation").
* tmac/tests/an-ext_ME_punct_hyphenates.sh:
* tmac/tests/an-ext_MT_body_hyphenates.sh:
* tmac/tests/an-ext_UE_punct_hyphenates.sh:
* tmac/tests/an-ext_UR_body_hyphenates.sh: Test behavior.
* tmac/tmac.am (tmac_TESTS): Run tests.
2020-08-15 G. Branden Robinson <g.branden.robinson@gmail.com>
Adapt to the fact that \: reënables hyphenation. Rename
"hyphenless [discretionary] break" to "non-printing break point"
in documentation.
* doc/groff.texi (Manipulating Hyphenation): Rename "hyphenless
break" to "non-printing break point". Clarify that it is the
soft hyphen glyph, not necessarily a hyphen, that is ordinarily
written to the output on hyphenation breaks. Note that the
remainder of a word after \: is subject to hyphenation as
normal. Note (new) '\:\%' idiom for getting what people will
want at least some of the time. Update example to use it.
* makevarescape.sed: Insert \% after we insert \: to rewrite
slashes in filenames, to protect later portions of the filename
from hyphenation.
* man/groff.7.man (Escape Sequences/Escape short reference):
Rename "hyphenless break" to "non-printing break point".
* man/groff_diff.7.man (Language/Escape sequences): Resync with
our Texinfo manual.
* tmac/groff_man.7.man.in (Description/Hyperlink and email
macros): Rename "hyphenless break" to "non-printing break
point".
2020-08-15 G. Branden Robinson <g.branden.robinson@gmail.com>
documentation: Re-christen 'ESCAPE_AMPERSAND'.
s/zero[- ]width space character/non-printing input break/
* doc/groff.texi (Requests): Rename. Update conceptual index
entries; retain old name (with an appended "[sic]") to aid
readers accustomed to it.
(Ligatures and kerning): Update conceptual index entries.
Supply context ("effect on kerning").
(Drawing requests): Update conceptual index entries. Supply
context ("effect on '\l'").
* man/groff.7.man (Description): Rename in macro-advice-writing
shorthand.
(Escape Sequences/Escape short reference): Rename.
* tmac/groff_man.7.man.in (Description/Command synopsis macros
[style]: Rename.
(Description/Portability) [style]: Rename.
* tmac/groff_mdoc.7.man (TROFF IDIOSYNCRASIES/Macro Usage):
Rename.
(TROFF IDIOSYNCRASIES/Other Possible Pitfalls): Rename.
2020-08-14 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/groff_man.7.man.in (Description/{Document structure
macros/.TH, Horizontal and vertical spacing}): Fix erroneous use
of "flush left". The current uses were introduced by me, but
the page has borne incorrect uses of it as far back as 1999 (in
the description of .TP). Simply say "with no indentation"
instead.
2020-08-13 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/groff_man.7.man.in (Description/Number registers): Inform
reader that registers can be set in man.local file and
cross-reference it.
(Files/*/man.local): [style] Supply example of man.local
customizations, prompted by recent discussions on groff,
linux-man, and man-db mailing lists.
2020-08-12 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/tmac.am: Use a stamp file for m4 keyword check.
(M4CHECK): Add stamp file variable.
($(M4CHECK)): Create stamp file if check succeeds.
2020-08-12 G. Branden Robinson <g.branden.robinson@gmail.com>
Split groff_man(7) into two pages; one a (relatively) terse
reference and the other a tutorial and style guide. Both are
generated from the same source, which is processed by m4 into
two man page sources.
* tmac/groff_man.7.man: Rename...
* tmac/groff_man.7.man.in: ...to this.
* tmac/groff_man.7.man.in: Add m4 directives and define macros.
Protect m4 keywords in English from unintended expansion (this
affected the word "include"). Add new .TH and apropos lines for
style guide. Convert marker comments into m4 macros for content
control. Uncomment material intended only for basic reference
page.
* tmac/tmac.am (man7_MANS): Add groff_man_style.7.
(EXTRADIST) Add groff_man.7.man.in.
(MOSTLYCLEANFILES): Add m4-generated man page sources
tmac/groff_man{,_style}.7.man.
Add targets to generate those same two pages from the renamed
file. Add target to grep the page for unprotected English m4
keywords and halt the build if they are found. Make generation
of those pages depend on this new target.
2020-08-11 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/groff_man.7.man: Add material on hooks and encoding.
(Description, ./Deprecated features): Stop identifying .BT and
.DT as "deprecated"; they shouldn't ever be called in man pages,
but that has never been their intention.
(Description): Identify character encoding and line-ending
requirements (tutorial/style-guide material).
(Description/Hooks): Add new subsection to house descriptions of
.BT and .DT. Add mnemonic expansions for both.
2020-07-31 G. Branden Robinson <g.branden.robinson@gmail.com>
* man/groff.7.man (Control Characters): Incorrect claims were
made. Double quotes can indeed be used to enclose arguments to
string interpolations. The statement about a leading " in a
string definition (or appendment with .as) was stated too
generally. The leading quote is not necessary to include
leading tab characters, which can be input as-is, even in
compatibility mode.
2020-07-28 G. Branden Robinson <g.branden.robinson@gmail.com>
* man/groff.7.man (Requests/Request short reference/.ft): Fix
some outright damage in the description of the request; the
escape sequences that are synonymous with a nullary .ft had been
wrongly removed.
2020-07-25 G. Branden Robinson <g.branden.robinson@gmail.com>
* doc/meintro.me:
* doc/meref.me:
* tmac/e.tmac-u: Remove postal address for Eric Allman. It's
probably decades out of date. Adjust footnote symbols. Thanks
to Dave Kemper for the bug report and the patch. Fixes
<https://savannah.gnu.org/bugs/?58726>.
2020-07-23 G. Branden Robinson <g.branden.robinson@gmail.com>
Migrate macro packages from font CW to CR. The font name "CW"
{"constant-width"} is a legacy item we can dispose of (except
for the DVI device, which also has CWI for "constant-width
italic"), and much of the groff codebase already did starting
with commit 0de1d6d79cdb959ffa7dac3af77c2a36ef31873f {October
2017}. Courier is available in the usual four styles {roman,
bold, italic, bold+italic}.
* tmac/an-ext.tmac (.EX): Set font to R, not CW. The existing
.ft request was somewhat redundant with the '.do fam C'
immediately before, which set the font family to Courier.
* tmac/s.tmac (.UC): Use font CR, not CW.
2020-07-23 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/tty.tmac: Stop suppressing nonexistent font warning.
Prompted by a 2017 suggestion and patch from Bjarni Ingi
Gislason. Documents and macro packages that want to change the
font family should do so in awareness that this is meaningless
on terminal (nroff) devices (and -Thtml as well).
Fixes <https://savannah.gnu.org/bugs/?51364>.
2020-07-18 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/groff_man.7.man (.PP, .LP, .P): Fix error: these macros
do not reset the left margin.
2020-07-16 G. Branden Robinson <g.branden.robinson@gmail.com>
* doc/groff.texi (Strings): Document behavior of .ds request
when only one argument is supplied. (The string is defined as
empty.) Thanks to Dave Kemper for the report and the patch.
Fixes <https://savannah.gnu.org/bugs/index.php?58746>.
2020-07-16 G. Branden Robinson <g.branden.robinson@gmail.com>
* doc/groff.texi (Using Symbols): Fix error in .rfschar
description, which should refer to "font f" rather than "glyph
f". Thanks to Dave Kemper for the report and the patch.
Fixes <https://savannah.gnu.org/bugs/index.php?58767>.
2020-07-12 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/groff_man.7.man (.EE, .YS): Fix error: refer to "initial
hyphenation setting" instead of "previous hyphenation mode".
Incidentally, this fact points out why putting ".hy 0" or ".nh"
in your man page is futile.
2020-06-28 G. Branden Robinson <g.branden.robinson@gmail.com>
* man/groff.7.man (Requests/Request short reference): Fix error
in description of .hc; it changes the hyphenation character
rather than supplying an additional one.
2020-06-12 G. Branden Robinson <g.branden.robinson@gmail.com>
* doc/groff.texi (Groff Options): Remove editorial comment about
'-a' option being "useless". It isn't. Update example for
contemporary systems (like Debian) and to reflect the fact that
the GNU troff(1) man page needs to be preprocessed with tbl(1).
(Invoking grotty): Recast discussion of -c option, importing
much language from grotty(1) page rewrite from a year ago. Add
program index entries for col, more, and ul. Fix transposition
error in ISO document number.
* src/devices/grotty/grotty.1.man (Description/Legacy output
format): Make slight wording changes prompted by content of
parallel section in our Texinfo manual.
* src/roff/groff/groff.1.man (Options/-a): Parallelize with
first sentence of corresponding material in our Texinfo
manual.
* src/roff/troff/troff.1.man (Options/-a): Parallelize with
our Texinfo manual.
Fixes the rest of
<https://savannah.gnu.org/bugs/index.php?55278>.
2020-06-12 G. Branden Robinson <g.branden.robinson@gmail.com>
* man/groff_diff.7.man (Language/Long names): Fix error: groff
adds three new requests with short names, not two. List them in
an adjacent comment.
2020-06-04 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/an-ext.tmac (.ME, .UE): Fix portability issue. While
widely supported, the \$* escape is not documented in CSTR #54.
If groff is not the typesetter, append macro arguments using
\$1, \$2, ..., \$9 instead.
2020-05-19 G. Branden Robinson <g.branden.robinson@gmail.com>
* man/groff.7.man (Numerical Expressions): Fix error: negative
expressions evaluate false, not true as was implied.
Parallelize descriptions with our Texinfo manual and
groff_diff(7) (in abbreviated form).
2020-05-18 G. Branden Robinson <g.branden.robinson@gmail.com>
* doc/groff.texi (Manipulating Filling and Adjusting): Fix error
in code sample: missing 'n' in number register interpolation.
2020-05-14 G. Branden Robinson <g.branden.robinson@gmail.com>
* src/preproc/preconv/tests/smoke-test.sh: Make BOM detection
override less hinky (i.e., use more normative input). Add tests
for all five detected BOMs.
2020-05-09 G. Branden Robinson <g.branden.robinson@gmail.com>
* src/roff/troff/env.cpp (space_size): Prevent assertion
failure. If an argument to the .ss request is negative, throw a
range warning and ignore it.
* src/roff/groff/tests/regression_savannah_58337.sh: Add test.
* src/roff/groff/groff.am (groff_TESTS): Run test.
Fixes https://savannah.gnu.org/bugs/index.php?58337.
2020-05-08 G. Branden Robinson <g.branden.robinson@gmail.com>
Update documentation of .ss request.
* doc/groff.texi (Manipulating Filling and Adjusting): Rewrite
documentation of .ss request and \n[.ss] and \n[.sss] escapes.
Note that negative values are not permitted in either argument
to .ss. Use new terminology, "minimal inter-word spacing" and
"additional inter-sentence spacing" for clarity. Clarify that
additional inter-sentence spacing is only used when the output
line is not full when the end of a sentence occurs. Add index
nodes to help readers find discussion of details of spacing
between words and sentences. Move discussion of differences
from AT&T troff to section "Implementation Differences". Update
example to more closely resemble a real-world case, use second
argument to .ss request, and eliminate hackish use of .nop
request.
* man/groff_diff.7.man (New number registers): Recast in
parallel with the foregoing.
* man/groff.7.man (Read-only registers): Use new terminology and
describe \n[.ss] and \n[.sss] in meaningful terms, not by
reference to arguments to the .ss request (which wasn't even
accurate, because these registers have default values).
Fixes https://savannah.gnu.org/bugs/index.php?54101.
2020-05-06 G. Branden Robinson <g.branden.robinson@gmail.com>
Undocument plans to support end-of-file GNU Emacs coding tags.
* src/preproc/preconv/preconv.cpp (check_coding_tag): Update
comments.
(detect_file_encoding): Alter debugging output so it's easier to
grep and verify Emacs coding tag detection.
* src/preproc/preconv/preconv.1.man (Bugs): Delete; its sole
concern was the absence of this feature.
(Usage): Document detection algorithm in more detail. Note
which detection methods don't work on unseekable input (pipes).
Offer recommendations for those struggling with encoding
detection.
(Usage/Coding Tags): Stop manipulating line adjustment. Use
hyphen-minus (\- escape) characters in coding tag names, since
they are literals that one might copy and paste. Stop
referencing XEmacs, whose development appears moribund.
(See Also): Add cross-references to iconv(3) and locale(7) man
pages.
* src/preproc/preconv/tests/smoke-test.sh: Test each of the
steps in the detection algorithm.
* src/preproc/preconv/preconv.am: Run test.
(preconv_TESTS): Add new variable.
(TESTS): Append $(preconv_TESTS).
2020-05-05 G. Branden Robinson <g.branden.robinson@gmail.com>
* src/utils/afmtodit/afmtodit.pl: Format usage message with
full capitals for parameters, and break out -v option in a
separate "synopsis".
2020-05-05 G. Branden Robinson <g.branden.robinson@gmail.com>
* font/devpdf/util/BuildFoundries.pl: Stop throwing away
diagnostics from afmtodit. This results in only one extra line
of build output:
both Upsilon1 and Upsilon map to *U at .../afmtodit line
6413.
2020-05-05 G. Branden Robinson <g.branden.robinson@gmail.com>
Correct documentation of .pm request.
* man/groff.7.man (Requests/Request short reference): The .pm
request's classical behavior was described instead of groff's,
and omitted mention of strings and diversions; correct it.
* man/groff_diff.7.man (Implementation Differences): Document
this difference between AT&T troff and groff.
* doc/groff.texi (Debugging): Relocate description of .pm
behavioral difference...
(Implementation Differences): ...hither.
2020-04-30 G. Branden Robinson <g.branden.robinson@gmail.com>
* src/utils/addftinfo/addftinfo.cpp (usage):
* src/utils/tfmtodit/tfmtodit.cpp (usage): Add "usage:" prefix
to messages documenting auxiliary modes of invoking the program.
The output doesn't look right without one, and it feels
dishonest to not document the relevant options (-v, --version)
disjunctively. I'm trying to strike a balance between the
ultra-terse BSD approach and the ultra-garrulous GNU one (see,
e.g., ls(1)). Likely both camps will be unhappy. :-/
2020-04-30 G. Branden Robinson <g.branden.robinson@gmail.com>
* src/utils/tfmtodit/tfmtodit.cpp (read_map): Report invalid
character code from map file in diagnostic.
(main): Report invalid skew character position in diagnostic.
Explicitly report insufficient arguments in addition to usage
message. Lift invariant computed expressions out of loops (more
to shorten long lines than because I think the compiler won't
figure it out). Give content to "impossible assertion".
(tfm::load): Capitalize TFM initialism in diagnostics.
(usage): Use full capitals for parameters as is conventional.
Document disjunction of -v/--version flag from other
invocations.
2020-04-29 G. Branden Robinson <g.branden.robinson@gmail.com>
* src/utils/addftinfo/addftinfo.cpp (usage): Add overloaded
version that accepts a constant string argument, which emits the
argument as a diagnostic and then calls usage().
(main): Add diagnostics to usage message where the problem is
clear. Add comment explaining why it sometimes isn't.
(usage): Refactor main usage message (which prints the summary)
to report the actual names of the accepted option arguments
instead of just "-param", which is not literally accepted.
Sort param_table alphabetically for use by the usage message.
2020-04-22 G. Branden Robinson <g.branden.robinson@gmail.com>
Delete groffer.
Per discussion on the groff development mailing list, there is
no desire to retain the maintenance of this portion of the groff
distribution.
See
<https://lists.gnu.org/archive/html/groff/2020-04/msg00051.html>
et seq.
* contrib/groffer: Recursively delete.
* Makefile.am:
* arch/mingw/mingw.am: Stop building groffer.
* m4/groff.m4 (GROFF_GROFFERDIR_DEFAULT):
(GROFF_GROFFERDIR_OPTION): Delete; remove "--with-grofferdir"
configuration option.
* configure.ac: Stop calling these macros.
* MANIFEST:
* NEWS:
* PROJECTS:
* TODO:
* contrib/chem/chem.1.man:
* contrib/chem/examples/122/README.txt:
* contrib/chem/examples/README.txt:
* contrib/glilypond/glilypond.1.man:
* contrib/gperl/gperl.1.man:
* contrib/gpinyin/gpinyin.1.man:
* contrib/groff_filenames/groff_filenames.5.man:
* man/groff_font.5.man:
* man/roff.7.man:
* src/roff/groff/groff.1.man:
* src/roff/grog/grog.1.man:
* src/utils/addftinfo/addftinfo.1.man:
* tmac/groff_trace.7.man: Delete references to groffer.
2020-04-19 G. Branden Robinson <g.branden.robinson@gmail.com>
* src/include/curtime.h: #include <time.h> if we're returning
a time_t from current_time().
* src/libs/libgroff/curtime.cpp (current_time): Quote
$SOURCE_DATE_EPOCH variable content in diagnostics produced due
to bad input since it's under user control and could have all
kinds of bogosity in it (like whitespace).
2020-04-19 G. Branden Robinson <g.branden.robinson@gmail.com>
* **/*.{man,tmac}: Save compatibility mode robustly.
Use new \n[.cp] register to save compatibilty mode.
Use register names based on the filename (at the source
maintenance level) to avoid clobbering other files' saved
compatibility modes.
* tmac/html.tmac: Eliminate test of saved-compatibility
register by moving its body inside the block where compatibility
mode is off. This is the only part of this changeset that was
not automated.
Fixes <https://savannah.gnu.org/bugs/index.php?58162>.
2020-04-16 G. Branden Robinson <g.branden.robinson@gmail.com>
Implement new read-only .cp register.
Within a .do request, \n[.cp] holds the saved value of
compatibility mode.
The register \n[.cp] is specialized and may require a statement
of rationale. When writing macro packages or documents that use
groff features and which may be mixed with other packages or
documents that do not—common scenarios include serial processing
of man pages or use of the .so or .mso requests—you may desire
correct operation regardless of compatibility mode in the
surrounding context. It may occur to you to save the existing
value of \n(.C into a register, say, _C, at the beginning of
your file, turn compatibility mode off with “.cp 0”, then
restore it from that register at the end with “.cp \n(_C”. At
the same time, a modular design of a document or macro package
may lead you to multiple layers of inclusion. You cannot use
the same register name everywhere or you risk “clobbering” the
value from a preceding or enclosing context. The two‐character
register namespace of AT&T troff is confining and mnemonically
challenging; you may wish to use groff's more capacious
namespace. However, attempting “.nr _my_saved_C \n(.C” will not
work in compatibility mode; the register name is too long.
“This is exactly what .do is for,” you think, “.do nr
_my_saved_C \n(.C”. The foregoing will always save zero to your
register, because .do turns compatibility mode off while it
interprets its argument list. What you need is:
.do nr _my_saved_C \n[.cp]
.cp 0
at the beginning of your file, followed by
.cp \n[_my_saved_C]
at the end. As in the C language, we all have to share one big
namespace, so choose a register name that is unlikely to collide
with other uses.
* src/roff/troff/input.cpp (do_request, init_input_requests):
Implement it.
* doc/groff.texi:
* man/groff.7.man:
* man/groff_diff.7.man: Document it.
* src/roff/groff/tests/dot-cp_register_works.sh: Test it.
* src/roff/groff/groff.am (groff_TESTS): Run test.
Enables a fix for
<https://savannah.gnu.org/bugs/index.php?58162>.
Thanks to John Gardner and Ingo Schwarze for the discussion.
2020-04-15 G. Branden Robinson <g.branden.robinson@gmail.com>
* doc/groff.texi (Implementation Differences):
* man/groff_diff.7.man (New requests): Rewrite description of
.do request, and replace example with a more illustrative one.
* man/groff.7.man (Request short reference): Rewrite description
of .do request briefly.
2020-04-14 G. Branden Robinson <g.branden.robinson@gmail.com>
* doc/groff.texi (Implementation Differences): Remove incorrect
claim. The .C register cannot be manipulated manually.
2020-04-14 G. Branden Robinson <g.branden.robinson@gmail.com>
* src/roff/groff/tests/smoke-test_html_device.sh: Simplify
charmap test.
2020-04-13 G. Branden Robinson <g.branden.robinson@gmail.com>
It's too easy for the nroff version to get desynced from the
groff version when we're running test cases, leading to spurious
results. Make it easier to see a discrepancy.
* src/roff/nroff/nroff.sh: Call groff with -v or --version when
we are called that way. Let test cases tell us to use
test-groff as groff with an environment variable.
* src/roff/nroff/tests/verbose_option_works.sh.in: Rename to...
* src/roff/nroff/tests/verbose_option_works.sh: ...this. Check
the nroff version being tested against the groff version being
wrapped. This exposes a bug; the system groff rather than the
build tree groff was being invoked. Refactor. Stop messing
with @GROFF_BIN_PATH_SETUP@ (enabling the rename); instead, let
test-groff handle that for us. Locate it and export the
variable GROFF_TEST_GROFF so nroff can find it. Because we
manipulate $PATH to run the tests, the $PATH of an installed
groff system will _always_ differ from that used by a build
tree; ignore it in the test cases. Dispose of bashisms and set
shebang to /bin/sh.
* src/roff/nroff/nroff.am: Stop generating the above test
script. It can now be run as it ships.
2020-04-13 G. Branden Robinson <g.branden.robinson@gmail.com>
Make our assert() C99-conformant.
groff has its own implementation of the standard C library's
assert() macro. It hasn't been updated since C89. C99 requires
that the diagnostic emitted by assert() contain the failing
expression and name of the function in scope.
* src/include/assert.h: Add additional pointer to const char
arguments to do_assert() and assertion_failed() for function
name and stringified expression.
(assertion_failed): Update prototype.
(do_assert): Accept 'func' and 'msg' parameters and pass them to
assertion_failed().
(assert): Update macro to collect '__func__' and stringify the
expr parameter (as 'msg') and pass them do do_assert().
* src/libs/libgroff/assert.cpp (assertion_failed): Rewrite
diagnostic to more closely match GNU Coding Style format and
also report function and failing expression.
Example output:
troff: ../src/roff/troff/input.cpp:2644: do_request():
assertion failed: '0 == "But first, here's a rotten old
BBC programme."'
We have no excuse to assert(0) ever again. Express the
invariant that has been violated.
2020-04-13 G. Branden Robinson <g.branden.robinson@gmail.com>
* src/roff/groff/tests/smoke-test_html_device.sh: Set
LC_CTYPE=C.UTF-8 so that byte sequences in the pipelines are
handled correctly. Skip the test if the environment doesn't
support UTF-8. Thanks to Bjarni Ingi Gislason for the trouble
report.
Fixes <https://savannah.gnu.org/bugs/?58164>.
2020-04-13 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/html.tmac: Use .do so we correctly load unicode.tmac in
compatibility mode.
Fixes the following problem (wrapped, filenames abbreviated):
$ echo | ./build/test-groff -C -Thtml >/dev/null
troff: backtrace: file '.../groff/build/../tmac/html.tmac':546
troff: backtrace: file '.../groff/build/../tmac/troffrc':30
troff: .../groff/build/../tmac/html.tmac:546: warning: macro
'ms' not defined
2020-04-13 G. Branden Robinson <g.branden.robinson@gmail.com>
* src/roff/groff/tests/smoke-test_html_device.sh: Add test.
* src/roff/groff/groff.am (groff_TESTS): Run test.
2020-04-12 G. Branden Robinson <g.branden.robinson@gmail.com>
* src/roff/groff/tests/regression_savannah_58153.sh:
* src/roff/groff/tests/\
use_point_size_escape_with_single_digit_arg.sh: Use "set -e" to
ensure that multi-test script files don't hide problems. There
are arguments against "set -e" (and you can ask Greg Wooledge
for all of them), but I'm so used to it from years of writing
Debian package maintainer scripts that I feel comfortable with
it. It is less verbose than several alternatives (especially
having one test script per case).
* src/roff/groff/tests/string_case_xform_unicode_escape.sh:
Update with respect to new failure output (in a comment only,
since this is an XFAIL test).
* tmac/tests/an-old_AT_and_UC_footer_saved_and_restored.sh:
Drop unnecessary "|| exit 1" from end of script. Incidentally,
this script illustrates an alternative to "set -e".
2020-04-11 G. Branden Robinson <g.branden.robinson@gmail.com>
Rework documentation of .spreadwarn.
* doc/groff.texi (Debugging):
* man/groff.7.man (Request short reference):
* man/groff_diff.7.man (New requests): Recast description of
.spreadwarn request, some based on suggestions from Dave Kemper.
Make more prominent the fact that spreading only applies to
adjustment mode 'b'. Document warning type used.
Fixes half of Savannah #58035.
2020-04-11 G. Branden Robinson <g.branden.robinson@gmail.com>
Require Texinfo 5.0 (February 2013) at a minimum.
* m4/groff.m4 (GROFF_MAKEINFO): Check for version 5.0 (increased
from 4.8). Update diagnostics and comments.
* INSTALL.extra:
* README:
* doc/groff.texi:
* doc/webpage.ms: Document updated requirement.
* doc/fixinfo.sh: Delete; it is no longer necessary to work
around Texinfo 4.x bugs.
* doc/doc.am (EXTRA_DIST): Stop shipping fixinfo.sh.
(.texi.html): Remove makeinfo < 5.0 version check and consequent
execution of fixinfo.sh. Update comment.
2020-04-11 G. Branden Robinson <g.branden.robinson@gmail.com>
Enable backtracing across process/file boundaries when errors or
non-ignored warnings are encountered.
Experimentation reveals that .so, .mso, and .pso requests acted
as barriers to backtracing except when explicitly requested with
the .backtrace request. Judging by the git history, this
behavior dates back to June 1991 or earlier. The intention,
according to a source comment, was only to suppress the
backtrace output for the line corresponding to the outermost
level of the input stack (commonly, a file argument to groff).
Unfortunately, that wasn't its only effect.
This change does result in one additional line of output for
each error or (non-ignored) warning when -b is given. However,
I regard this as unobjectionable because {1} a backtrace was in
fact explicitly requested; and {2} it seems a poor tradeoff to
suppress most of the backtrace in some complicated and
frustrating cases for the sake of one fewer line of backtrace
output in a trivial one.
Now, backtracing behaves the same no matter what triggers it.
Fixes Savannah #58153.
* src/roff/troff/input.cpp (file_iterator::backtrace): Call
get_location() for its side effect of rewriting a filename of
"-" to "<standard input>", for consistency with other diagnostic
messages. (In this class, this member function always returns
1, so ignore the return value. This fact is an essential part
of what led to the bug; the conditional
p && !p->get_location(0, &f, &n)
which appeared in the for loop of input_stack::backtrace() prior
to this change would always evaluate to false when a node of the
file_iterator class was encountered.)
(input_stack::backtrace): Replace member function body with that
of input_stack::backtrace_all().
(input_stack::backtrace_all): Delete.
(backtrace_request): Update the only call site of the above.
* src/roff/groff/tests/regression_savannah_58153.sh: Add test.
* src/roff/groff/groff.am (groff_TESTS): Run test.
* src/roff/groff/tests/string_case_xform_errors.sh: Update
regression test to not be confounded by additional line of
backtrace output. Remove bashism along the way.
* doc/groff.texi:
* man/groff.7.man:
* man/groff_diff.7.man: Update documentation.
2020-04-10 G. Branden Robinson <g.branden.robinson@gmail.com>
Reorganize backtrace output.
* src/roff/troff/input.cpp (string_iterator::backtrace):
Prefix the output with the program name if it is known. In a
deviation from the GNU Coding Standards, put the string
"backtrace:" immediately next instead of the file and line
number; this is because, particularly in cases where the
backtrace is most interesting or needed, it will produce
multiple lines of output and the common prefix aids visual
understanding.
(file_iterator::backtrace): As above; also, change prefix for
popened nodes in the iterator from "process" to "pipe". This
seemed preferable to omitting the information entirely or using
an inscrutable sigil like 'f' or 'p'. The advantage is that the
output is better aligned--better ergonomics for those who have
to cope with a lot of it. Furthermore, output the filename only
once.
Example of old and new output:
/tmp/inner:2: backtrace: file '/tmp/inner'
echo .so /tmp/inner:1: backtrace: process 'echo .so /tmp/inner'
/tmp/outer:1: backtrace: file '/tmp/outer'
troff: backtrace: file '/tmp/inner':2
troff: backtrace: pipe 'echo .so /tmp/inner':1
troff: backtrace: file '/tmp/outer':1
2020-04-10 G. Branden Robinson <g.branden.robinson@gmail.com>
* src/roff/troff/input.cpp (read_size): Add units to diagnostic.
This function works only with device-specific basic units
internally; users likely think in terms of point size, so add
the basic unit suffix "u" to offer a hint about what's going on.
Example:
$ groff -ww >/dev/null
\s[10]A\s[-12]B
troff: <standard input>:1: warning: point-size escape results in
non-positive size -2000u; set to 1u
On a PostScript device with 1000 basic units to the point, the
difference is important and would be confusing without the unit
indication.
2020-04-08 G. Branden Robinson <g.branden.robinson@gmail.com>
Correct and clarify point size documentation.
Our Texinfo manual has long documented the request '.ps 0' as
restoring the previous point size (just as '\s0' or '.ps' with
no argument does), but this is incorrect; since groff 1.02 or
earlier (June 1991), the request has not actually worked this
way. Instead, '.ps 0' sets the point size to 1 basic unit
{though output drivers may clamp this to a higher value}. This
behavior is consistent with AT&T troff, Hierloom Doctools troff
and, per Ingo Schwarze, Plan 9 troff. (It is, however, not
consistent with neatroff.)
* doc/groff.texi (Changing Type Sizes): Stop claiming that '.ps
0' works like '\s0'. Note that the resulting (computed) point
size, not the argument, is clamped. Note that it is
non-positive, not negative, point sizes that are clamped to 1u.
Add (forward) cross-reference to section where \n[.ps] is
defined since it is mentioned here. Move explanation of special
handling of zero argument to \s escape description.
* man/groff.7.man (Request short reference): Explain .ps N
independently of \s. Note clamping behavior.
2020-04-06 G. Branden Robinson <g.branden.robinson@gmail.com>
* src/roff/troff/input.cpp (read_size): Correctly brace 'else'
block.
* src/roff/groff/tests/\
use_point_size_escape_with_single_digit_arg.sh:
Check that we get a diagnostic when relying on ambiguous form.
2020-04-04 G. Branden Robinson <g.branden.robinson@gmail.com>
* src/roff/troff/input.cpp (read_size): Move special-case
interpretation of the '\sN' form of point-size escapes when 'N'
is 1, 2, or 3 to compatibility mode (groff -C) only, and throw
error diagnostic with suggestion for remedy if encountered.
Traditionally, '\s36A' is interpreted as "set point size to 36,
then emit 'A'". However, only values in the range 10-39 are
handled specially; '\s40A' is interpreted as a four-point "0A".
This is unlike anything else in *roff grammar; see \*, \$, \f,
\F, \g, \k, \m, \M, \n, \V, \Y, and \z.
To anticipate objections: Why not throw only a warning? Because
there isn't a warning category for supported but ambiguous
syntax (this behavior of AT&T troff dates back to the mid-1970s
but was not documented in the Troff User's Manual until 1992).
Why not throw the error outside of compatibility mode too?
Because outside of compatibility mode we (now) have an
unambiguous parse.
Background: The Graphic Systems C/A/T phototypesetter (the
original device target for AT&T troff) only supported a few
discrete point sizes in the range 6..36, so Ossanna
special-cased the parser to do what the user must have meant.
Kernighan warned of this in the 1992 revision of CSTR #54
{§2.3}, and more recently, McIlroy referred to it as a "living
fossil".
See:
https://lists.gnu.org/archive/html/groff/2020-03/msg00054.html
https://lists.gnu.org/archive/html/groff/2020-04/msg00002.html
https://lists.gnu.org/archive/html/groff/2020-04/msg00015.html
and follow-ups for discussion.
* NEWS: Advise users of behavior change and offer guidance.
* doc/groff.texi:
* man/groff.7.man: Document the restriction of special handling
of point-size arguments to '\s' to compatibility mode.
* src/roff/groff/tests/\
use_point_size_escape_with_single_digit_arg.sh: Add regression
test.
* src/roff/groff/groff.am (groff_TESTS): Run test.
2020-04-04 G. Branden Robinson <g.branden.robinson@gmail.com>
Improve point-size escape diagnostics.
* src/roff/troff/input.cpp (read_size): Disclose context
{point-size escape intepretation} in diagnostic messages. When
a "bad digit" is encountered, describe it if possible. When a
relative adjustment results in a negative point size, report the
computed value. Also rename a variable for slightly more
clarity ("bad" does not refer to all bad parses, just some cases
of bad digits), and update an insufficiently generalized comment
{"\s(00" is also an acceptable expression for point-size zero}.
Based on suggestions by Ingo Schwarze and Bjarni Ingi Gislason.
2020-04-01 G. Branden Robinson <g.branden.robinson@gmail.com>
Align diagnostic message format.
* src/libs/libgroff/error.cpp (do_error_with_file_and_line):
* src/roff/troff/input.cpp (do_error):
Display the diagnostic level when it is "error", instead of
leaving it implicit.
* src/roff/troff/input.cpp (error_with_file_and_line): Include
the program name in the diagnostic message if it is known.
* src/roff/groff/tests/string_case_xform_errors.sh: Update
diagnostic message expectation.
2020-02-10 G. Branden Robinson <g.branden.robinson@gmail.com>
* doc/groff.texi (Page Motions):
* man/groff.7.man (Single-character escapes): Document
non-breaking spaces as such.
Report and patch by Dave Kemper <saint.snit@gmail.com>.
Fixes <https://savannah.gnu.org/bugs/index.php?55954>.
2020-02-10 G. Branden Robinson <g.branden.robinson@gmail.com>
nroff: Implement -P and -V options.
* src/roff/nroff/nroff.sh: Recognize -P option (with argument)
and pass it through to groff. Recognize -V option; if given,
display constructed groff command instead of executing it.
Update usage message to document new options. Tidy up shell
style and indentation. Add comments.
* src/roff/nroff/nroff.1.man: Document new -P and -V options.
* src/roff/nroff/tests/verbose_option_works.sh.in: Test -V
option.
* src/roff/nroff/nroff.am: Generate test and run it.
2020-02-06 G. Branden Robinson <g.branden.robinson@gmail.com>
Stop ms macro package from manipulating warnings.
* tmac/s.tmac: Remove code block that attempted to enable all
warnings "only if none are given on the command line". It did
this by simply comparing the value of the warn register
{\n[.warn]} against the default value; but of course, a user
could specify -w options that exactly matched the default and
the test would not be able to tell, causing puzzling and
undesired behavior. Furthermore, the hard-coded default was out
of date and did not correspond to recent releases of groff. If
you want all warnings on, use the ".warn" request with no
arguments in your ms document or pass "-w w" to groff (see
troff(1) or our Texinfo manual for more on warnings).
Thanks to Bjarni Ingi Gislason for bringing this issue to our
attention.
Resolves <https://savannah.gnu.org/bugs/?57583>.
2020-01-21 George HELFFRICH <ghfbsd@gmail.com>
[me]: Fix regression of '.nm' (#57638).
* tmac/e.tmac-u (nm): Use saved point size and font position
for line numbering only if those registers exist.
Fixes <https://savannah.gnu.org/bugs/index.php?57638>.
2020-01-18 Ingo Schwarze <schwarze@openbsd.org>
Accept any number of arguments for .Dd in the groff_mdoc(7)
macros.
* tmac/doc-common-u: The .Dd macro behaved in a weird way:
Without arguments, it printed the string "Epoch".
With one, two, four, or more arguments, it ignored all arguments
and used the current date instead.
Only for exactly three arguments, it printed the arguments.
None of this made sense. Giving the date as "Epoch" is
absurd, and printing the current date is just misleading:
why should a document be considered up-to-date when the author
did not even bother to state the date of the last change?
Admittedly, the behaviour for 0 and 4 or more arguments
already appeared 4.3BSD-Reno, and the behaviour for 2 or 3
arguments in 4.4BSD. But it was already wrong even in those
days: several manual pages in 4.4BSD gave .Dd a single, quoted
argument, e.g. .Dd "June 9, 1993": cap_mkdb(1), id(1), sed(1),
err(3), getcap(3), sysctl(3), amd(8), disklabel(8), and others.
Consequently, simply print all the arguments, no matter how
many there are.
This bug was found by Jonathan Gray <jsg@openbsd.org>
while he looked at 4.xBSD manual pages.
2020-01-18 G. Branden Robinson <g.branden.robinson@gmail.com>
* doc/groff.texi: Document initial empty set membership of
characters with cflags values of 128, 256, or 512 in parallel
with preceding paragraphs regarding smaller powers of two.
Report and patch by Dave Kemper <saint.snit@gmail.com>.
Fixes <https://savannah.gnu.org/bugs/?57549>.
2020-01-18 G. Branden Robinson <g.branden.robinson@gmail.com>
* src/roff/groff/tests/*.sh: Rename some tests so their
filenames are more self-descriptive.
* src/roff/groff/groff.am (groff_TESTS): Update.
2020-01-18 G. Branden Robinson <g.branden.robinson@gmail.com>
* src/roff/groff/tests/transparent_end-of-sentence_chars.sh: Add
test for end-of-sentence recognition.
* src/roff/groff/groff.am (groff_TESTS): Run test.
2020-01-18 G. Branden Robinson <g.branden.robinson@gmail.com>
* src/roff/troff/input.cpp: Mark \[dd] character (double dagger)
as transparent for purposes of end-of-sentence recognition.
* doc/groff.texi (Sentences):
* man/groff_diff.7.man (New requests/.cflags): Document this.
Report and patch by Dave Kemper <saint.snit@gmail.com>.
Fixes <https://savannah.gnu.org/bugs/?57546>.
2020-01-17 G. Branden Robinson <g.branden.robinson@gmail.com>
* src/preproc/refer/refer.1.man (See Also):
* src/utils/indxbib/indxbib.1.man (See Also):
* src/utils/lkbib/lkbib.1.man (See Also):
* src/utils/lookbib/lookbib.1.man (See Also): Add bibliographic
reference to the original Bell Labs "refer" paper by Mike Lesk.
2020-01-17 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/tests/an-old_AT_and_UC_footer_saved_and_restored.sh: Add
regression test for Ingo's change below.
2020-01-16 Ingo Schwarze <schwarze@openbsd.org>
Repair .AT and .UC in the groff_man(7) macros.
* tmac/an-old.tmac: Setting user-defined strings in a macro that
will later be called indirectly from page location traps is
excessively complicated. Besides, the implementation doesn't
work: when the trap is finally sprung, the defaults from the
an-init macro clobber what the author specified with .AT or .UC.
Instead, all that is needed is setting the strings for the
header before triggering the page break, such that they appear
right away, while setting the strings for the footer after the
page break, such that they don't appear on the previous page.
This bug was found by Jonathan Gray <jsg@openbsd.org> while he
looked at 4.xBSD manual pages.
2020-01-16 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/groff_man.7.man (Document structure macros/.SH): Fix
errors in footer description.
2020-01-12 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/tests/an-old_CS_register_on.sh: Tweak flags; all the
other tests in this group pass "-Tascii -P-cbou" instead of
"-Tutf8". (This is so that output is easy to grep from a shell
script.) Bring this test into line. Does not regress anything.
2019-12-30 Deri James <deri@chuzzlewit.myzen.co.uk>
Certain pdfmark destination names caused gropdf to fail.
* src/devices/gropdf/gropdf.pl: Look for pdfmark types, (i.e.
DEST, OUT, ANN), only preceding 'pdfmark' at end of line, not
anywhere else.
2019-12-30 Ingo Schwarze <schwarze@openbsd.org>
Correct output of sprintf("%%") in pic(1).
* src/preproc/pic/pic.ypp: Print "%" rather than "%%".
Bug reported by Doug McIlroy <doug at cs dot dartmouth dot edu>.
Patch using feedback from Larry McVoy <lm at mcvoy dot com>.
2019-12-29 Deri James <deri@chuzzlewit.myzen.co.uk>
Update man page of gropdf to document \X calls.
* src/devices/gropdf/gropdf.1.man: The calls 'pagename' and
'switchtopage' (used by mom to relocate TOC) are documented,
together with their convenience commands '.pdfpagename' and
'.pdfswitchtopage'.
2019-12-29 Ingo Schwarze <schwarze@openbsd.org>
Improve documentation of pic(1) regarding printf.
* src/preproc/pic/pic.1.man:
Document which conversion specifications are supported.
* doc/pic.ms:
Correct the list of supported conversion specifications.
2019-12-21 Ingo Schwarze <schwarze@openbsd.org>
Update NetBSD, OpenBSD, FreeBSD, Darwin, and DragonFly version
strings.
* tmac/doc-common-u: Update.
* tmac/groff_mdoc.7.man: Synchronize.
Based on a patch from Guillem Jover <guillem@debian.org>
via Colin Watson <cjwatson@debian.org>, tweaked by me.
Fixes: https://bugs.debian.org/867123
2019-09-22 G. Branden Robinson <g.branden.robinson@gmail.com>
Use a vertical spacing of 1v between paragraphs in man page
examples. This looks better (on typesetter devices like
PostScript and PDF) with the Courier font family also used in
examples. Typewriter devices (like the terminal) already used
an inter-paragraph spacing of 1v.
* tmac/an-ext.tmac (EX): Save the value of the PD number
register (inter-paragraph distance), and set it to 1v.
(EE): Restore previous value of the PD register.
2019-09-21 Deri James <deri@chuzzlewit.myzen.co.uk>
Changes to allow configure to check for URW fonts
* font/devpdf/util/BuildFoundries.pl: Call the program with
--dirURW with path provided to ./configure, and --check to do
a dry-run just checking if the fonts are available. (bug #56748)
2019-09-21 Deri James <deri@chuzzlewit.myzen.co.uk>
Add new ghostscript font names (bug #56748)
* font/devpdf/Foundry.in: Add changed font names
2019-09-21 Deri James <deri@chuzzlewit.myzen.co.uk>
Prevent gropdf executing arbitrary commands
* src/devices/gropdf/gropdf.pl: See bug #55557
2019-09-15 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/an-old.tmac: Move test for definitions of CS and CT
registers to after man.local is sourced; this way we can both
respect any setting of those registers in that file (which is
intended for customization by the site administrator) and ensure
that the registers are defined when dereferenced later.
2019-09-15 G. Branden Robinson <g.branden.robinson@gmail.com>
* **/*.man: Put section headings in title case.
2019-09-13 G. Branden Robinson <g.branden.robinson@gmail.com>
* src/roff/troff/input.cpp: Lift invariant out of loop.
2019-09-11 G. Branden Robinson <g.branden.robinson@gmail.com>
* src/preproc/refer/refer.1.man: Add mention of man and mm
packages as supporting the "refer" preprocessor (GNU mm grew
this support back in groff 1.22.1).
2019-09-10 G. Branden Robinson <g.branden.robinson@gmail.com>
Mark expected-to-fail test as XFAIL.
Automake supports XFAIL and XPASS, so actually use the
infrastructure as intended.
* Makefile.am: Declare XFAIL_TESTS variable.
* src/roff/groff/groff.am (groff_XFAIL_TESTS): Add
string_case_xform_unicode_escape.sh.
* src/roff/groff/tests/string_case_xform_unicode_escape.sh: Set
the expected output to what it would be if string case
transforms worked on groff Unicode escapes.
2019-09-10 G. Branden Robinson <g.branden.robinson@gmail.com>
Retire '@G@' build system macro.
It existed only for forcibly-capitalized man page titles; it was
the uppercase-transformed counterpart of @g@.
* Makefile.am: Delete sed transformation of @G@.
* src/preproc/tbl/tbl.1.man: Replace '@G@EQN' in section heading
with '@g@eqn'.
2019-09-10 G. Branden Robinson <g.branden.robinson@gmail.com>
* **/*.man: Downcase man page titles, except for glilypond and
roff2*, which did not require it.
Here's a sed script for the aid of those who have a corpus of
man pages to migrate.
# Downcase man page titles.
#
# Use the first line to skip any .TH lines that require
# special handling, perhaps because the name of the
# command gets externally macro-expanded. In groff, the
# "roff2.1.man" page is an example.
#
# This script operates _only_ on .TH lines.
#
# usage: sed -i -f this_script.sed your_man_page.1 ...
/@ROFF2MODE@/b
/^\.\s*TH/{
h
s/^\.\s*TH \+\([^ ]\+\) .*/\1/
y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/
G
s/\([^ ]\+\)\n\(^\.\s*TH \+\)[^ ]\+\( .*\)/\2\1\3/
}
2019-09-09 G. Branden Robinson <g.branden.robinson@gmail.com>
The an (man) macro package supports new CS and CT number
registers to control rendering of man page section headings and
titles, respectively, in full capitals. These default off (with
no visible effect on pages which already fully capitalize these
strings in man page sources). The rationale is to encourage man
page authors to preserve case distinction information in (or
restore it to) their titles and section headings, while giving
users (including system administrators, distributors,
integrators, and maintainers of man(1) implementations) a way to
view the rendered page elements in full capitals if desired.
* tmac/an-old.tmac (TH/an-init): If number register CT is
defined and nonzero, call .stringup on \*[an-title].
(SH): Store macro argument list to \*[an-section-heading]. If
number register CS is defined and nonzero, call .stringup on it.
* tmac/groff_man.7.man (OPTIONS): Document the CS and CT number
registers.
* tmac/tests/an-old_CS_register_off.sh:
* tmac/tests/an-old_CS_register_on.sh:
* tmac/tests/an-old_CS_register_unspecified.sh:
* tmac/tests/an-old_CT_register_off.sh:
* tmac/tests/an-old_CT_register_on.sh:
* tmac/tests/an-old_CT_register_unspecified.sh: Add tests.
* tmac/tmac.am (tmac_TESTS): Run tests.
2019-09-09 G. Branden Robinson <g.branden.robinson@gmail.com>
Add regression test to check behavior of case transformation
request on a string containing a Unicode character escape.
Right now, this is not supported, so it is an XFAIL test in the
parlance of DejaGNU/POSIX 1003.3.
* src/roff/groff/tests/string_case_xform_unicode_escape.sh: New
test.
* src/roff/groff/groff.am (groff_TESTS): Run test.
2019-09-09 G. Branden Robinson <g.branden.robinson@gmail.com>
Implement .stringdown and .stringup requests.
* src/roff/troff/input.cpp: Add .stringdown and .stringup
requests.
* doc/groff.texi: Document them, including example.
* man/groff_diff.7.man: Same.
* man/groff.7.man: Document them briefly.
2019-09-09 G. Branden Robinson <g.branden.robinson@gmail.com>
Regression-test string case transform feature.
* src/roff/groff/tests/string_case_xform_errors.sh: New test.
* src/roff/groff/tests/string_case_xform_requests.sh: New test.
* src/roff/groff/groff.am (groff_TESTS): Run tests.
2019-06-30 G. Branden Robinson <g.branden.robinson@gmail.com>
* src/devices/grotty/grotty.1.man (Options/-i): Note support of
recent versions of xterm for italic (oblique) styles.
Fixes part of <https://savannah.gnu.org/bugs/index.php?55278>.
2019-06-28 G. Branden Robinson <g.branden.robinson@gmail.com>
devlatin1: Map \(oq to ' on output.
* font/devlatin1/R.proto: Render the output glyph \[oq]
{opening quote} as 0x27 (apostrophe) instead of 0x60 (grave
accent). A grave accent is just flat wrong for the Latin-1
character set, a.k.a. ISO 8859-1. The defining document ECMA-94
{June 1986} is freely available for perusal. The ECMA-94 Latin
character sets do not define any glyphs for directional
{"typographer's"} quotation marks, but the apostrophe is
depicted as a neutral (vertical) glyph, whereas the grave accent
0x60 and acute accent 0xB4 are mirror-symmetric diacritical
marks.
Note that this change has no effect on _input_ conventions for
roff source documents. You can still get directional single
quotes on UTF-8, PostScript, PDF, and other output devices
supporting them by typing sequences like `this' in the input
{character remapping with ".char" requests and similar
notwithstanding}.
Patch and idea from Ingo Schwarze, who originally proposed it
for ASCII as well, and included Latin-1 for parallelism.
The groff developers could reach no consensus about the wisdom
of such a change for ASCII (which was designed to support
ambiguity for some code points, requiring the development of
supplementary interpretation conventions between parties).
ECMA-94/ISO-8859 is more strongly prescriptive.
See https://savannah.gnu.org/bugs/?55616 and the groff mailing
list archives for 31 January to 23 February 2019 at
https://lists.gnu.org/archive/html/groff for lengthy discussion.
* src/roff/groff/tests/on-latin1-device-oq-is-0x27.sh: Check for
correct output glyph.
* src/roff/groff/groff.am: Add test.
2019-06-28 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/unicode.tmac: Save and restore compatibility mode since
the script uses a GNU extension (.char).
2019-06-27 G. Branden Robinson <g.branden.robinson@gmail.com>
libdriver: Fix SEGV (Savannah #56555).
* src/libs/libdriver/printer.cpp: Check result of
set_char_and_width() for error condition before relying on it.
* src/roff/groff/tests/regression-56555.sh: Provoke segfault
with five bytes of input using transparent line indicator.
* src/roff/groff/groff.am: Add test.
2019-01-12 Ingo Schwarze <schwarze@openbsd.org>
Correctly handle groff_mdoc(7) .Lk arguments starting with a
dot.
* tmac/doc.tmac-u: Each argument to the .Lk macro is printed
on its own roff input line. If it happens to start with a dot
or apostroph, it was misinterpreted as a request or macro.
Force it to be treated as text by adding "\&" in front of it.
2018-12-31 Ingo Schwarze <schwarze@openbsd.org>
* man/groff_diff.7.man: remove two stray .RE macros
________________________________________________________________________
##### License
Copyright 2018-2021 Free Software Foundation, Inc.
Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
notice and this notice are preserved.
##### Editor settings
Local Variables:
fill-column: 72
mode: change-log
version-control: never
End:
vim:set autoindent textwidth=72:
|