summaryrefslogtreecommitdiff
path: root/elpa/transient-0.8.6/transient.info
blob: 590e39580e40211e87d6f01368c65ea3b74c5c9e (plain)
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
This is doccZhEUk.info, produced by makeinfo version 6.8 from
transient.texi.

     Copyright (C) 2018–2025 Free Software Foundation, Inc.

     You can redistribute this document and/or modify it under the terms
     of the GNU General Public License as published by the Free Software
     Foundation, either version 3 of the License, or (at your option)
     any later version.

     This document is distributed in the hope that it will be useful,
     but WITHOUT ANY WARRANTY; without even the implied warranty of
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
     General Public License for more details.

INFO-DIR-SECTION Emacs misc features
START-INFO-DIR-ENTRY
* Transient: (transient). Transient Commands.
END-INFO-DIR-ENTRY


File: doccZhEUk.info,  Node: Top,  Next: Introduction,  Up: (dir)

Transient User and Developer Manual
***********************************

Transient is the library used to implement the keyboard-driven “menus”
in Magit.  It is distributed as a separate package, so that it can be
used to implement similar menus in other packages.

   This manual can be bit hard to digest when getting started.  A useful
resource to get over that hurdle is Psionic K’s interactive tutorial,
available at <https://github.com/positron-solutions/transient-showcase>.

This manual is for Transient version 0.8.6.

     Copyright (C) 2018–2025 Free Software Foundation, Inc.

     You can redistribute this document and/or modify it under the terms
     of the GNU General Public License as published by the Free Software
     Foundation, either version 3 of the License, or (at your option)
     any later version.

     This document is distributed in the hope that it will be useful,
     but WITHOUT ANY WARRANTY; without even the implied warranty of
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
     General Public License for more details.

* Menu:

* Introduction::
* Usage::
* Modifying Existing Transients::
* Defining New Commands::
* Classes and Methods::
* FAQ::
* Keystroke Index::
* Command and Function Index::
* Variable Index::
* Concept Index::
* GNU General Public License::

— The Detailed Node Listing —

Usage

* Invoking Transients::
* Aborting and Resuming Transients::
* Common Suffix Commands::
* Saving Values::
* Using History::
* Getting Help for Suffix Commands::
* Enabling and Disabling Suffixes::
* Other Commands::
* Configuration::

Defining New Commands

* Technical Introduction::
* Defining Transients::
* Binding Suffix and Infix Commands::
* Defining Suffix and Infix Commands::
* Using Infix Arguments::
* Using Prefix Scope::
* Current Suffix Command::
* Current Prefix Command::
* Transient State::

Binding Suffix and Infix Commands

* Group Specifications::
* Suffix Specifications::


Classes and Methods

* Group Classes::
* Group Methods::
* Prefix Classes::
* Suffix Classes::
* Prefix Methods::
* Suffix Methods::
* Prefix Slots::
* Suffix Slots::
* Predicate Slots::

Suffix Methods

* Suffix Value Methods::
* Suffix Format Methods::




File: doccZhEUk.info,  Node: Introduction,  Next: Usage,  Prev: Top,  Up: Top

1 Introduction
**************

Transient is the library used to implement the keyboard-driven “menus”
in Magit.  It is distributed as a separate package, so that it can be
used to implement similar menus in other packages.

   This manual can be bit hard to digest when getting started.  A useful
resource to get over that hurdle is Psionic K’s interactive tutorial,
available at <https://github.com/positron-solutions/transient-showcase>.

Some things that Transient can do
=================================

   • Display current state of arguments
   • Display and manage lifecycle of modal bindings
   • Contextual user interface
   • Flow control for wizard-like composition of interactive forms
   • History & persistence
   • Rendering arguments for controlling CLI programs

Complexity in CLI programs
==========================

Complexity tends to grow with time.  How do you manage the complexity of
commands?  Consider the humble shell command ‘ls’.  It now has over
_fifty_ command line options.  Some of these are boolean flags (‘ls
-l’).  Some take arguments (‘ls --sort=s’).  Some have no effect unless
paired with other flags (‘ls -lh’).  Some are mutually exclusive.  Some
shell commands even have so many options that they introduce
_subcommands_ (‘git branch’, ‘git commit’), each with their own rich set
of options (‘git branch -f’).

Using Transient for composing interactive commands
==================================================

What about Emacs commands used interactively?  How do these handle
options?  One solution is to make many versions of the same command, so
you don’t need to!  Consider: ‘delete-other-windows’ vs.
‘delete-other-windows-vertically’ (among many similar examples).

   Some Emacs commands will simply prompt you for the next "argument"
(‘M-x switch-to-buffer’).  Another common solution is to use prefix
arguments which usually start with ‘C-u’.  Sometimes these are sensibly
numerical in nature (‘C-u 4 M-x forward-paragraph’ to move forward 4
paragraphs).  But sometimes they function instead as boolean "switches"
(‘C-u C-SPACE’ to jump to the last mark instead of just setting it, ‘C-u
C-u C-SPACE’ to unconditionally set the mark).  Since there aren’t many
standards for the use of prefix options, you have to read the command’s
documentation to find out what the possibilities are.

   But when an Emacs command grows to have a truly large set of options
and arguments, with dependencies between them, lots of option values,
etc., these simple approaches just don’t scale.  Transient is designed
to solve this issue.  Think of it as the humble prefix argument ‘C-u’,
_raised to the power of 10_.  Like ‘C-u’, it is key driven.  Like the
shell, it supports boolean "flag" options, options that take arguments,
and even "sub-commands", with their own options.  But instead of
searching through a man page or command documentation, well-designed
transients _guide_ their users to the relevant set of options (and even
their possible values!)  directly, taking into account any important
pre-existing Emacs settings.  And while for shell commands like ‘ls’,
there is only one way to "execute" (hit ‘Return’!), transients can
"execute" using multiple different keys tied to one of many
self-documenting _actions_ (imagine having 5 different colored return
keys on your keyboard!).  Transients make navigating and setting large,
complex groups of command options and arguments easy.  Fun even.  Once
you’ve tried it, it’s hard to go back to the ‘C-u what can I do here
again?’ way.


File: doccZhEUk.info,  Node: Usage,  Next: Modifying Existing Transients,  Prev: Introduction,  Up: Top

2 Usage
*******

* Menu:

* Invoking Transients::
* Aborting and Resuming Transients::
* Common Suffix Commands::
* Saving Values::
* Using History::
* Getting Help for Suffix Commands::
* Enabling and Disabling Suffixes::
* Other Commands::
* Configuration::


File: doccZhEUk.info,  Node: Invoking Transients,  Next: Aborting and Resuming Transients,  Up: Usage

2.1 Invoking Transients
=======================

A transient prefix command is invoked like any other command by pressing
the key that is bound to that command.  The main difference to other
commands is that a transient prefix command activates a transient
keymap, which temporarily binds the transient’s infix and suffix
commands, and that those bindings are displayed in a transient menu,
displayed in a popup buffer.  Bindings from other keymaps may, or may
not, be disabled while the transient state is in effect.

   There are two kinds of commands that are available after invoking a
transient prefix command; infix and suffix commands.  Infix commands set
some value (which is then shown in the popup buffer), without leaving
the transient.  Suffix commands, on the other hand, usually quit the
transient and they may use the values set by the infix commands, i.e.,
the infix *arguments*.

   Instead of setting arguments to be used by a suffix command, infix
commands may also set some value by side-effect, e.g., by setting the
value of some variable.


File: doccZhEUk.info,  Node: Aborting and Resuming Transients,  Next: Common Suffix Commands,  Prev: Invoking Transients,  Up: Usage

2.2 Aborting and Resuming Transients
====================================

To quit the transient without invoking a suffix command press ‘C-g’.

   Key bindings in transient keymaps may be longer than a single event.
After pressing a valid prefix key, all commands whose bindings do not
begin with that prefix key are temporarily unavailable and grayed out.
To abort the prefix key press ‘C-g’ (which in this case only quits the
prefix key, but not the complete transient).

   A transient prefix command can be bound as a suffix of another
transient.  Invoking such a suffix replaces the current transient state
with a new transient state, i.e., the available bindings change and the
information displayed in the popup buffer is updated accordingly.
Pressing ‘C-g’ while a nested transient is active only quits the
innermost transient, causing a return to the previous transient.

   ‘C-q’ or ‘C-z’ on the other hand always exits all transients.  If you
use the latter, then you can later resume the stack of transients using
‘M-x transient-resume’.

Key: C-g (transient-quit-seq)

Key: C-g (transient-quit-one)
     This key quits the currently active incomplete key sequence, if
     any, or else the current transient.  When quitting the current
     transient, it returns to the previous transient, if any.

   Transient’s predecessor bound ‘q’ instead of ‘C-g’ to the quit
command.  To learn how to get that binding back see
‘transient-bind-q-to-quit’’s documentation string.

Key: C-q (transient-quit-all)
     This command quits the currently active incomplete key sequence, if
     any, and all transients, including the active transient and all
     suspended transients, if any.

Key: C-z (transient-suspend)
     Like ‘transient-quit-all’, this command quits an incomplete key
     sequence, if any, and all transients.  Additionally, it saves the
     stack of transients so that it can easily be resumed (which is
     particularly useful if you quickly need to do “something else” and
     the stack is deeper than a single transient, and/or you have
     already changed the values of some infix arguments).

     Note that only a single stack of transients can be saved at a time.
     If another stack is already saved, then saving a new stack discards
     the previous stack.

Key: M-x transient-resume
     This command resumes the previously suspended stack of transients,
     if any.


File: doccZhEUk.info,  Node: Common Suffix Commands,  Next: Saving Values,  Prev: Aborting and Resuming Transients,  Up: Usage

2.3 Common Suffix Commands
==========================

A few shared suffix commands are available in all transients.  These
suffix commands are not shown in the popup buffer by default.

   This includes the aborting commands mentioned in the previous
section, as well as some other commands that are all bound to ‘C-x KEY’.
After ‘C-x’ is pressed, a section featuring all these common commands is
temporarily shown in the popup buffer.  After invoking one of them, the
section disappears again.  Note, however, that one of these commands is
described as “Show common permanently”; invoke that if you want the
common commands to always be shown for all transients.

Key: C-x t (transient-toggle-common)
     This command toggles whether the generic commands that are common
     to all transients are always displayed or only after typing the
     incomplete prefix key sequence ‘C-x’.  This only affects the
     current Emacs session.

User Option: transient-show-common-commands
     This option controls whether shared suffix commands are shown
     alongside the transient-specific infix and suffix commands.  By
     default, the shared commands are not shown to avoid overwhelming
     the user with too many options.

     While a transient is active, pressing ‘C-x’ always shows the common
     commands.  The value of this option can be changed for the current
     Emacs session by typing ‘C-x t’ while a transient is active.

   The other common commands are described in either the previous or in
one of the following sections.


File: doccZhEUk.info,  Node: Saving Values,  Next: Using History,  Prev: Common Suffix Commands,  Up: Usage

2.4 Saving Values
=================

After setting the infix arguments in a transient, the user can save
those arguments for future invocations.

   Most transients will start out with the saved arguments when they are
invoked.  There are a few exceptions, though.  Some transients are
designed so that the value that they use is stored externally as the
buffer-local value of some variable.  Invoking such a transient again
uses the buffer-local value.  (1)

   If the user does not save the value and just exits using a regular
suffix command, then the value is merely saved to the transient’s
history.  That value won’t be used when the transient is next invoked,
but it is easily accessible (see *note Using History::).

Key: C-x s (transient-set)
     This command saves the value of the active transient for this Emacs
     session.

Key: C-x C-s (transient-save)
     This command saves the value of the active transient persistently
     across Emacs sessions.

Key: C-x C-k (transient-reset)
     This command clears the set and saved values of the active
     transient.

User Option: transient-values-file
     This option names the file that is used to persist the values of
     transients between Emacs sessions.

   ---------- Footnotes ----------

   (1) ‘magit-diff’ and ‘magit-log’ are two prominent examples, and
their handling of buffer-local values is actually a bit more complicated
than outlined above and even customizable.


File: doccZhEUk.info,  Node: Using History,  Next: Getting Help for Suffix Commands,  Prev: Saving Values,  Up: Usage

2.5 Using History
=================

Every time the user invokes a suffix command the transient’s current
value is saved to its history.  These values can be cycled through, the
same way one can cycle through the history of commands that read
user-input in the minibuffer.

Key: C-M-p (transient-history-prev)

Key: C-x p
     This command switches to the previous value used for the active
     transient.

Key: C-M-n (transient-history-next)

Key: C-x n
     This command switches to the next value used for the active
     transient.

   In addition to the transient-wide history, infixes can have their own
