magit / transient

Transient commands

Home Page:https://magit.vc/manual/transient

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

include option to ignore the suffix <suffix> is not defined warning.

MirkoHernandez opened this issue · comments

I did not found a way to ignore the "suffix is not defined" warnings.
Must all the commands used in a given prefix always be previously defined?. This makes the prefix unusable until all the commands are valid.

As the error message mentions, it is enough if the command is autoloaded.

If you want to add a command from a package that may not be installed, then you can either add the suffix command to the prefix in the package that defines the command, using transient-insert-suffix, or you can use the :if property like so:

(transient-define-prefix example ()
  [("a" "undefined" undefined-command
    :if (lambda () (commandp 'undefined-command)))
   ("b" "next-line" next-line)])