4.6 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.