history.  When an infix reads user-input using the minibuffer, the user
can use the regular minibuffer history commands to cycle through
previously used values.  Usually the same keys as those mentioned above
are bound to those commands.

   Authors of transients should arrange for different infix commands
that read the same kind of value to also use the same history key (see
*note Suffix Slots::).

   Both kinds of history are saved to a file when Emacs is exited.

User Option: transient-save-history
     This option controls whether the history of transient commands is
     saved when exiting Emacs.

User Option: transient-history-file
     This option names the file that is used to persist the history of
     transients and their infixes between Emacs sessions.

User Option: transient-history-limit
     This option controls how many history elements are kept at the time
     the history is saved in ‘transient-history-file’.


File: doccZhEUk.info,  Node: Getting Help for Suffix Commands,  Next: Enabling and Disabling Suffixes,  Prev: Using History,  Up: Usage

2.6 Getting Help for Suffix Commands
====================================

Transients can have many suffixes and infixes that the user might not be
familiar with.  To make it trivial to get help for these, Transient
provides access to the documentation directly from the active transient.

Key: C-h (transient-help)
     This command enters help mode.  When help mode is active, typing a
     key shows information about the suffix command that the key
     normally is bound to (instead of invoking it).  Pressing ‘C-h’ a
     second time shows information about the _prefix_ command.

     After typing a key, the stack of transient states is suspended and
     information about the suffix command is shown instead.  Typing ‘q’
     in the help buffer buries that buffer and resumes the transient
     state.

   What sort of documentation is shown depends on how the transient was
defined.  For infix commands that represent command-line arguments this
ideally shows the appropriate manpage.  ‘transient-help’ then tries to
jump to the correct location within that.  Info manuals are also
supported.  The fallback is to show the command’s documentation string,
for non-infix suffixes this is usually appropriate.


File: doccZhEUk.info,  Node: Enabling and Disabling Suffixes,  Next: Other Commands,  Prev: Getting Help for Suffix Commands,  Up: Usage

2.7 Enabling and Disabling Suffixes
===================================

The user base of a package that uses transients can be very diverse.
This is certainly the case for Magit; some users have been using it and
Git for a decade, while others are just getting started now.

   For that reason a mechanism is needed that authors can use to
classify a transient’s infixes and suffixes along the
essentials...everything spectrum.  We use the term “levels” to describe
that mechanism.

   Each suffix command is placed on a level and each transient has a
level (called “transient-level”), which controls which suffix commands
are available.  Integers between 1 and 7 (inclusive) are valid levels.
For suffixes, 0 is also valid; it means that the suffix is not displayed
at any level.

   The levels of individual transients and/or their individual suffixes
can be changed interactively, by invoking the transient and then
pressing ‘C-x l’ to enter the “edit” mode, see below.

   The default level for both transients and their suffixes is 4.  The
‘transient-default-level’ option only controls the default for
transients.  The default suffix level is always 4.  The authors of
transients should place certain suffixes on a higher level, if they
expect that it won’t be of use to most users, and they should place very
important suffixes on a lower level, so that they remain available even
if the user lowers the transient level.

User Option: transient-default-level
     This option controls which suffix levels are made available by
     default.  It sets the transient-level for transients for which the
     user has not set that individually.

User Option: transient-levels-file
     This option names the file that is used to persist the levels of
     transients and their suffixes between Emacs sessions.

Key: C-x l (transient-set-level)
     This command enters edit mode.  When edit mode is active, then all
     infixes and suffixes that are currently usable are displayed along
     with their levels.  The colors of the levels indicate whether they
     are enabled or not.  The level of the transient is also displayed
     along with some usage information.

     In edit mode, pressing the key that would usually invoke a certain
     suffix instead prompts the user for the level that suffix should be
     placed on.

     Help mode is available in edit mode.

     To change the transient level press ‘C-x l’ again.

     To exit edit mode press ‘C-g’.

     Note that edit mode does not display any suffixes that are not
     currently usable.  ‘magit-rebase’, for example, shows different
     suffixes depending on whether a rebase is already in progress or
     not.  The predicates also apply in edit mode.

     Therefore, to control which suffixes are available given a certain
     state, you have to make sure that that state is currently active.

Key: C-x a (transient-toggle-level-limit)
     This command toggle whether suffixes that are on levels higher than
     the level specified by ‘transient-default-level’ are temporarily
     available anyway.

