aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonas Bernoulli2023-12-05 20:04:21 +0100
committerJonas Bernoulli2023-12-05 20:04:21 +0100
commit1f1dbfc6e8da2bad097a388fbfd8cb09a2092cac (patch)
treef0781792146a2ec40d17854beff4a269bd41a0b4
parentfa5f06c1251ff717d661f05fcd240b4792054aae (diff)
downloademacs-1f1dbfc6e8da2bad097a388fbfd8cb09a2092cac.tar.gz
emacs-1f1dbfc6e8da2bad097a388fbfd8cb09a2092cac.zip
; * lisp/transient.el: Revert accidental changes
-rw-r--r--doc/misc/transient.texi62
-rw-r--r--lisp/transient.el6
2 files changed, 37 insertions, 31 deletions
diff --git a/doc/misc/transient.texi b/doc/misc/transient.texi
index b6c426d7f21..ac330e09702 100644
--- a/doc/misc/transient.texi
+++ b/doc/misc/transient.texi
@@ -25,7 +25,7 @@ General Public License for more details.
25 25
26@dircategory Emacs misc features 26@dircategory Emacs misc features
27@direntry 27@direntry
28* Transient: (transient). Transient Commands. 28* Transient: (transient). Transient Commands.
29@end direntry 29@end direntry
30 30
31@finalout 31@finalout
@@ -359,7 +359,7 @@ than outlined above and even customizable.}
359If the user does not save the value and just exits using a regular 359If the user does not save the value and just exits using a regular
360suffix command, then the value is merely saved to the transient's 360suffix command, then the value is merely saved to the transient's
361history. That value won't be used when the transient is next invoked, 361history. That value won't be used when the transient is next invoked,
362but it is easily accessible (see @ref{Using History}). 362but it is easily accessible (@pxref{Using History}).
363 363
364@table @asis 364@table @asis
365@item @kbd{C-x s} (@code{transient-set}) 365@item @kbd{C-x s} (@code{transient-set})
@@ -420,8 +420,8 @@ to cycle through previously used values. Usually the same keys as
420those mentioned above are bound to those commands. 420those mentioned above are bound to those commands.
421 421
422Authors of transients should arrange for different infix commands that 422Authors of transients should arrange for different infix commands that
423read the same kind of value to also use the same history key (see 423read the same kind of value to also use the same history key
424@ref{Suffix Slots}). 424(@pxref{Suffix Slots}).
425 425
426Both kinds of history are saved to a file when Emacs is exited. 426Both kinds of history are saved to a file when Emacs is exited.
427 427
@@ -635,7 +635,7 @@ buffer. The transient popup buffer is displayed in a window using
635The value of this option has the form @code{(@var{FUNCTION} . @var{ALIST})}, 635The value of this option has the form @code{(@var{FUNCTION} . @var{ALIST})},
636where @var{FUNCTION} is a function or a list of functions. Each such 636where @var{FUNCTION} is a function or a list of functions. Each such
637function should accept two arguments: a buffer to display and an 637function should accept two arguments: a buffer to display and an
638alist of the same form as @var{ALIST}. See @ref{Choosing Window,,,elisp,}, 638alist of the same form as @var{ALIST}. @xref{Choosing Window,,,elisp,},
639for details. 639for details.
640 640
641The default is: 641The default is:
@@ -650,7 +650,8 @@ The default is:
650This displays the window at the bottom of the selected frame. 650This displays the window at the bottom of the selected frame.
651Another useful @var{FUNCTION} is @code{display-buffer-below-selected}, which 651Another useful @var{FUNCTION} is @code{display-buffer-below-selected}, which
652is what @code{magit-popup} used by default. For more alternatives see 652is what @code{magit-popup} used by default. For more alternatives see
653@ref{Buffer Display Action Functions,,,elisp,}, and @ref{Buffer Display Action Alists,,,elisp,}. 653@ref{Buffer Display Action Functions,,,elisp,}, and see @ref{Buffer Display
654Action Alists,,,elisp,}.
654 655
655Note that the buffer that was current before the transient buffer 656Note that the buffer that was current before the transient buffer
656is shown should remain the current buffer. Many suffix commands 657is shown should remain the current buffer. Many suffix commands
@@ -702,7 +703,8 @@ color of @code{transient-key-noop} (if non-suffix are disallowed),
702@code{transient-key-exit} (if allowed and they exit the transient) is 703@code{transient-key-exit} (if allowed and they exit the transient) is
703used to draw the line. 704used to draw the line.
704 705
705Otherwise this can be any mode-line format. See @ref{Mode Line Format,,,elisp,}, for details. 706Otherwise this can be any mode-line format. @xref{Mode Line
707Format,,,elisp,}, for details.
706@end defopt 708@end defopt
707 709
708@defopt transient-semantic-coloring 710@defopt transient-semantic-coloring
@@ -851,10 +853,10 @@ The following functions share a few arguments:
851as expected by @code{transient-define-prefix}. Note that an infix is a 853as expected by @code{transient-define-prefix}. Note that an infix is a
852special kind of suffix. Depending on context ``suffixes'' means 854special kind of suffix. Depending on context ``suffixes'' means
853``suffixes (including infixes)'' or ``non-infix suffixes''. Here it 855``suffixes (including infixes)'' or ``non-infix suffixes''. Here it
854means the former. See @ref{Suffix Specifications}. 856means the former. @xref{Suffix Specifications}.
855 857
856@var{SUFFIX} may also be a group in the same form as expected by 858@var{SUFFIX} may also be a group in the same form as expected by
857@code{transient-define-prefix}. See @ref{Group Specifications}. 859@code{transient-define-prefix}. @xref{Group Specifications}.
858 860
859@item 861@item
860@var{LOC} is a command, a key vector, a key description (a string as 862@var{LOC} is a command, a key vector, a key description (a string as
@@ -1034,7 +1036,7 @@ binds the transient's infix and suffix commands. In other words, it
1034defines the complete transient, not just the transient prefix command 1036defines the complete transient, not just the transient prefix command
1035that is used to invoke that transient. 1037that is used to invoke that transient.
1036 1038
1037@defmac transient-define-prefix name arglist [docstring] [keyword value]... group... [body...] 1039@defmac transient-define-prefix name arglist [docstring] [keyword value]@dots{} group@dots{} [body@dots{}]
1038This macro defines @var{NAME} as a transient prefix command and binds the 1040This macro defines @var{NAME} as a transient prefix command and binds the
1039transient's infix and suffix commands. 1041transient's infix and suffix commands.
1040 1042
@@ -1049,7 +1051,7 @@ explicitly.
1049 1051
1050@var{GROUP}s add key bindings for infix and suffix commands and specify 1052@var{GROUP}s add key bindings for infix and suffix commands and specify
1051how these bindings are presented in the popup buffer. At least one 1053how these bindings are presented in the popup buffer. At least one
1052@var{GROUP} has to be specified. See @ref{Binding Suffix and Infix Commands}. 1054@var{GROUP} has to be specified. @xref{Binding Suffix and Infix Commands}.
1053 1055
1054The @var{BODY} is optional. If it is omitted, then @var{ARGLIST} is ignored and 1056The @var{BODY} is optional. If it is omitted, then @var{ARGLIST} is ignored and
1055the function definition becomes: 1057the function definition becomes:
@@ -1084,11 +1086,12 @@ the branch whose variables are being configured.
1084@section Binding Suffix and Infix Commands 1086@section Binding Suffix and Infix Commands
1085 1087
1086The macro @code{transient-define-prefix} is used to define a transient. 1088The macro @code{transient-define-prefix} is used to define a transient.
1087This defines the actual transient prefix command (see @ref{Defining Transients}) and adds the transient's infix and suffix bindings, as 1089This defines the actual transient prefix command (@pxref{Defining
1090Transients}) and adds the transient's infix and suffix bindings, as
1088described below. 1091described below.
1089 1092
1090Users and third-party packages can add additional bindings using 1093Users and third-party packages can add additional bindings using
1091functions such as @code{transient-insert-suffix} (see @ref{Modifying Existing Transients}). These functions take a ``suffix specification'' as one of 1094functions such as @code{transient-insert-suffix} (@pxref{Modifying Existing Transients}). These functions take a ``suffix specification'' as one of
1092their arguments, which has the same form as the specifications used in 1095their arguments, which has the same form as the specifications used in
1093@code{transient-define-prefix}. 1096@code{transient-define-prefix}.
1094 1097
@@ -1119,10 +1122,13 @@ brackets to do the latter.
1119Group specifications then have this form: 1122Group specifications then have this form:
1120 1123
1121@lisp 1124@lisp
1122[@{LEVEL@} @{DESCRIPTION@} @{KEYWORD VALUE@}... ELEMENT...] 1125[@{@var{LEVEL}@} @{@var{DESCRIPTION}@}
1126 @{@var{KEYWORD} @var{VALUE}@}...
1127 @var{ELEMENT}...]
1123@end lisp 1128@end lisp
1124 1129
1125The @var{LEVEL} is optional and defaults to 4. See @ref{Enabling and Disabling Suffixes}. 1130The @var{LEVEL} is optional and defaults to 4. @xref{Enabling and
1131Disabling Suffixes}.
1126 1132
1127The @var{DESCRIPTION} is optional. If present, it is used as the heading of 1133The @var{DESCRIPTION} is optional. If present, it is used as the heading of
1128the group. 1134the group.
@@ -1227,7 +1233,9 @@ suffixes''. Here it means the former.
1227Suffix specifications have this form: 1233Suffix specifications have this form:
1228 1234
1229@lisp 1235@lisp
1230([LEVEL] [KEY [DESCRIPTION]] COMMAND|ARGUMENT [KEYWORD VALUE]...) 1236([@var{LEVEL}]
1237 [@var{KEY} [@var{DESCRIPTION}]]
1238 @var{COMMAND}|@var{ARGUMENT} [@var{KEYWORD} @var{VALUE}]...)
1231@end lisp 1239@end lisp
1232 1240
1233@var{LEVEL}, @var{KEY} and @var{DESCRIPTION} can also be specified using the @var{KEYWORD}s 1241@var{LEVEL}, @var{KEY} and @var{DESCRIPTION} can also be specified using the @var{KEYWORD}s
@@ -1238,8 +1246,8 @@ the object's values just for the binding inside this transient.
1238 1246
1239@itemize 1247@itemize
1240@item 1248@item
1241@var{LEVEL} is the suffix level, an integer between 1 and 7. See 1249@var{LEVEL} is the suffix level, an integer between 1 and 7.
1242@ref{Enabling and Disabling Suffixes}. 1250@xref{Enabling and Disabling Suffixes}.
1243 1251
1244@item 1252@item
1245@var{KEY} is the key binding, either a vector or key description string. 1253@var{KEY} is the key binding, either a vector or key description string.
@@ -1317,7 +1325,7 @@ Note that an infix is a special kind of suffix. Depending on context
1317``suffixes'' means ``suffixes (including infixes)'' or ``non-infix 1325``suffixes'' means ``suffixes (including infixes)'' or ``non-infix
1318suffixes''. 1326suffixes''.
1319 1327
1320@defmac transient-define-suffix name arglist [docstring] [keyword value]... body... 1328@defmac transient-define-suffix name arglist [docstring] [keyword value]@dots{} body@dots{}
1321This macro defines @var{NAME} as a transient suffix command. 1329This macro defines @var{NAME} as a transient suffix command.
1322 1330
1323@var{ARGLIST} are the arguments that the command takes. 1331@var{ARGLIST} are the arguments that the command takes.
@@ -1334,7 +1342,7 @@ The infix arguments are usually accessed by using @code{transient-args}
1334inside @code{interactive}. 1342inside @code{interactive}.
1335@end defmac 1343@end defmac
1336 1344
1337@defmac transient-define-infix name arglist [docstring] [keyword value]... 1345@defmac transient-define-infix name arglist [docstring] [keyword value]@dots{}
1338This macro defines @var{NAME} as a transient infix command. 1346This macro defines @var{NAME} as a transient infix command.
1339 1347
1340@var{ARGLIST} is always ignored (but mandatory never-the-less) and 1348@var{ARGLIST} is always ignored (but mandatory never-the-less) and
@@ -1371,7 +1379,7 @@ define your own infix command class. In that case you have to use
1371value of the @code{:transient} keyword. 1379value of the @code{:transient} keyword.
1372@end defmac 1380@end defmac
1373 1381
1374@defmac transient-define-argument name arglist [docstring] [keyword value]... 1382@defmac transient-define-argument name arglist [docstring] [keyword value]@dots{}
1375This macro defines @var{NAME} as a transient infix command. 1383This macro defines @var{NAME} as a transient infix command.
1376 1384
1377This is an alias for @code{transient-define-infix}. Only use this alias 1385This is an alias for @code{transient-define-infix}. Only use this alias
@@ -1848,7 +1856,7 @@ object should not affect later invocations.
1848@item 1856@item
1849All suffix and infix classes derive from @code{transient-suffix}, which in 1857All suffix and infix classes derive from @code{transient-suffix}, which in
1850turn derives from @code{transient-child}, from which @code{transient-group} also 1858turn derives from @code{transient-child}, from which @code{transient-group} also
1851derives (see @ref{Group Classes}). 1859derives (@pxref{Group Classes}).
1852 1860
1853@item 1861@item
1854All infix classes derive from the abstract @code{transient-infix} class, 1862All infix classes derive from the abstract @code{transient-infix} class,
@@ -1862,7 +1870,7 @@ that does not do so. If you do that then you get to implement many
1862methods. 1870methods.
1863 1871
1864Also, infixes and non-infix suffixes are usually defined using 1872Also, infixes and non-infix suffixes are usually defined using
1865different macros (see @ref{Defining Suffix and Infix Commands}). 1873different macros (@pxref{Defining Suffix and Infix Commands}).
1866 1874
1867@item 1875@item
1868Classes used for infix commands that represent arguments should 1876Classes used for infix commands that represent arguments should
@@ -2055,7 +2063,7 @@ probably don't want that.
2055@code{transient-suffix} and @code{transient-non-suffix} play a part when 2063@code{transient-suffix} and @code{transient-non-suffix} play a part when
2056determining whether the currently active transient prefix command 2064determining whether the currently active transient prefix command
2057remains active/transient when a suffix or arbitrary non-suffix 2065remains active/transient when a suffix or arbitrary non-suffix
2058command is invoked. See @ref{Transient State}. 2066command is invoked. @xref{Transient State}.
2059 2067
2060@item 2068@item
2061@code{refresh-suffixes} Normally suffix objects and keymaps are only setup 2069@code{refresh-suffixes} Normally suffix objects and keymaps are only setup
@@ -2101,7 +2109,7 @@ of the same symbol.
2101 2109
2102@item 2110@item
2103@code{level} The level of the prefix commands. The suffix commands whose 2111@code{level} The level of the prefix commands. The suffix commands whose
2104layer is equal or lower are displayed. See @ref{Enabling and Disabling Suffixes}. 2112layer is equal or lower are displayed. @pxref{Enabling and Disabling Suffixes}.
2105 2113
2106@item 2114@item
2107@code{value} The likely outdated value of the prefix. Instead of accessing 2115@code{value} The likely outdated value of the prefix. Instead of accessing
@@ -2134,7 +2142,7 @@ Also see @ref{Suffix Classes}.
2134@code{command} The command, a symbol. 2142@code{command} The command, a symbol.
2135 2143
2136@item 2144@item
2137@code{transient} Whether to stay transient. See @ref{Transient State}. 2145@code{transient} Whether to stay transient. @xref{Transient State}.
2138 2146
2139@item 2147@item
2140@code{format} The format used to display the suffix in the popup buffer. 2148@code{format} The format used to display the suffix in the popup buffer.
@@ -2309,7 +2317,7 @@ the slots documented above, it is a predicate, but it is used for a
2309different purpose. The value has to be an integer between 1 2317different purpose. The value has to be an integer between 1
2310and 7. @code{level} controls whether a suffix or a group should be 2318and 7. @code{level} controls whether a suffix or a group should be
2311available depending on user preference. 2319available depending on user preference.
2312See @ref{Enabling and Disabling Suffixes}. 2320@xref{Enabling and Disabling Suffixes}.
2313 2321
2314@node FAQ 2322@node FAQ
2315@appendix FAQ 2323@appendix FAQ
diff --git a/lisp/transient.el b/lisp/transient.el
index 6f686afd16d..94f7700ddaf 100644
--- a/lisp/transient.el
+++ b/lisp/transient.el
@@ -3,11 +3,9 @@
3;; Copyright (C) 2018-2023 Free Software Foundation, Inc. 3;; Copyright (C) 2018-2023 Free Software Foundation, Inc.
4 4
5;; Author: Jonas Bernoulli <jonas@bernoul.li> 5;; Author: Jonas Bernoulli <jonas@bernoul.li>
6;; Homepage: https://github.com/magit/transient 6;; URL: https://github.com/magit/transient
7;; Keywords: extensions 7;; Keywords: extensions
8
9;; Version: 0.5.2 8;; Version: 0.5.2
10;; Package-Requires: ((emacs "26.1") (compat "29.1.4.4") (seq "2.24"))
11 9
12;; SPDX-License-Identifier: GPL-3.0-or-later 10;; SPDX-License-Identifier: GPL-3.0-or-later
13 11
@@ -35,7 +33,6 @@
35;;; Code: 33;;; Code:
36 34
37(require 'cl-lib) 35(require 'cl-lib)
38(require 'compat)
39(require 'eieio) 36(require 'eieio)
40(require 'edmacro) 37(require 'edmacro)
41(require 'format-spec) 38(require 'format-spec)
@@ -858,6 +855,7 @@ elements themselves.")
858 855
859;;; Define 856;;; Define
860 857
858;;;###autoload
861(defmacro transient-define-prefix (name arglist &rest args) 859(defmacro transient-define-prefix (name arglist &rest args)
862 "Define NAME as a transient prefix command. 860 "Define NAME as a transient prefix command.
863 861