          (foreign-keys (plist-get props :foreign-keys))
          (bindkeys (spacemacs//create-key-binding-form props body-func)))
     `(progn
+       (defvar ,props-var nil
+         ,(format (concat "Association list containing a copy of some "
+                          "properties of the transient state %S. Those "
+                          "properties are used in macro "
+                          "`spacemacs|transient-state-format-hint'.") name))
+       (add-to-list ',props-var '(hint ,hint))
+       (add-to-list ',props-var '(columns ,columns))
+       (add-to-list ',props-var '(foreign-keys ,foreign-keys))
+       (add-to-list ',props-var '(entry-sexp ,entry-sexp))
+       (add-to-list ',props-var '(exit-sexp ,exit-sexp))
        (spacemacs/defer-until-after-user-config
         '(lambda ()
            (eval
             (append
              '(defhydra ,func
-                (,(car entry-binding) ,(cadr entry-binding)
+                (nil nil
                  :hint ,hint
                  :columns ,columns
                  :foreign-keys ,foreign-keys

    which means to not exit but warn the user that the key is not part
    of the transient state, or run, which means to try to run the key binding
    without exiting.
`:entry-binding MAP KEY'
    Key binding to use for entering the transient state.
`:bindings EXPRESSIONS'
    One or several EXPRESSIONS with the form
    (STRING1 SYMBOL1 DOCSTRING


(defun spacemacs//transient-state-make-doc
    (transient-state docstring &optional body)
  "Use `hydra' internal function to format and apply DOCSTRING."
  (let ((heads (spacemacs//transient-state-heads-name transient-state)))
    (setq body (if body body '(nil nil :hint nil :foreign-keys nil)))
    (eval
     (hydra--format nil body docstring (symbol-value heads)))))

(defmacro spacemacs|transient-state-format-hint (name var hint)
  "Format HINT and store the result in VAR for transient state NAME."
  (declare (indent 1))
  `(add-hook 'spacemacs-post-user-config-hook
             (lambda ()
               (let* ((props-var ,(spacemacs//transient-state-props-var-name
                                   name))
                      (prop-hint (cadr (assq 'hint props-var)))
                      (prop-columns (cadr (assq 'columns props-var)))
                      (prop-foreign-keys (cadr (assq 'foreign-keys props-var)))
                      (prop-entry-sexp (cadr (assq 'entry-sexp props-var)))
                      (prop-exit-sexp (cadr (assq 'exit-sexp props-var))))
                 (setq ,var (spacemacs//transient-state-make-doc
                             ',name
                             ,hint
                             `(nil
                               nil
                               :hint ,prop-hint
                               :columns ,prop-columns
                               :foreign-keys ,prop-foreign-keys
                               :body-pre ,prop-entry-sexp
                               :before-exit ,prop-exit-sexp)))
                 'append))))

(defface spacemacs-transient-state-title-face
  `((t :inherit mode-line))