Function: transient-set-default-level suffix level
     This function sets the default level of the suffix COMMAND to
     LEVEL.

     If a suffix command appears in multiple menus, it may make sense to
     consistently change its level in all those menus at once.  For
     example, the ‘--gpg-sign’ argument (which is implemented using the
     command ‘magit:--gpg-sign’), is bound in all of Magit’s menu which
     create commits.  Users who sometimes sign their commits would want
     that argument to be available in all of these menus, while for
     users who never sign it is just unnecessary noise in any menus.

     To always make ‘--gpg-sign’ available, use:

          (transient-set-default-level 'magit:--gpg-sign 1)

     To never make ‘--gpg-sign’ available, use:

          (transient-set-default-level 'magit:--gpg-sign 0)

     This sets the level in the suffix prototype object for this
     command.  Commands only have a suffix prototype if they were
     defined using one of ‘transient-define-argument’,
     ‘transient-define-infix’ and ‘transient-define-suffix’.  For all
     other commands this would signal an error.  (This is one of the
     reasons why package authors should use one of these functions to
     define shared suffix commands, and especially shared arguments.)

     If the user changes the level of a suffix in a particular menu,
     using ‘C-x l’ as shown above, then that obviously shadows the
     default.

     It is also possible to set the level of a suffix binding in a
     particular menu, either when defining the menu using
     ‘transient-define-prefix,’ or later using
     ‘transient-insert-suffix’.  If such bindings specify a level, then
     that also overrides the default.  (Per-suffix default levels is a
     new feature, so you might encounter this quite often.)


File: doccZhEUk.info,  Node: Other Commands,  Next: Configuration,  Prev: Enabling and Disabling Suffixes,  Up: Usage

2.8 Other Commands
==================

When invoking a transient in a small frame, the transient window may not
show the complete buffer, making it necessary to scroll, using the
following commands.  These commands are never shown in the transient
window, and the key bindings are the same as for ‘scroll-up-command’ and
‘scroll-down-command’ in other buffers.

Command: transient-scroll-up arg
     This command scrolls text of transient popup window upward ARG
     lines.  If ARG is ‘nil’, then it scrolls near full screen.  This is
     a wrapper around ‘scroll-up-command’ (which see).

Command: transient-scroll-down arg
     This command scrolls text of transient popup window down ARG lines.
     If ARG is ‘nil’, then it scrolls near full screen.  This is a
     wrapper around ‘scroll-down-command’ (which see).

   The following commands are not available by default.  If you would
like to use them for all menus, bind them in ‘transient-map’.

Command: transient-copy-menu-text
     This command copies the contents of the menu buffer to the kill
     ring.

Command: transient-toggle-docstrings
     This command toggle between showing suffix descriptions in the menu
     (as usual) or showing the first lines of the respective docstrings
     in their place.  For commands that do not have a docstring, always
     display the suffix description.  Because there likely isn’t enough
     room to display multiple docstrings side-by-side, a single column
     is used when displaying docstrings.


File: doccZhEUk.info,  Node: Configuration,  Prev: Other Commands,  Up: Usage

2.9 Configuration
=================

More options are described in *note Common Suffix Commands::, in *note
Saving Values::, in *note Using History:: and in *note Enabling and
Disabling Suffixes::.

Essential Options
-----------------

Also see *note Common Suffix Commands::.

User Option: transient-show-popup
     This option controls whether the current transient’s infix and
     suffix commands are shown in the popup buffer.

        • If ‘t’ (the default) then the popup buffer is shown as soon as
          a transient prefix command is invoked.

        • If ‘nil’, then the popup buffer is not shown unless the user
          explicitly requests it, by pressing an incomplete prefix key
          sequence.

        • If a number, then the a brief one-line summary is shown
          instead of the popup buffer.  If zero or negative, then not
          even that summary is shown; only the pressed key itself is
          shown.

          The popup is shown when the user explicitly requests it by
          pressing an incomplete prefix key sequence.  Unless this is
          zero, the popup is shown after that many seconds of inactivity
          (using the absolute value).

User Option: transient-show-common-commands
     This option controls whether shared suffix commands are shown
     alongside the transient-specific infix and suffix commands.  By
     default, the shared commands are not shown to avoid overwhelming
     the user with too many options.

     While a transient is active, pressing ‘C-x’ always shows the common
     commands.  The value of this option can be changed for the current
     Emacs session by typing ‘C-x t’ while a transient is active.

User Option: transient-show-during-minibuffer-read
     This option controls whether the transient menu continues to be
     displayed while the minibuffer is used to read user input.

     This is only relevant to commands that do not close the menu, such
     as commands that set infix arguments.  If a command exits the menu,
     and uses the minibuffer, then the menu is always closed before the
     minibuffer is entered, irrespective of the value of this option.

     When ‘nil’ (the default), hide the menu while the minibuffer is in
     use.  When ‘t’, keep showing the menu, but allow for the menu
     window to be resized, to ensure that completion candidates can be
     displayed.

     When ‘fixed’, keep showing the menu and prevent it from being
     resized, which may make it impossible to display the completion
     candidates.  If that ever happens for you, consider using ‘t’ or an
     integer, as described below.

     If the value is ‘fixed’ and the menu window uses the full height of
     its frame, then the former is ignored and resizing is allowed
     anyway.  This is necessary because individual menus may use unusual
     display actions different from what
     ‘transient-display-buffer-action’ specifies (likely to display that
     menu in a side-window).

     When using a third-party mode, which automatically resizes windows
     (e.g., by calling ‘balance-windows’ on ‘post-command-hook’), then
     ‘fixed’ (or ‘nil’) is likely a better choice than ‘t’.

     The value can also be an integer, in which case the behavior
     depends on whether at least that many lines are left to display
     windows other than the menu window.  If that is the case, display
     the menu and preserve the size of that window.  Otherwise, allow
     resizing the menu window if the number is positive, or hide the
     menu if it is negative.

User Option: transient-read-with-initial-input
     This option controls whether the last history element is used as
     the initial minibuffer input when reading the value of an infix
     argument from the user.  If ‘nil’, there is no initial input and
     the first element has to be accessed the same way as the older
     elements.

User Option: transient-enable-popup-navigation
     This option controls whether navigation commands are enabled in the
     transient popup buffer.  If the value is ‘verbose’ (the default),
     brief documentation about the command under point is additionally
     show in the echo area.

     While a transient is active the transient popup buffer is not the
     current buffer, making it necessary to use dedicated commands to
     act on that buffer itself.  If this option is non-‘nil’, then the
     following features are available:

        • ‘<UP>’ moves the cursor to the previous suffix.
        • ‘<DOWN>’ moves the cursor to the next suffix.
        • ‘M-<RET>’ invokes the suffix the cursor is on.
        • ‘mouse-1’ invokes the clicked on suffix.
        • ‘C-s’ and ‘C-r’ start isearch in the popup buffer.

     By default ‘M-<RET>’ is bound to ‘transient-push-button’, instead
     of ‘<RET>’, because if a transient allows the invocation of
     non-suffixes, then it is likely, that you would want ‘<RET>’ to do
     what it would do if no transient were active."

User Option: transient-display-buffer-action
     This option specifies the action used to display the transient
     popup buffer.  The transient popup buffer is displayed in a window
     using ‘(display-buffer BUFFER transient-display-buffer-action)’.

     The value of this option has the form ‘(FUNCTION . ALIST)’, where
     FUNCTION is a function or a list of functions.  Each such function
     should accept two arguments: a buffer to display and an alist of
     the same form as ALIST.  See *note (elisp)Choosing Window::, for
     details.

     The default is:

          (display-buffer-in-side-window
           (side . bottom)
           (dedicated . t)
           (inhibit-same-window . t))

     This displays the window at the bottom of the selected frame.  For
     alternatives see *note (elisp)Buffer Display Action Functions::,
     and *note (elisp)Buffer Display Action Alists::.

     When you switch to a different ACTION, you should keep the ALIST
     entries for ‘dedicated’ and ‘inhibit-same-window’ in most cases.
     Do not drop them because you are unsure whether they are needed; if
     you are unsure, then keep them.

     Note that the buffer that was current before the transient buffer
     is shown should remain the current buffer.  Many suffix commands
     act on the thing at point, if appropriate, and if the transient
     buffer became the current buffer, then that would change what is at
     point.  To that effect ‘inhibit-same-window’ ensures that the
     selected window is not used to show the transient buffer.

     It may be possible to display the window in another frame, but
     whether that works in practice depends on the window-manager.  If
     the window manager selects the new window (Emacs frame), then that
     unfortunately changes which buffer is current.

     If you change the value of this option, then you might also want to
     change the value of ‘transient-mode-line-format’.

     This user option may be overridden if ‘:display-action’ is passed
     when creating a new prefix with ‘transient-define-prefix’.

Accessibility Options
---------------------

User Option: transient-force-single-column
     This option controls whether the use of a single column to display
     suffixes is enforced.  This might be useful for users with low
     vision who use large text and might otherwise have to scroll in two
     dimensions.

Auxiliary Options
-----------------

User Option: transient-mode-line-format
     This option controls whether the transient popup buffer has a
     mode-line, separator line, or neither.

     If ‘nil’, then the buffer has no mode-line.  If the buffer is not
     displayed right above the echo area, then this probably is not a
     good value.

     If ‘line’ (the default) or a natural number, then the buffer has no
     mode-line, but a line is drawn in its place.  If a number is used,
     that specifies the thickness of the line.  On termcap frames we
     cannot draw lines, so there ‘line’ and numbers are synonyms for
     ‘nil’.

     The color of the line is used to indicate if non-suffixes are
     allowed and whether they exit the transient.  The foreground color
     of ‘transient-key-noop’ (if non-suffixes are disallowed),
     ‘transient-key-stay’ (if allowed and transient stays active), or
     ‘transient-key-exit’ (if allowed and they exit the transient) is
     used to draw the line.

     This user option may be overridden if ‘:mode-line-format’ is passed
     when creating a new prefix with ‘transient-define-prefix’.

     Otherwise this can be any mode-line format.  See *note (elisp)Mode
     Line Format::, for details.

User Option: transient-semantic-coloring
     This option controls whether colors are used to indicate the
     transient behavior of commands.

     If non-‘nil’, then the key binding of each suffix is colorized to
     indicate whether it exits the transient state or not.  The color of
     the prefix is indicated using the line that is drawn when the value
     of ‘transient-mode-line-format’ is ‘line’.

User Option: transient-highlight-mismatched-keys
     This option controls whether key bindings of infix commands that do
     not match the respective command-line argument should be
     highlighted.  For other infix commands this option has no effect.

     When this option is non-‘nil’, the key binding for an infix
     argument is highlighted when only a long argument (e.g.,
     ‘--verbose’) is specified but no shorthand (e.g., ‘-v’).  In the
     rare case that a shorthand is specified but the key binding does
     not match, then it is highlighted differently.

     Highlighting mismatched key bindings is useful when learning the
     arguments of the underlying command-line tool; you wouldn’t want to
     learn any short-hands that do not actually exist.

     The highlighting is done using one of the faces
     ‘transient-mismatched-key’ and ‘transient-nonstandard-key’.

User Option: transient-substitute-key-function
     This function is used to modify key bindings.  If the value of this
     option is ‘nil’ (the default), then no substitution is performed.

     This function is called with one argument, the prefix object, and
     must return a key binding description, either the existing key
     description it finds in the ‘key’ slot, or the key description that
     replaces the prefix key.  It could be used to make other
     substitutions, but that is discouraged.

     For example, ‘=’ is hard to reach using my custom keyboard layout,
     so I substitute ‘(’ for that, which is easy to reach using a layout
     optimized for lisp.

          (setq transient-substitute-key-function
                (lambda (obj)
                  (let ((key (oref obj key)))
                    (if (string-match "\\`\\(=\\)[a-zA-Z]" key)
                        (replace-match "(" t t key 1)
                      key))))

User Option: transient-align-variable-pitch
     This option controls whether columns are aligned pixel-wise in the
     popup buffer.

     If this is non-‘nil’, then columns are aligned pixel-wise to
     support variable-pitch fonts.  Keys are not aligned, so you should
     use a fixed-pitch font for the ‘transient-key’ face.  Other key
     faces inherit from that face unless a theme is used that breaks
     that relationship.

     This option is intended for users who use a variable-pitch font for
     the ‘default’ face.

User Option: transient-force-fixed-pitch
     This option controls whether to force the use of a monospaced font
     in popup buffer.  Even if you use a proportional font for the
     ‘default’ face, you might still want to use a monospaced font in
     transient’s popup buffer.  Setting this option to ‘t’ causes
     ‘default’ to be remapped to ‘fixed-pitch’ in that buffer.

Developer Options
-----------------

These options are mainly intended for developers.

User Option: transient-detect-key-conflicts
     This option controls whether key binding conflicts should be
     detected at the time the transient is invoked.  If so, this results
     in an error, which prevents the transient from being used.  Because
     of that, conflicts are ignored by default.

     Conflicts cannot be determined earlier, i.e., when the transient is
     being defined and when new suffixes are being added, because at
     that time there can be false-positives.  It is actually valid for
     multiple suffixes to share a common key binding, provided the
     predicates of those suffixes prevent that more than one of them is
     enabled at a time.

User Option: transient-highlight-higher-levels
     This option controls whether suffixes that would not be available
     by default are highlighted.

     When non-‘nil’ then the descriptions of suffixes are highlighted if
     their level is above 4, the default of ‘transient-default-level’.
     Assuming you have set that variable to 7, this highlights all
     suffixes that won’t be available to users without them making the
     same customization.

Hook Variables
--------------

Variable: transient-exit-hook
     This hook is run after a transient is exited.

Variable: transient-setup-buffer-hook
     This hook is run when the transient buffer is being setup.  That
     buffer is current and empty when this hook is runs.


File: doccZhEUk.info,  Node: Modifying Existing Transients,  Next: Defining New Commands,  Prev: Usage,  Up: Top

3 Modifying Existing Transients
*******************************

To an extent, transients can be customized interactively, see *note
Enabling and Disabling Suffixes::.  This section explains how existing
transients can be further modified non-interactively.  Let’s begin with
an example:

     (transient-append-suffix 'magit-patch-apply "-3"
       '("-R" "Apply in reverse" "--reverse"))

   This inserts a new infix argument to toggle the ‘--reverse’ argument
after the infix argument that toggles ‘-3’ in ‘magit-patch-apply’.

   The following functions share a few arguments:

   • PREFIX is a transient prefix command, a symbol.

   • SUFFIX is a transient infix or suffix specification in the same
     form as expected by ‘transient-define-prefix’.  Note that an infix
     is a special kind of suffix.  Depending on context “suffixes” means
     “suffixes (including infixes)” or “non-infix suffixes”.  Here it
     means the former.  See *note Suffix Specifications::.

     SUFFIX may also be a group in the same form as expected by
     ‘transient-define-prefix’.  See *note Group Specifications::.

   • LOC is a command, a key vector, a key description (a string as
     returned by ‘key-description’), or a list specifying coordinates
     (the last element may also be a command or key).  For example ‘(1 0
     -1)’ identifies the last suffix (‘-1’) of the first subgroup (‘0’)
     of the second group (‘1’).

     If LOC is a list of coordinates, then it can be used to identify a
     group, not just an individual suffix command.

     The function ‘transient-get-suffix’ can be useful to determine
     whether a certain coordination list identifies the suffix or group
     that you expect it to identify.  In hairy cases it may be necessary
     to look at the definition of the transient prefix command.

   These functions operate on the information stored in the
‘transient--layout’ property of the PREFIX symbol.  Suffix entries in
that tree are not objects but have the form ‘(LEVEL CLASS PLIST)’, where
PLIST should set at least ‘:key’, ‘:description’ and ‘:command’.

Function: transient-insert-suffix prefix loc suffix &optional keep-other

Function: transient-append-suffix prefix loc suffix &optional keep-other
     These functions insert the suffix or group SUFFIX into PREFIX
     before or after LOC.

     Conceptually adding a binding to a transient prefix is similar to
     adding a binding to a keymap, but this is complicated by the fact
     that multiple suffix commands can be bound to the same key,
     provided they are never active at the same time, see *note
     Predicate Slots::.

     Unfortunately both false-positives and false-negatives are
     possible.  To deal with the former use non-‘nil’ KEEP-OTHER.  The
     symbol ‘always’ prevents the removal of a false-positive in some
     cases where other non-‘nil’ values would fail.  To deal with
     false-negatives remove the conflicting binding separately, using
     ‘transient-remove-suffix’.

Function: transient-replace-suffix prefix loc suffix
     This function replaces the suffix or group at LOC in PREFIX with
     suffix or group SUFFIX.

Function: transient-remove-suffix prefix loc
     This function removes the suffix or group at LOC in PREFIX.

Function: transient-get-suffix prefix loc
     This function returns the suffix or group at LOC in PREFIX.  The
     returned value has the form mentioned above.

Function: transient-suffix-put prefix loc prop value
     This function edits the suffix or group at LOC in PREFIX, by
     setting the PROP of its plist to VALUE.

   Most of these functions do not signal an error if they cannot perform
the requested modification.  The functions that insert new suffixes show
a warning if LOC cannot be found in PREFIX without signaling an error.
The reason for doing it like this is that establishing a key binding
(and that is what we essentially are trying to do here) should not
prevent the rest of the configuration from loading.  Among these
functions only ‘transient-get-suffix’ and ‘transient-suffix-put’ may
signal an error.


File: doccZhEUk.info,  Node: Defining New Commands,  Next: Classes and Methods,  Prev: Modifying Existing Transients,  Up: Top

4 Defining New Commands
***********************

* Menu:

* Technical Introduction::
* Defining Transients::
* Binding Suffix and Infix Commands::
* Defining Suffix and Infix Commands::
* Using Infix Arguments::
* Using Prefix Scope::
* Current Suffix Command::
* Current Prefix Command::
* Transient State::


File: doccZhEUk.info,  Node: Technical Introduction,  Next: Defining Transients,  Up: Defining New Commands

4.1 Technical Introduction
==========================

Taking inspiration from prefix keys and prefix arguments, Transient
implements a similar abstraction involving a prefix command, infix
arguments and suffix commands.

   When the user calls a transient prefix command, a transient
(temporary) keymap is activated, which binds the transient’s infix and
suffix commands, and functions that control the transient state are
added to ‘pre-command-hook’ and ‘post-command-hook’.  The available
suffix and infix commands and their state are shown in a popup buffer
until the transient state is exited by invoking a suffix command.

   Calling an infix command causes its value to be changed.  How that is
done depends on the type of the infix command.  The simplest case is an
infix command that represents a command-line argument that does not take
a value.  Invoking such an infix command causes the switch to be toggled
on or off.  More complex infix commands may read a value from the user,
using the minibuffer.

   Calling a suffix command usually causes the transient to be exited;
the transient keymaps and hook functions are removed, the popup buffer
no longer shows information about the (no longer bound) suffix commands,
the values of some public global variables are set, while some internal
global variables are unset, and finally the command is actually called.
Suffix commands can also be configured to not exit the transient.

   A suffix command can, but does not have to, use the infix arguments
in much the same way any command can choose to use or ignore the prefix
arguments.  For a suffix command that was invoked from a transient, the
variable ‘transient-current-suffixes’ and the function ‘transient-args’
serve about the same purpose as the variables ‘prefix-arg’ and
‘current-prefix-arg’ do for any command that was called after the prefix
arguments have been set using a command such as ‘universal-argument’.

   Transient can be used to implement simple “command dispatchers”.  The
main benefit then is that the user can see all the available commands in
a popup buffer, which can be thought of as a “menu”.  That is useful by
itself because it frees the user from having to remember all the keys
that are valid after a certain prefix key or command.  Magit’s
‘magit-dispatch’ (on ‘C-x M-g’) command is an example of using Transient
to merely implement a command dispatcher.

   In addition to that, Transient also allows users to interactively
pass arguments to commands.  These arguments can be much more complex
than what is reasonable when using prefix arguments.  There is a limit
to how many aspects of a command can be controlled using prefix
arguments.  Furthermore, what a certain prefix argument means for
different commands can be completely different, and users have to read
documentation to learn and then commit to memory what a certain prefix
argument means to a certain command.

   Transient suffix commands, on the other hand, can accept dozens of
different arguments without the user having to remember anything.  When
using Transient, one can call a command with arguments that are just as
complex as when calling the same function non-interactively from Lisp.

   Invoking a transient suffix command with arguments is similar to
invoking a command in a shell with command-line completion and history
enabled.  One benefit of the Transient interface is that it remembers
history not only on a global level (“this command was invoked using
these arguments, and previously it was invoked using those other
arguments”), but also remembers the values of individual arguments
independently.  See *note Using History::.

   After a transient prefix command is invoked, ‘C-h KEY’ can be used to
show the documentation for the infix or suffix command that ‘KEY’ is
bound to (see *note Getting Help for Suffix Commands::), and infixes and
suffixes can be removed from the transient using ‘C-x l KEY’.  Infixes
and suffixes that are disabled by default can be enabled the same way.
See *note Enabling and Disabling Suffixes::.

   Transient ships with support for a few different types of specialized
infix commands.  A command that sets a command line option, for example,
has different needs than a command that merely toggles a boolean flag.
Additionally, Transient provides abstractions for defining new types,
which the author of Transient did not anticipate (or didn’t get around
to implementing yet).

   Note that suffix commands also support regular prefix arguments.  A
suffix command may even be called with both infix and prefix arguments
at the same time.  If you invoke a command as a suffix of a transient
prefix command, but also want to pass prefix arguments to it, then first
invoke the prefix command, and only after doing that invoke the prefix
arguments, before finally invoking the suffix command.  If you instead
began by providing the prefix arguments, then those would apply to the
prefix command, not the suffix command.  Likewise, if you want to change
infix arguments before invoking a suffix command with prefix arguments,
then change the infix arguments before invoking the prefix arguments.
In other words, regular prefix arguments always apply to the next
command, and since transient prefix, infix and suffix commands are just
regular commands, the same applies to them.  (Regular prefix keys behave
differently because they are not commands at all, instead they are just
incomplete key sequences, and those cannot be interrupted with prefix
commands.)


File: doccZhEUk.info,  Node: Defining Transients,  Next: Binding Suffix and Infix Commands,  Prev: Technical Introduction,  Up: Defining New Commands

4.2 Defining Transients
=======================

A transient consists of a prefix command and at least one suffix
command, though usually a transient has several infix and suffix
commands.  The below macro defines the transient prefix command *and*
binds the transient’s infix and suffix commands.  In other words, it
defines the complete transient, not just the transient prefix command
that is used to invoke that transient.

Macro: transient-define-prefix name arglist [docstring] [keyword value]... group... [body...]
     This macro defines NAME as a transient prefix command and binds the
     transient’s infix and suffix commands.

     ARGLIST are the arguments that the prefix command takes.  DOCSTRING
     is the documentation string and is optional.

     These arguments can optionally be followed by keyword-value pairs.
     Each key has to be a keyword symbol, either ‘:class’ or a keyword
     argument supported by the constructor of that class.  The
     ‘transient-prefix’ class is used if the class is not specified
     explicitly.

     GROUPs add key bindings for infix and suffix commands and specify
     how these bindings are presented in the popup buffer.  At least one
     GROUP has to be specified.  See *note Binding Suffix and Infix
     Commands::.

     The BODY is optional.  If it is omitted, then ARGLIST is ignored
     and the function definition becomes:

          (lambda ()
            (interactive)
            (transient-setup 'NAME))

     If BODY is specified, then it must begin with an ‘interactive’ form
     that matches ARGLIST, and it must call ‘transient-setup’.  It may,
     however, call that function only when some condition is satisfied.

     All transients have a (possibly ‘nil’) value, which is exported
     when suffix commands are called, so that they can consume that
     value.  For some transients it might be necessary to have a sort of
     secondary value, called a “scope”.  Such a scope would usually be
     set in the command’s ‘interactive’ form and has to be passed to the
     setup function:

          (transient-setup 'NAME nil nil :scope SCOPE)

     For example, the scope of the ‘magit-branch-configure’ transient is
     the branch whose variables are being configured.


File: doccZhEUk.info,  Node: Binding Suffix and Infix Commands,  Next: Defining Suffix and Infix Commands,  Prev: Defining Transients,  Up: Defining New Commands

4.3 Binding Suffix and Infix Commands
=====================================

The macro ‘transient-define-prefix’ is used to define a transient.  This
defines the actual transient prefix command (see *note Defining
Transients::) and adds the transient’s infix and suffix bindings, as
described below.

   Users and third-party packages can add additional bindings using
functions such as ‘transient-insert-suffix’ (see *note Modifying
Existing Transients::).  These functions take a “suffix specification”
as one of their arguments, which has the same form as the specifications
used in ‘transient-define-prefix’.

* Menu:

* Group Specifications::
* Suffix Specifications::


File: doccZhEUk.info,  Node: Group Specifications,  Next: Suffix Specifications,  Up: Binding Suffix and Infix Commands

4.3.1 Group Specifications
--------------------------

The suffix and infix commands of a transient are organized in groups.
The grouping controls how the descriptions of the suffixes are outlined
visually but also makes it possible to set certain properties for a set
of suffixes.

   Several group classes exist, some of which organize suffixes in
subgroups.  In most cases the class does not have to be specified
explicitly, but see *note Group Classes::.

   Groups are specified in the call to ‘transient-define-prefix’, using
vectors.  Because groups are represented using vectors, we cannot use
square brackets to indicate an optional element and instead use curly
brackets to do the latter.

   Group specifications then have this form:

     [{LEVEL} {DESCRIPTION} {KEYWORD VALUE}... ELEMENT...]

   The LEVEL is optional and defaults to 4.  See *note Enabling and
Disabling Suffixes::.

   The DESCRIPTION is optional.  If present, it is used as the heading
of the group.

   The KEYWORD-VALUE pairs are optional.  Each keyword has to be a
keyword symbol, either ‘:class’ or a keyword argument supported by the
constructor of that class.

   • One of these keywords, ‘:description’, is equivalent to specifying
     DESCRIPTION at the very beginning of the vector.  The
     recommendation is to use ‘:description’ if some other keyword is
     also used, for consistency, or DESCRIPTION otherwise, because it
     looks better.

   • Likewise ‘:level’ is equivalent to LEVEL.

   • Other important keywords include the ‘:if...’ and ‘:inapt-if...’
     keywords.  These keywords control whether the group is available in
     a certain situation.

     For example, one group of the ‘magit-rebase’ transient uses ‘:if
     magit-rebase-in-progress-p’, which contains the suffixes that are
     useful while rebase is already in progress; and another that uses
     ‘:if-not magit-rebase-in-progress-p’, which contains the suffixes
     that initiate a rebase.

     These predicates can also be used on individual suffixes and are
     only documented once, see *note Predicate Slots::.

   • The value of ‘:hide’, if non-‘nil’, is a predicate that controls
     whether the group is hidden by default.  The key bindings for
     suffixes of a hidden group should all use the same prefix key.
     Pressing that prefix key should temporarily show the group and its
     suffixes, which assumes that a predicate like this is used:

          (lambda ()
            (eq (car transient--redisplay-key)
                ?\C-c)) ; the prefix key shared by all bindings

   • The value of ‘:setup-children’, if non-‘nil’, is a function that
     takes one argument, a potentially list of children, and must return
     a list of children or an empty list.  This can either be used to
     somehow transform the group’s children that were defined the normal
     way, or to dynamically create the children from scratch.

     The returned children must have the same form as stored in the
     prefix’s ‘transient--layout’ property, but it is often more
     convenient to use the same form as understood by
     ‘transient-define-prefix’, described below.  If you use the latter
     approach, you can use the ‘transient-parse-suffixes’ and
     ‘transient-parse-suffix’ functions to transform them from the
     convenient to the expected form.  Depending on the used group
     class, ‘transient-parse-suffixes’’s SUFFIXES must be a list of
     group vectors (for ‘transient-columns’) or a list of suffix lists
     (for all other group classes).

     If you explicitly specify children and then transform them using
     ‘:setup-children’, then the class of the group is determined as
     usual, based on explicitly specified children.

     If you do not explicitly specify children and thus rely solely on
     ‘:setup-children’, then you must specify the class using ‘:class’.
     For backward compatibility, if you fail to do so,
     ‘transient-column’ is used and a warning is displayed.  This
     warning will eventually be replaced with an error.

          (transient-define-prefix my-finder-by-keyword ()
            "Select a keyword and list matching packages."
            ;; The real `finder-by-keyword' is more convenient
            ;; of course, but that is not the point here.
            [:class transient-columns
             :setup-children
             (lambda (_)
               (transient-parse-suffixes
                'my-finder-by-keyword
                (let ((char (1- ?A)))
                  (mapcar                  ; a list ...
                   (lambda (partition)
                     (vconcat              ; of group vectors ...
                      (mapcar (lambda (elt)
                                (let ((keyword (symbol-name (car elt))))
                                           ; ... where each suffix is a list
                                  (list (format "%c" (cl-incf char))
                                        keyword
                                        (lambda ()
                                          (interactive)
                                          (finder-list-matches keyword)))))
                              partition)))
                   (seq-partition finder-known-keywords 7)))))])

   • The boolean ‘:pad-keys’ argument controls whether keys of all
     suffixes contained in a group are right padded, effectively
     aligning the descriptions.

   • If a keyword argument accepts a function as value, you an use a
     ‘lambda’ expression.  As a special case, the ‘##’ macro (which
     returns a ‘lambda’ expression and is implemented in the ‘llama’
     package) is also supported.  Inside group specifications, the use
     of ‘##’ is not supported anywhere but directly following a keyword
     symbol.

   The ELEMENTs are either all subgroups, or all suffixes and strings.
(At least currently no group type exists that would allow mixing
subgroups with commands at the same level, though in principle there is
nothing that prevents that.)

   If the ELEMENTs are not subgroups, then they can be a mixture of
lists, which specify commands, and strings.  Strings are inserted
verbatim into the buffer.  The empty string can be used to insert gaps
between suffixes, which is particularly useful if the suffixes are
outlined as a table.

   Inside group specifications, including inside contained suffix
specifications, nothing has to be quoted and quoting anyway is invalid.
The value following a keyword, can be explicitly unquoted using ‘,’.
This feature is experimental and should be avoided.

   The form of suffix specifications is documented in the next node.


File: doccZhEUk.info,  Node: Suffix Specifications,  Prev: Group Specifications,  Up: Binding Suffix and Infix Commands

4.3.2 Suffix Specifications
---------------------------

A transient’s suffix and infix commands are bound when the transient
prefix command is defined using ‘transient-define-prefix’, see *note
Defining Transients::.  The commands are organized into groups, see
*note Group Specifications::.  Here we describe the form used to bind an
individual suffix command.

   The same form is also used when later binding additional commands
using functions such as ‘transient-insert-suffix’, see *note Modifying
Existing Transients::.

   Note that an infix is a special kind of suffix.  Depending on context
“suffixes” means “suffixes (including infixes)” or “non-infix suffixes”.
Here it means the former.

   Suffix specifications have this form:

     ([LEVEL] [KEY [DESCRIPTION]] COMMAND|ARGUMENT [KEYWORD VALUE]...)

   LEVEL, KEY and DESCRIPTION can also be specified using the KEYWORDs
‘:level’, ‘:key’ and ‘:description’.  If the object that is associated
with COMMAND sets these properties, then they do not have to be
specified here.  You can however specify them here anyway, possibly
overriding the object’s values just for the binding inside this
transient.

   • LEVEL is the suffix level, an integer between 1 and 7.  See *note
     Enabling and Disabling Suffixes::.

   • KEY is the key binding, either a vector or key description string.

   • DESCRIPTION is the description, either a string or a function that
     takes zero or one arguments (the suffix object) and returns a
     string.  The function should be a lambda expression to avoid
     ambiguity.  In some cases a symbol that is bound as a function
     would also work but to be safe you should use ‘:description’ in
     that case.

   The next element is either a command or an argument.  This is the
only argument that is mandatory in all cases.

   • COMMAND should be a symbol that is bound as a function, which has
     to be defined or at least autoloaded as a command by the time the
     containing prefix command is invoked.

     Any command will do; it does not need to have an object associated
     with it (as would be the case if ‘transient-define-suffix’ or
     ‘transient-define-infix’ were used to define it).

     COMMAND can also be a ‘lambda’ expression.

     As mentioned above, the object that is associated with a command
     can be used to set the default for certain values that otherwise
     have to be set in the suffix specification.  Therefore if there is
     no object, then you have to make sure to specify the KEY and the
     DESCRIPTION.

     As a special case, if you want to add a command that might be
     neither defined nor autoloaded, you can use a workaround like:

          (transient-insert-suffix 'some-prefix "k"
            '("!" "Ceci n'est pas une commande" no-command
              :if (lambda () (featurep 'no-library))))

     Instead of ‘featurep’ you could also use ‘require’ with a non-‘nil’
     value for NOERROR.

   • The mandatory argument can also be a command-line argument, a
     string.  In that case an anonymous command is defined and bound.

     Instead of a string, this can also be a list of two strings, in
     which case the first string is used as the short argument (which
     can also be specified using ‘:shortarg’) and the second as the long
     argument (which can also be specified using ‘:argument’).

     Only the long argument is displayed in the popup buffer.  See
     ‘transient-detect-key-conflicts’ for how the short argument may be
     used.

     Unless the class is specified explicitly, the appropriate class is
     guessed based on the long argument.  If the argument ends with ‘=’
     (e.g., ‘--format=’) then ‘transient-option’ is used, otherwise
     ‘transient-switch’.

   Finally, details can be specified using optional KEYWORD-VALUE pairs.
Each keyword has to be a keyword symbol, either ‘:class’ or a keyword
argument supported by the constructor of that class.  See *note Suffix
Slots::.

   If a keyword argument accepts a function as value, you an use a
‘lambda’ expression.  As a special case, the ‘##’ macro (which returns a
‘lambda’ expression and is implemented in the ‘llama’ package) is also
supported.  Inside suffix bindings, the use of ‘##’ is not supported
anywhere but directly following a keyword symbol.


File: doccZhEUk.info,  Node: Defining Suffix and Infix Commands,  Next: Using Infix Arguments,  Prev: Binding Suffix and Infix Commands,  Up: Defining New Commands

4.4 Defining Suffix and Infix Commands
======================================

Note that an infix is a special kind of suffix.  Depending on context
“suffixes” means “suffixes (including infixes)” or “non-infix suffixes”.

Macro: transient-define-suffix name arglist [docstring] [keyword value]... body...
     This macro defines NAME as a transient suffix command.

     ARGLIST are the arguments that the command takes.  DOCSTRING is the
     documentation string and is optional.

     These arguments can optionally be followed by keyword-value pairs.
     Each keyword has to be a keyword symbol, either ‘:class’ or a
     keyword argument supported by the constructor of that class.  The
     ‘transient-suffix’ class is used if the class is not specified
     explicitly.

     The BODY must begin with an ‘interactive’ form that matches
     ARGLIST.  The infix arguments are usually accessed by using
     ‘transient-args’ inside ‘interactive’.

Macro: transient-define-infix name arglist [docstring] [keyword value]...
     This macro defines NAME as a transient infix command.

     ARGLIST is always ignored (but mandatory never-the-less) and
     reserved for future use.  DOCSTRING is the documentation string and
     is optional.

     At least one key-value pair is required.  All transient infix
     commands are ‘equal’ to each other (but not ‘eq’).  It is
     meaningless to define an infix command, without providing at least
     one keyword argument (usually ‘:argument’ or ‘:variable’, depending
     on the class).  The suffix class defaults to ‘transient-switch’ and
     can be set using the ‘:class’ keyword.

     The function definition is always:

          (lambda ()
            (interactive)
            (let ((obj (transient-suffix-object)))
              (transient-infix-set obj (transient-infix-read obj)))
            (transient--show))

     ‘transient-infix-read’ and ‘transient-infix-set’ are generic
     functions.  Different infix commands behave differently because the
     concrete methods are different for different infix command classes.
     In rare cases the above command function might not be suitable,
     even if you define your own infix command class.  In that case you
     have to use ‘transient-define-suffix’ to define the infix command
     and use ‘t’ as the value of the ‘:transient’ keyword.

Macro: transient-define-argument name arglist [docstring] [keyword value]...
     This macro defines NAME as a transient infix command.

     This is an alias for ‘transient-define-infix’.  Only use this alias
     to define an infix command that actually sets an infix argument.
     To define an infix command that, for example, sets a variable, use
     ‘transient-define-infix’ instead.


File: doccZhEUk.info,  Node: Using Infix Arguments,  Next: Using Prefix Scope,  Prev: Defining Suffix and Infix Commands,  Up: Defining New Commands

4.5 Using Infix Arguments
=========================

The functions and the variables described below allow suffix commands to
access the value of the transient from which they were invoked; which is
the value of its infix arguments.  These variables are set when the user
invokes a suffix command that exits the transient, but before actually
calling the command.

   When returning to the command-loop after calling the suffix command,
the arguments are reset to ‘nil’ (which causes the function to return
‘nil’ too).

   Like for Emacs’s prefix arguments, it is advisable, but not
mandatory, to access the infix arguments inside the command’s
‘interactive’ form.  The preferred way of doing that is to call the
‘transient-args’ function, which for infix arguments serves about the
same purpose as ‘prefix-arg’ serves for prefix arguments.

Function: transient-args prefix
     This function returns the value of the transient prefix command
     PREFIX.

     If the current command was invoked from the transient prefix
     command PREFIX, then it returns the active infix arguments.  If the
     current command was not invoked from PREFIX, then it returns the
     set, saved or default value for PREFIX.

Function: transient-get-value
     This function returns the value of the current prefix.

     This is mostly intended for internal use, but may also be of use in
     ‘transient-set-value’ and ‘transient-save-value’ methods.  Unlike
     ‘transient-args’, this does not include the values of suffixes
     whose ‘unsavable’ slot is non-‘nil’.

Function: transient-arg-value arg args
     This function returns the value of ARG as it appears in ARGS.

     For a switch a boolean is returned.  For an option the value is
     returned as a string, using the empty string for the empty value,
     or ‘nil’ if the option does not appear in ARGS.

Function: transient-suffixes prefix
     This function returns the suffixes of the transient prefix command
     PREFIX.  This is a list of objects.  This function should only be
     used if you need the objects (as opposed to just their values) and
     if the current command is not being invoked from PREFIX.


File: doccZhEUk.info,  Node: Using Prefix Scope,  Next: Current Suffix Command,  Prev: Using Infix Arguments,  Up: Defining New Commands

4.6 Using Prefix Scope
======================

Some transients have a sort of secondary value, called a scope.  A
prefix’s scope can be accessed using ‘transient-scope’; similar to how
its value can be accessed using ‘transient-args’.

Function: transient-scope prefixes classes
     This function returns the scope of the active or current transient
     prefix command.

     If optional PREFIXES and CLASSES are both nil, return the scope of
     the prefix currently being setup, making this variation useful,
     e.g., in ‘:if*’ predicates.  If no prefix is being setup, but the
     current command was invoked from some prefix, then return the scope
     of that.

     If PREFIXES is non-nil, it must be a prefix command or a list of
     such commands.  If CLASSES is non-nil, it must be a prefix class or
     a list of such classes.  When this function is called from the body
     or the ‘interactive’ form of a suffix command, PREFIXES and/or
     CLASSES should be non-nil.  If either is non-nil, try the following
     in order:

        • If the current suffix command was invoked from a prefix, which
          appears in PREFIXES, return the scope of that prefix.

        • If the current suffix command was invoked from a prefix, and
          its class derives from one of the CLASSES, return the scope of
          that prefix.

        • If a prefix is being setup and it appears in PREFIXES, return
          its scope.

        • If a prefix is being setup and its class derives from one of
          the CLASSES, return its scope.

        • Finally try to return the default scope of the first command
          in PREFIXES.  This only works if that slot is set in the
          respective class definition or using its
          ‘transient-init-scope’ method.

     If no prefix matches, return nil.


File: doccZhEUk.info,  Node: Current Suffix Command,  Next: Current Prefix Command,  Prev: Using Prefix Scope,  Up: Defining New Commands

4.7 Current Suffix Command
==========================

Function: transient-suffix-object command
     This function returns the object associated with the current suffix
     command.

     Each suffix commands is associated with an object, which holds
     additional information about the suffix, such as its value (in the
     case of an infix command, which is a kind of suffix command).

     This function is intended to be called by infix commands, which are
     usually aliases of ‘transient--default-infix-command’, which is
     defined like this:

          (defun transient--default-infix-command ()
            (interactive)
            (let ((obj (transient-suffix-object)))
              (transient-infix-set obj (transient-infix-read obj)))
            (transient--show))

     (User input is read outside of ‘interactive’ to prevent the command
     from being added to ‘command-history’.)

     Such commands need to be able to access their associated object to
     guide how ‘transient-infix-read’ reads the new value and to store
     the read value.  Other suffix commands (including non-infix
     commands) may also need the object to guide their behavior.

     This function attempts to return the object associated with the
     current suffix command even if the suffix command was not invoked
     from a transient.  (For some suffix command that is a valid thing
     to do, for others it is not.)  In that case ‘nil’ may be returned,
     if the command was not defined using one of the macros intended to
     define such commands.

     The optional argument COMMAND is intended for internal use.  If you
     are contemplating using it in your own code, then you should
     probably use this instead:

          (get COMMAND 'transient--suffix)

Variable: transient-current-suffixes
     The suffixes of the transient from which this suffix command was
     invoked.  This is a list of objects.  Usually it is sufficient to
     instead use the function ‘transient-args’, which returns a list of
     values.  In complex cases it might be necessary to use this
     variable instead, i.e., if you need access to information beside
     the value.


File: doccZhEUk.info,  Node: Current Prefix Command,  Next: Transient State,  Prev: Current Suffix Command,  Up: Defining New Commands

4.8 Current Prefix Command
==========================

Function: transient-prefix-object
     This function returns the current prefix as an object.

     While a transient is being setup or refreshed (which involves
     preparing its suffixes) the variable ‘transient--prefix’ can be
     used to access the prefix object.  Thus this is what has to be used
     in suffix methods such as ‘transient-format-description’, and in
     object-specific functions that are stored in suffix slots such as
     ‘description’.

     When a suffix command is invoked (i.e., in its ‘interactive’ form
     and function body) then the variable ‘transient-current-prefix’ has
     to be used instead.

     Two distinct variables are needed, because any prefix may itself be
     used as a suffix of another prefix, and such sub-prefixes have to
     be able to tell themselves apart from the prefix they were invoked
     from.

     Regular suffix commands, which are not prefixes, do not have to
     concern themselves with this distinction, so they can use this
     function instead.  In the context of a plain suffix, it always
     returns the value of the appropriate variable.

Variable: transient-current-prefix
     The transient from which this suffix command was invoked.  The
     value is a ‘transient-prefix’ object, which holds information
     associated with the transient prefix command.

Variable: transient-current-command
     The transient from which this suffix command was invoked.  The
     value is a symbol, the transient prefix command.

Function: transient-active-prefix &optional prefixes
     This function returns the active transient object.  It returns
     ‘nil’ if there is no active transient, if the transient buffer
     isn’t shown, and while the active transient is suspended (e.g.,
     while the minibuffer is in use).

     Unlike ‘transient-current-prefix’, which is only ever non-‘nil’ in
     code that is run directly by a command that is invoked while a
     transient is current, this function is also suitable for use in
     asynchronous code, such as timers and callbacks (this function’s
     main use-case).

     If optional PREFIXES is non-‘nil’, it must be a prefix command
     symbol or a list of symbols, in which case the active transient
     object is only returned if it matches one of the PREFIXES.


File: doccZhEUk.info,  Node: Transient State,  Prev: Current Prefix Command,  Up: Defining New Commands

4.9 Transient State
===================

Invoking a transient prefix command “activates” the respective
transient, i.e., it puts a transient keymap into effect, which binds the
transient’s infix and suffix commands.

   The default behavior while a transient is active is as follows:

   • Invoking an infix command does not affect the transient state; the
     transient remains active.

   • Invoking a (non-infix) suffix command “deactivates” the transient
     state by removing the transient keymap and performing some
     additional cleanup.

   • Invoking a command that is bound in a keymap other than the
     transient keymap is disallowed and trying to do so results in a
     warning.  This does not “deactivate” the transient.

   The behavior can be changed for all suffixes of a particular prefix
and/or for individual suffixes.  The values should nearly always be
booleans, but certain functions, called “pre-commands”, can also be
used.  These functions are named ‘transient--do-VERB’, and the symbol
‘VERB’ can be used as a shorthand.

   A boolean is interpreted as answering the question "does the
transient stay active, when this command is invoked?"  ‘t’ means that
the transient stays active, while ‘nil’ means that invoking the command
exits the transient.

   Note that when the suffix is a “sub-prefix”, invoking that command
always activates that sub-prefix, causing the outer prefix to no longer
be active and displayed.  Here ‘t’ means that when you exit the inner
prefix, then the outer prefix becomes active again, while ‘nil’ means
that all outer prefixes are exited at once.

   • The behavior for non-suffixes can be set for a particular prefix,
     by the prefix’s ‘transient-non-suffix’ slot to a boolean, a
     suitable pre-command function, or a shorthand for such a function.
     See *note Pre-commands for Non-Suffixes::.

   • The common behavior for the suffixes of a particular prefix can be
     set using the prefix’s ‘transient-suffixes’ slot.

     The value specified in this slot does *not* affect infixes.
     Because it affects both regular suffixes as well as sub-prefixes,
     which have different needs, it is best to avoid explicitly
     specifying a function.

   • The behavior of an individual suffix can be changed using its
     ‘transient’ slot.  While it is usually best to use a boolean, for
     this slot it can occasionally make sense to specify a function
     explicitly.

     Note that this slot can be set when defining a suffix command using
     ‘transient-define-suffix’ and/or in the definition of the prefix.
     If set in both places, then the latter takes precedence, as usual.

   The available pre-command functions are documented in the following
sub-sections.  They are called by ‘transient--pre-command’, a function
on ‘pre-command-hook’, and the value that they return determines whether
the transient is exited.  To do so the value of one of the constants
‘transient--exit’ or ‘transient--stay’ is used (that way we don’t have
to remember if ‘t’ means “exit” or “stay”).

   Additionally, these functions may change the value of ‘this-command’
(which explains why they have to be called using ‘pre-command-hook’),
call ‘transient-export’, ‘transient--stack-zap’ or
‘transient--stack-push’; and set the values of ‘transient--exitp’,
‘transient--helpp’ or ‘transient--editp’.

   For completeness sake, some notes about complications:

   • The transient-ness of certain built-in suffix commands is specified
     using ‘transient-predicate-map’.  This is a special keymap, which
     binds commands to pre-commands (as opposed to keys to commands) and
     takes precedence over the prefix’s ‘transient-suffix’ slot, but not
     the suffix’s ‘transient’ slot.

   • While a sub-prefix is active we nearly always want ‘C-g’ to take
     the user back to the “super-prefix”, even when the other suffixes
     don’t do that.  However, in rare cases this may not be desirable,
     in which case ‘replace’ can be used as the value of the
     sub-prefix’s ‘transient’ slot.

Pre-commands for Infixes
------------------------

The default for infixes is ‘transient--do-stay’.  This is also the only
function that makes sense for infixes, which is why this predicate is
used even if the value of the prefix’s ‘transient-suffix’ slot is ‘t’.
In extremely rare cases, one might want to use something else, which can
be done by setting the infix’s ‘transient’ slot directly.

Function: transient–do-stay
     Call the command without exporting variables and stay transient.

Pre-commands for Suffixes
-------------------------

By default, invoking a suffix causes the transient to be exited.

   The behavior for an individual suffix command can be changed by
setting its ‘transient’ slot to a boolean (which is highly recommended),
or to one of the following pre-commands.

Function: transient–do-exit
     Call the command after exporting variables and exit the transient.

Function: transient–do-return
     Call the command after exporting variables and return to the parent
     prefix.  If there is no parent prefix, then call
     ‘transient--do-exit’.

Function: transient–do-call
     Call the command after exporting variables and stay transient.

   The following pre-commands are only suitable for sub-prefixes.  It is
not necessary to explicitly use these predicates because the correct
predicate is automatically picked based on the value of the ‘transient’
slot for the sub-prefix itself.

Function: transient–do-recurse
     Call the transient prefix command, preparing for return to outer
     transient.

     Whether we actually return to the parent transient is ultimately
     under the control of each invoked suffix.  The difference between
     this pre-command and ‘transient--do-stack’ is that it changes the
     value of the ‘transient-suffix’ slot to ‘t’.

     If there is no parent transient, then only call this command and
     skip the second step.

Function: transient–do-stack
     Call the transient prefix command, stacking the active transient.
     Push the active transient to the transient stack.

     Unless ‘transient--do-recurse’ is explicitly used, this pre-command
     is automatically used for suffixes that are prefixes themselves,
     i.e., for sub-prefixes.

Function: transient–do-replace
     Call the transient prefix command, replacing the active transient.
     Do not push the active transient to the transient stack.

     Unless ‘transient--do-recurse’ is explicitly used, this pre-command
     is automatically used for suffixes that are prefixes themselves,
     i.e., for sub-prefixes.

Function: transient–do-suspend
     Suspend the active transient, saving the transient stack.

     This is used by the command ‘transient-suspend’ and optionally also
     by “external events” such as ‘handle-switch-frame’.  Such bindings
     should be added to ‘transient-predicate-map’.

Pre-commands for Non-Suffixes
-----------------------------

By default, non-suffixes (commands that are bound in other keymaps
beside the transient keymap) cannot be invoked.  Trying to invoke such a
command results in a warning and the transient stays active.

   If you want a different behavior, then set the ‘transient-non-suffix’
slot of the transient prefix command.  The value should be a boolean,
answering the question, "is it allowed to invoke non-suffix commands?, a
pre-command function, or a shorthand for such a function.

   If the value is ‘t’, then non-suffixes can be invoked, when it is
‘nil’ (the default) then they cannot be invoked.

   The only other recommended value is ‘leave’.  If that is used, then
non-suffixes can be invoked, but if one is invoked, then that exits the
transient.

Function: transient–do-warn
     Call ‘transient-undefined’ and stay transient.

Function: transient–do-stay
     Call the command without exporting variables and stay transient.

Function: transient–do-leave
     Call the command without exporting variables and exit the
     transient.

Special Pre-Commands
--------------------

Function: transient–do-quit-one
     If active, quit help or edit mode, else exit the active transient.

     This is used when the user pressed ‘C-g’.

Function: transient–do-quit-all
     Exit all transients without saving the transient stack.

     This is used when the user pressed ‘C-q’.

Function: transient–do-suspend
     Suspend the active transient, saving the transient stack.

     This is used when the user pressed ‘C-z’.


File: doccZhEUk.info,  Node: Classes and Methods,  Next: FAQ,  Prev: Defining New Commands,  Up: Top

5 Classes and Methods
*********************

Transient uses classes and generic functions to make it possible to
define new types of suffix and prefix commands, which are similar to
existing types, but behave differently in some respects.

   Every prefix, infix and suffix command is associated with an object,
which holds information, which controls certain aspects of its behavior.
This happens in two ways.

   • Associating a command with a certain class gives the command a
     type.  This makes it possible to use generic functions to do
     certain things that have to be done differently depending on what
     type of command it acts on.

     That in turn makes it possible for third-parties to add new types
     without having to convince the maintainer of Transient, that that
     new type is important enough to justify adding a special case to a
     dozen or so functions.

   • Associating a command with an object makes it possible to easily
     store information that is specific to that particular command.

     Two commands may have the same type, but obviously their key
     bindings and descriptions still have to be different, for example.

     The values of some slots are functions.  The ‘reader’ slot for
     example holds a function that is used to read a new value for an
     infix command.  The values of such slots are regular functions.

     Generic functions are used when a function should do something
     different based on the type of the command, i.e., when all commands
     of a certain type should behave the same way but different from the
     behavior for other types.  Object slots that hold a regular
     function as value are used when the task that they perform is
     likely to differ even between different commands of the same type.

* Menu:

* Group Classes::
* Group Methods::
* Prefix Classes::
* Suffix Classes::
* Prefix Methods::
* Suffix Methods::
* Prefix Slots::
* Suffix Slots::
* Predicate Slots::


File: doccZhEUk.info,  Node: Group Classes,  Next: Group Methods,  Up: Classes and Methods

5.1 Group Classes
=================

The type of a group can be specified using the ‘:class’ property at the
beginning of the class specification, e.g., ‘[:class transient-columns
...]’ in a call to ‘transient-define-prefix’.

   • The abstract ‘transient-child’ class is the base class of both
     ‘transient-group’ (and therefore all groups) as well as of
     ‘transient-suffix’ (and therefore all suffix and infix commands).

     This class exists because the elements (or “children”) of certain
     groups can be other groups instead of suffix and infix commands.

   • The abstract ‘transient-group’ class is the superclass of all other
     group classes.

   • The ‘transient-column’ class is the simplest group.

     This is the default “flat” group.  If the class is not specified
     explicitly and the first element is not a vector (i.e., not a
     group), then this class is used.

     This class displays each element on a separate line.

   • The ‘transient-row’ class displays all elements on a single line.

   • The ‘transient-columns’ class displays commands organized in
     columns.

     Direct elements have to be groups whose elements have to be
     commands or strings.  Each subgroup represents a column.  This
     class takes care of inserting the subgroups’ elements.

     This is the default “nested” group.  If the class is not specified
     explicitly and the first element is a vector (i.e., a group), then
     this class is used.

   • The ‘transient-subgroups’ class wraps other groups.

     Direct elements have to be groups whose elements have to be
     commands or strings.  This group inserts an empty line between
     subgroups.  The subgroups themselves are responsible for displaying
     their elements.


File: doccZhEUk.info,  Node: Group Methods,  Next: Prefix Classes,  Prev: Group Classes,  Up: Classes and Methods

5.2 Group Methods
=================

Function: transient-setup-children group children
     This generic function can be used to setup the children or a group.

     The default implementation usually just returns the children
     unchanged, but if the ‘setup-children’ slot of GROUP is non-‘nil’,
     then it calls that function with CHILDREN as the only argument and
     returns the value.

     The children are given as a (potentially empty) list consisting of
     either group or suffix specifications.  These functions can make
     arbitrary changes to the children including constructing new
     children from scratch.

Function: transient–insert-group group
     This generic function formats the group and its elements and
     inserts the result into the current buffer, which is a temporary
     buffer.  The contents of that buffer are later inserted into the
     popup buffer.

     Functions that are called by this function may need to operate in
     the buffer from which the transient was called.  To do so they can
     temporarily make the ‘transient--shadowed-buffer’ the current
     buffer.


File: doccZhEUk.info,  Node: Prefix Classes,  Next: Suffix Classes,  Prev: Group Methods,  Up: Classes and Methods

5.3 Prefix Classes
==================

Transient itself provides a single class for prefix commands,
‘transient-prefix’, but package authors may wish to define specialized
classes.  Doing so makes it possible to change the behavior of the set
of prefix commands that use that class, by implementing specialized
methods for certain generic functions (see *note Prefix Methods::).

   A transient prefix command’s object is stored in the
‘transient--prefix’ property of the command symbol.  While a transient
is active, a clone of that object is stored in the variable
‘transient--prefix’.  A clone is used because some changes that are made
to the active transient’s object should not affect later invocations.


File: doccZhEUk.info,  Node: Suffix Classes,  Next: Prefix Methods,  Prev: Prefix Classes,  Up: Classes and Methods

5.4 Suffix Classes
==================

   • All suffix and infix classes derive from ‘transient-suffix’, which
     in turn derives from ‘transient-child’, from which
     ‘transient-group’ also derives (see *note Group Classes::).

   • All infix classes derive from the abstract ‘transient-infix’ class,
     which in turn derives from the ‘transient-suffix’ class.

     Infixes are a special type of suffixes.  The primary difference is
     that infixes always use the ‘transient--do-stay’ pre-command, while
     non-infix suffixes use a variety of pre-commands (see *note
     Transient State::).  Doing that is most easily achieved by using
     this class, though theoretically it would be possible to define an
     infix class that does not do so.  If you do that then you get to
     implement many methods.

     Also, infixes and non-infix suffixes are usually defined using
     different macros (see *note Defining Suffix and Infix Commands::).

   • Classes used for infix commands that represent arguments should be
     derived from the abstract ‘transient-argument’ class.

   • The ‘transient-switch’ class (or a derived class) is used for infix
     arguments that represent command-line switches (arguments that do
     not take a value).

   • The ‘transient-option’ class (or a derived class) is used for infix
     arguments that represent command-line options (arguments that do
     take a value).

   • The ‘transient-switches’ class can be used for a set of mutually
     exclusive command-line switches.

   • The ‘transient-files’ class can be used for a ‘--’ argument that
     indicates that all remaining arguments are files.

   • Classes used for infix commands that represent variables should
     derived from the abstract ‘transient-variable’ class.

   • The ‘transient-information’ and ‘transient-information*’ classes
     are special in that suffixes that use these class are not
     associated with a command and thus also not with any key binding.
     Such suffixes are only used to display arbitrary information, and
     that anywhere a suffix can appear.  Display-only suffix
     specifications take these form:

          ([LEVEL] :info DESCRIPTION [KEYWORD VALUE]...)
          ([LEVEL] :info* DESCRIPTION [KEYWORD VALUE]...)

     The ‘:info’ and ‘:info*’ keyword arguments replaces the
     ‘:description’ keyword used for other suffix classes.  Other
     keyword arguments that you might want to set, include ‘:face’,
     predicate keywords (such as ‘:if’ and ‘:inapt-if’), and ‘:format’.
     By default the value of ‘:format’ includes ‘%k’, which for this
     class is replaced with the empty string or spaces, if keys are
     being padded in the containing group.

     The only difference between these two classes is that ‘:info*’
     aligns its description with the descriptions of suffix commands,
     while for ‘:info’ the description bleeds into the area where
     suffixes display their key bindings.

   • The ‘transient-lisp-variable’ class can be used to show and change
     the value of lisp variables.  This class is not fully featured yet
     and it is somewhat likely that future improvements won’t be fully
     backward compatible.

   • The ‘transient-describe-target’ class is used by the command
     ‘transient-describe’.

   • The ‘transient-value-preset’ class is used to implement the command
     ‘transient-preset’, which activates a value preset.

   Magit defines additional classes, which can serve as examples for the
fancy things you can do without modifying Transient.  Some of these
classes will likely get generalized and added to Transient.  For now
they are very much subject to change and not documented.


File: doccZhEUk.info,  Node: Prefix Methods,  Next: Suffix Methods,  Prev: Suffix Classes,  Up: Classes and Methods

5.5 Prefix Methods
==================

To get information about the methods implementing these generic
functions use ‘describe-function’.

Function: transient-init-value obj
     This generic function sets the initial value of the object OBJ.
     Methods exist for both prefix and suffix objects.

     The default method for prefix objects sets the value of OBJ’s
     ‘value’ slot to the set, saved or default value.  The value that is
     set for the current session is preferred over the saved value,
     which is preferred over the default value.

     The default value is determined using the generic function
     ‘transient-default-value’.  If you need to change how the value for
     a prefix class is determined, its usually sufficient to implement a
     method for that function.

Function: transient-default-value obj
     This generic function returns the default value of the object OBJ.
     Methods exist for both prefix and suffix objects.

     The default method for prefix objects returns the value of the
     ‘default-value’ slot if that is bound and not a function.  If it is
     a function, that is called to get the value.  If the slot is
     unbound, ‘nil’ is returned.

Function: transient-prefix-value obj
     This generic function returns the value of the prefix object OBJ.
     The respective generic function for infix and suffix objects is
     named ‘transient-infix-value’.

Function: transient-init-scope obj
     This generic function sets the scope of the object OBJ.  Methods
     exist for both prefix and suffix objects.

     This function is called for all prefix and suffix commands, but
     unless a concrete method is implemented this falls through to the
     default implementation, which is a noop.

   ‘transient-set-value’, ‘transient-save-value’,
‘transient-reset-value’, ‘transient--history-key’,
‘transient--history-push’ and ‘transient--history-init’ are other
generic functions dealing with the value of prefix objects.  See their
doc-strings for more information.

   ‘transient-show-help’ is another generic function implemented for
prefix commands.  The default method effectively describes the command
using ‘describe-function’.


File: doccZhEUk.info,  Node: Suffix Methods,  Next: Prefix Slots,  Prev: Prefix Methods,  Up: Classes and Methods

5.6 Suffix Methods
==================

To get information about the methods implementing these generic
functions use ‘describe-function’.

* Menu:

* Suffix Value Methods::
* Suffix Format Methods::


File: doccZhEUk.info,  Node: Suffix Value Methods,  Next: Suffix Format Methods,  Up: Suffix Methods

5.6.1 Suffix Value Methods
--------------------------

Function: transient-init-value obj
     This generic function sets the initial value of the object OBJ.
     Methods exist for both prefix and suffix objects.

     For ‘transient-argument’ objects this function handles setting the
     value by itself.

     For other ‘transient-suffix’ objects (including ‘transient-infix’
     objects), this calls ‘transient-default-value’ and uses the value
     returned by that, unless it is the special value ‘eieio--unbound’,
     which indicates that there is no default value.  Since that is what
     the default method for ‘transient-suffix’ objects does, both of
     these functions effectively are noops for these classes.

     If you implement a class that derives from ‘transient-infix’
     directly, then you must implement a dedicated method for this
     function and/or ‘transient-default-value’.

Function: transient-default-value obj
     This generic function returns the default value of the object OBJ.
     Methods exist for both prefix and suffix objects.

Function: transient-infix-read obj
     This generic function determines the new value of the infix object
     OBJ.

     This function merely determines the value; ‘transient-infix-set’ is
     used to actually store the new value in the object.

     For most infix classes this is done by reading a value from the
     user using the reader specified by the ‘reader’ slot (using the
     ‘transient-infix-value’ method described below).

     For some infix classes the value is changed without reading
     anything in the minibuffer, i.e., the mere act of invoking the
     infix command determines what the new value should be, based on the
     previous value.

Function: transient-prompt obj
     This generic function returns the prompt to be used to read infix
     object OBJ’s value.

Function: transient-infix-set obj value
     This generic function sets the value of infix object OBJ to VALUE.

Function: transient-infix-value obj
     This generic function returns the value of the suffix object OBJ.

     This function is called by ‘transient-args’ (which see), meaning
     this function is how the value of a transient is determined so that
     the invoked suffix command can use it.

     Currently most values are strings, but that is not set in stone.
     ‘nil’ is not a value, it means “no value”.

     Usually only infixes have a value, but see the method for
     ‘transient-suffix’.

Function: transient-init-scope obj
     This generic function sets the scope of the object OBJ.  Methods
     exist for both prefix and suffix objects.

     The scope is actually a property of the transient prefix, not of
     individual suffixes.  However it is possible to invoke a suffix
     command directly instead of from a transient.  In that case, if the
     suffix expects a scope, then it has to determine that itself and
     store it in its ‘scope’ slot.

     This function is called for all prefix and suffix commands, but
     unless a concrete method is implemented, this falls through to the
     default implementation, which is a noop.


File: doccZhEUk.info,  Node: Suffix Format Methods,  Prev: Suffix Value Methods,  Up: Suffix Methods

5.6.2 Suffix Format Methods
---------------------------

Function: transient-format obj
     This generic function formats and returns OBJ for display.

     When this function is called, then the current buffer is some
     temporary buffer.  If you need the buffer from which the prefix
     command was invoked to be current, then do so by temporarily making
     ‘transient--source-buffer’ current.

Function: transient-format-key obj
     This generic function formats OBJ’s ‘key’ for display and returns
     the result.

Function: transient-format-description obj
     This generic function formats OBJ’s ‘description’ for display and
     returns the result.

Function: transient-format-value obj
     This generic function formats OBJ’s value for display and returns
     the result.

Function: transient-show-help obj
     Show help for the prefix, infix or suffix command represented by
     OBJ.

     Regardless of OBJ’s type, if its ‘show-help’ slot is non-‘nil’,
     that must be a function, which takes OBJ is its only argument.  It
     must prepare, display and return a buffer, and select the window
     used to display it.  The ‘transient-show-help-window’ macro is
     intended for use in such functions.

     For prefixes, show the info manual, if that is specified using the
     ‘info-manual’ slot.  Otherwise, show the manpage if that is
     specified using the ‘man-page’ slot.  Otherwise, show the command’s
     documentation string.

     For suffixes, show the command’s documentation string.

     For infixes, show the manpage if that is specified.  Otherwise show
     the command’s documentation string.

Macro: transient-with-help-window &rest body
     Evaluate BODY, send output to ‘*Help*’ buffer, and display it in a
     window.  Select the help window, and make the help buffer current
     and return it.

Function: transient-show-summary obj &optional return
     This generic function shows or, if optional RETURN is non-‘nil’,
     returns a brief summary about the command at point or hovered with
     the mouse.

     This function is called when the mouse is moved over a command and
     (if the value of ‘transient-enable-popup-navigation’ is ‘verbose’)
     when the user navigates to a command using the keyboard.

     If OBJ’s ‘summary’ slot is a string, that is used.  If ‘summary’ is
     a function, that is called with OBJ as the only argument and the
     returned string is used.  If ‘summary’ is or returns something
     other than a string or ‘nil’, no summary is shown.  If ‘summary’ is
     or returns ‘nil’, the first line of the documentation string is
     used, if any.

     If RETURN is non-‘nil’, this function returns the summary instead
     of showing it.  This is used when a tooltip is needed.


File: doccZhEUk.info,  Node: Prefix Slots,  Next: Suffix Slots,  Prev: Suffix Methods,  Up: Classes and Methods

5.7 Prefix Slots
================

Value and Scope
---------------

   • ‘default-value’ The default value of the prefix.  Use the keyword
     argument ‘:value’ (sic) to set this slot in the definition of a
     prefix.

   • ‘init-value’ A function that is responsible for setting the
     object’s value.  If bound, then this is called with the object as
     the only argument.  Usually this is not bound, in which case the
     object’s primary ‘transient-init-value’ method is called instead.

   • ‘history-key’ If multiple prefix commands should share a single
     value, then this slot has to be set to the same value for all of
     them.  You probably don’t want that.

   • ‘incompatible’ A list of lists.  Each sub-list specifies a set of
     mutually exclusive arguments.  Enabling one of these arguments
     causes the others to be disabled.  An argument may appear in
     multiple sub-lists.  Arguments must me given in the same form as
     used in the ‘argument’ or ‘argument-format’ slot of the respective
     suffix objects, usually something like ‘--switch’ or ‘--option=%s’.
     For options and ‘transient-switches’ suffixes it is also possible
     to match against a specific value, as returned by
     ‘transient-infix-value’, for example, ‘--option=one’.

   • ‘scope’ For some transients it might be necessary to have a sort of
     secondary value, called a “scope”.  See ‘transient-define-prefix’.

Behavior
--------

   • ‘transient-suffix’, ‘transient-non-suffix’ and
     ‘transient-switch-frame’ play a part when determining whether the
     currently active transient prefix command remains active/transient
     when a suffix or arbitrary non-suffix command is invoked.  See
     *note Transient State::.

   • ‘refresh-suffixes’ Normally suffix objects and keymaps are only
     setup once, when the prefix is invoked.  Setting this to ‘t’,
     causes them to be recreated after every command.  This is useful
     when using ‘:if...’ predicates, and those need to be rerun for some
     reason.  Doing this is somewhat costly, and there is a risk of
     losing state, so this is disabled by default and still considered
     experimental.

   • ‘environment’ A function used to establish an environment while
     initializing, refreshing or redisplaying a transient prefix menu.
     This is useful to establish a cache, in case multiple suffixes
     require the same expensive work.  The provided function is called
     with at least one argument, the function for which it establishes
     the environment.  It must ‘funcall’ that function with no
     arguments.  During initialization the second argument is the prefix
     object being initialized.  This slot is still experimental.

Appearance
----------

   • ‘display-action’ determines how this prefix is displayed,
     overriding ‘transient-display-buffer-action’.  It should have the
     same type.

   • ‘mode-line-format’ is this prefix’s mode line format, overriding
     ‘transient-mode-line-format’.  It should have the same type.

   • ‘column-widths’ is only respected inside ‘transient-columns’ groups
     and allows aligning columns across separate instances of that.  A
     list of integers.

   • ‘variable-pitch’ controls whether alignment is done pixel-wise to
     account for use of variable-pitch characters, which is useful,
     e.g., when using emoji.

Documentation
-------------

   • ‘show-help’, ‘man-page’ or ‘info-manual’ can be used to specify the
     documentation for the prefix and its suffixes.  The command
     ‘transient-help’ uses the function ‘transient-show-help’ (which
     see) to lookup and use these values.

   • ‘suffix-description’ can be used to specify a function which
     provides fallback descriptions for suffixes that lack a
     description.  This is intended to be temporarily used when
     implementing of a new prefix command, at which time
     ‘transient-command-summary-or-name’ is a useful value.

Internal
--------

These slots are mostly intended for internal use.  They should not be
set in calls to ‘transient-define-prefix’.

   • ‘prototype’ When a transient prefix command is invoked, then a
     clone of that object is stored in the global variable
     ‘transient--prefix’ and the prototype is stored in the clone’s
     ‘prototype’ slot.

   • ‘command’ The command, a symbol.  Each transient prefix command
     consists of a command, which is stored in a symbol’s function slot
     and an object, which is stored in the ‘transient--prefix’ property
     of the same symbol.

   • ‘level’ The level of the prefix commands.  The suffix commands
     whose layer is equal or lower are displayed.  See *note Enabling
     and Disabling Suffixes::.

   • ‘value’ The likely outdated value of the prefix.  Instead of
     accessing this slot directly you should use the function
     ‘transient-get-value’, which is guaranteed to return the up-to-date
     value.

   • ‘history’ and ‘history-pos’ are used to keep track of historic
     values.  Unless you implement your own ‘transient-infix-read’
     method you should not have to deal with these slots.

   • ‘unwind-suffix’ is used internally to ensure transient state is
     properly exited, even in case of an error.


File: doccZhEUk.info,  Node: Suffix Slots,  Next: Predicate Slots,  Prev: Prefix Slots,  Up: Classes and Methods

5.8 Suffix Slots
================

Here we document most of the slots that are only available for suffix
objects.  Some slots are shared by suffix and group objects, they are
documented in *note Predicate Slots::.

   Also see *note Suffix Classes::.

Slots of ‘transient-child’
--------------------------

This is the abstract superclass of ‘transient-suffix’ and
‘transient-group’.  This is where the shared ‘if*’ and ‘inapt-if*’ slots
(see *note Predicate Slots::), the ‘level’ slot (see *note Enabling and
Disabling Suffixes::), and the ‘advice’ and ‘advice*’ slots (see *note
Slots of transient-suffix::) are defined.

   • ‘parent’ The object for the parent group.

Slots of ‘transient-suffix’
---------------------------

   • ‘key’ The key, a key vector or a key description string.

   • ‘command’ The command, a symbol.

   • ‘transient’ Whether to stay transient.  See *note Transient
     State::.

   • ‘format’ The format used to display the suffix in the popup buffer.
     It must contain the following %-placeholders:

        • ‘%k’ For the key.
        • ‘%d’ For the description.
        • ‘%v’ For the infix value.  Non-infix suffixes don’t have a
          value.

   • ‘description’ The description, either a string or a function, which
     is called with zero or one argument (the suffix object), and
     returns a string.

   • ‘face’ Face used for the description.  In simple cases it is easier
     to use this instead of using a function as ‘description’ and adding
     the styling there.  ‘face’ is appended using
     ‘add-face-text-property’.

   • ‘show-help’ A function used to display help for the suffix.  If
     unspecified, the prefix controls how help is displayed for its
     suffixes.  See also function ‘transient-show-help’.

   • ‘summary’ The summary displayed in the echo area, or as a tooltip.
     If this is ‘nil’, which it usually should be, the first line of the
     documentation string is used instead.  See ‘transient-show-summary’
     for details.

   • ‘definition’ A command, which is used if the body is omitted when
     defining a command using ‘transient-define-suffix’.

   The following two slots are experimental.  They can also be set for a
group, in which case they apply to all suffixes in that group, except
for suffixes that set the same slot to a non-nil value.

   • ‘advice’ A function used to advise the command.  The advise is
     called using ‘(apply advice command args)’, i.e., it behaves like
     an "around" advice.

   • ‘advice*’ A function used to advise the command.  Unlike ‘advice’,
     this advises not only the command body but also its ‘interactive’
     spec.  If both slots are non-nil, ‘advice’ is used for the body and
     ‘advice*’ is used for the ‘interactive’ form.  When advising the
     ‘interactive’ spec, called using ‘(funcall advice
     #'advice-eval-interactive-spec spec)’.

Slots of ‘transient-infix’
--------------------------

Some of these slots are only meaningful for some of the subclasses.
They are defined here anyway to allow sharing certain methods.

   • ‘argument’ The long argument, e.g., ‘--verbose’.

   • ‘shortarg’ The short argument, e.g., ‘-v’.

   • ‘value’ The value.  Should not be accessed directly.

   • ‘init-value’ Function that is responsible for setting the object’s
     value.  If bound, then this is called with the object as the only
     argument.  Usually this is not bound, in which case the object’s
     primary ‘transient-init-value’ method is called instead.

   • ‘unsavable’ Whether the value of the suffix is not saved as part of
     the prefixes.

   • ‘multi-value’ For options, whether the option can have multiple
     values.  If this is non-‘nil’, then the values are read using
     ‘completing-read-multiple’ by default and if you specify your own
     reader, then it should read the values using that function or
     similar.

     Supported non-‘nil’ values are:

        • Use ‘rest’ for an option that can have multiple values.  This
          is useful e.g., for an ‘--’ argument that indicates that all
          remaining arguments are files (such as ‘git log -- file1
          file2’).

          In the list returned by ‘transient-args’ such an option and
          its values are represented by a single list of the form
          ‘(ARGUMENT . VALUES)’.

        • Use ‘repeat’ for an option that can be specified multiple
          times.

          In the list returned by ‘transient-args’ each instance of the
          option and its value appears separately in the usual from, for
          example: ‘("--another-argument" "--option=first"
          "--option=second")’.

     In both cases the option’s values have to be specified in the
     default value of a prefix using the same format as returned by
     ‘transient-args’, e.g., ‘("--other" "--o=1" "--o=2" ("--" "f1"
     "f2"))’.

   • ‘always-read’ For options, whether to read a value on every
     invocation.  If this is ‘nil’, then options that have a value are
     simply unset and have to be invoked a second time to set a new
     value.

   • ‘allow-empty’ For options, whether the empty string is a valid
     value.

   • ‘history-key’ The key used to store the history.  This defaults to
     the command name.  This is useful when multiple infixes should
     share the same history because their values are of the same kind.

   • ‘reader’ The function used to read the value of an infix.  Not used
     for switches.  The function takes three arguments, PROMPT,
     INITIAL-INPUT and HISTORY, and must return a string.

   • ‘prompt’ The prompt used when reading the value, either a string or
     a function that takes the object as the only argument and which
     returns a prompt string.

   • ‘choices’ A list of valid values, or a function that returns such a
     list.  The latter is not implemented for ‘transient-switches’,
     because I couldn’t think of a use-case.  How exactly the choices
     are used varies depending on the class of the suffix.

Slots of ‘transient-variable’
-----------------------------

   • ‘variable’ The variable.

Slots of ‘transient-switches’
-----------------------------

   • ‘argument-format’ The display format.  Must contain ‘%s’, one of
     the ‘choices’ is substituted for that.  E.g., ‘--%s-order’.

   • ‘argument-regexp’ The regexp used to match any one of the switches.
     E.g., ‘\\(--\\(topo\\|author-date\\|date\\)-order\\)’.


File: doccZhEUk.info,  Node: Predicate Slots,  Prev: Suffix Slots,  Up: Classes and Methods

5.9 Predicate Slots
===================

Suffix and group objects share two sets of predicate slots that control
whether a group or suffix should be available depending on some state.
Only one slot from each set can be used at the same time.  It is
undefined which slot is honored if you use more than one.

   Predicates from the first group control whether the suffix is present
in the menu at all.

   • ‘if’ Enable if predicate returns non-‘nil’.
   • ‘if-not’ Enable if predicate returns ‘nil’.
   • ‘if-non-nil’ Enable if variable’s value is non-‘nil’.
   • ‘if-nil’ Enable if variable’s value is ‘nil’.
   • ‘if-mode’ Enable if major-mode matches value.
   • ‘if-not-mode’ Enable if major-mode does not match value.
   • ‘if-derived’ Enable if major-mode derives from value.
   • ‘if-not-derived’ Enable if major-mode does not derive from value.

   Predicates from the second group control whether the suffix can be
invoked.  The suffix is shown in the menu regardless, but when it is
considered "inapt", then it is grayed out to indicated that it currently
cannot be invoked.

   • ‘inapt-if’ Inapt if predicate returns non-‘nil’.
   • ‘inapt-if-not’ Inapt if predicate returns ‘nil’.
   • ‘inapt-if-non-nil’ Inapt if variable’s value is non-‘nil’.
   • ‘inapt-if-nil’ Inapt if variable’s value is ‘nil’.
   • ‘inapt-if-mode’ Inapt if major-mode matches value.
   • ‘inapt-if-not-mode’ Inapt if major-mode does not match value.
   • ‘inapt-if-derived’ Inapt if major-mode derives from value.
   • ‘inapt-if-not-derived’ Inapt if major-mode does not derive from
     value.

   By default these predicates run when the prefix command is invoked,
but this can be changes, using the ‘refresh-suffixes’ prefix slot.  See
*note Prefix Slots::.

   One more slot is shared between group and suffix classes, ‘level’.
Like the slots documented above, it is a predicate, but it is used for a
different purpose.  The value has to be an integer between 1 and 7.
‘level’ controls whether a suffix or a group should be available
depending on user preference.  See *note Enabling and Disabling
Suffixes::.


File: doccZhEUk.info,  Node: FAQ,  Next: Keystroke Index,  Prev: Classes and Methods,  Up: Top

Appendix A FAQ
**************

A.1 Can I control how the popup buffer is displayed?
====================================================

Yes, see ‘transient-display-buffer-action’ in *note Configuration::.
You can also control how the popup buffer is displayed on a case-by-case
basis by passing ‘:display-action’ to ‘transient-define-prefix’.

A.2 How can I copy text from the popup buffer?
==============================================

To be able to mark text in Transient’s popup buffer using the mouse, you
have to add the below binding.  Note that for technical reasons, the
region won’t be visualized, while doing so.  After you have quit the
transient popup, you will be able to yank it in another buffer.

     (keymap-set transient-predicate-map
                 "<mouse-set-region>"
                 #'transient--do-stay)

A.3 How can I autoload prefix and suffix commands?
==================================================

If your package only supports Emacs 30, just prefix the definition with
‘;;;###autoload’.  If your package supports released versions of Emacs,
you unfortunately have to use a long form autoload comment as described
in *note (elisp)Autoload::.

     ;;;###autoload (autoload 'magit-dispatch "magit" nil t)
     (transient-define-prefix magit-dispatch ()
       ...)

A.4 How does Transient compare to prefix keys and universal arguments?
======================================================================

See
<https://github.com/magit/transient/wiki/Comparison-with-prefix-keys-and-universal-arguments>.

A.5 How does Transient compare to Magit-Popup and Hydra?
========================================================

See
<https://github.com/magit/transient/wiki/Comparison-with-other-packages>.

A.6 Why did some of the key bindings change?
============================================

You may have noticed that the bindings for some of the common commands
do *not* have the prefix ‘C-x’ and that furthermore some of these
commands are grayed out while others are not.  That unfortunately is a
bit confusing if the section of common commands is not shown
permanently, making the following explanation necessary.

   The purpose of usually hiding that section but showing it after the
user pressed the respective prefix key is to conserve space and not
overwhelm users with too much noise, while allowing the user to quickly
list common bindings on demand.

   That however should not keep us from using the best possible key
bindings.  The bindings that do use a prefix do so to avoid wasting too
many non-prefix bindings, keeping them available for use in individual
transients.  The bindings that do not use a prefix and that are *not*
grayed out are very important bindings that are *always* available, even
when invoking the “common command key prefix” or *any other*
transient-specific prefix.  The non-prefix keys that *are* grayed out
however, are not available when any incomplete prefix key sequence is
active.  They do not use the “common command key prefix” because it is
likely that users want to invoke them several times in a row and e.g.,
‘M-p M-p M-p’ is much more convenient than ‘C-x M-p C-x M-p C-x M-p’.

   You may also have noticed that the “Set” command is bound to ‘C-x s’,
while Magit-Popup used to bind ‘C-c C-c’ instead.  I have seen several
users praise the latter binding (sic), so I did not change it
willy-nilly.  The reason that I changed it is that using different
prefix keys for different common commands, would have made the temporary
display of the common commands even more confusing, i.e., after pressing
‘C-c’ all the bindings that begin with the ‘C-x’ prefix would be grayed
out.

   Using a single prefix for common commands key means that all other
potential prefix keys can be used for transient-specific commands
*without* the section of common commands also popping up.  ‘C-c’ in
particular is a prefix that I want to (and already do) use for Magit,
and also using that for a common command would prevent me from doing so.

   (See also the next question.)

A.7 Why does ‘q’ not quit popups anymore?
=========================================

I agree that ‘q’ is a good binding for commands that quit something.
This includes quitting whatever transient is currently active, but it
also includes quitting whatever it is that some specific transient is
controlling.  The transient ‘magit-blame’ for example binds ‘q’ to the
command that turns ‘magit-blame-mode’ off.

   So I had to decide if ‘q’ should quit the active transient (like
Magit-Popup used to) or whether ‘C-g’ should do that instead, so that
‘q’ could be bound in individual transient to whatever commands make
sense for them.  Because all other letters are already reserved for use
by individual transients, I have decided to no longer make an exception
for ‘q’.

   If you want to get ‘q’’s old binding back then you can do so.  Doing
that is a bit more complicated than changing a single key binding, so I
have implemented a function, ‘transient-bind-q-to-quit’ that makes the
necessary changes.  See its documentation string for more information.


File: doccZhEUk.info,  Node: Keystroke Index,  Next: Command and Function Index,  Prev: FAQ,  Up: Top

Appendix B Keystroke Index
**************************


File: doccZhEUk.info,  Node: Command and Function Index,  Next: Variable Index,  Prev: Keystroke Index,  Up: Top

Appendix C Command and Function Index
*************************************


File: doccZhEUk.info,  Node: Variable Index,  Next: Concept Index,  Prev: Command and Function Index,  Up: Top

Appendix D Variable Index
*************************


File: doccZhEUk.info,  Node: Concept Index,  Next: GNU General Public License,  Prev: Variable Index,  Up: Top

Appendix E Concept Index
************************