Function: eca-chat--render-ask-question-standalone

eca-chat--render-ask-question-standalone is a natively compiled function defined in eca-chat.el.

Signature

(eca-chat--render-ask-question-standalone QUESTION)

Documentation

Insert a standalone block for QUESTION and return its overlay.

Used as fallback when no toolCallId is available.

Source Code

;; Defined in /nix/store/jklqzw6pzz6j4jrbv8wy0iwgi7jlrbld-emacs-packages-deps/share/emacs/site-lisp/elpa/eca-20260928.1827/eca-chat.el
(defun eca-chat--render-ask-question-standalone (question)
  "Insert a standalone block for QUESTION and return its overlay.
Used as fallback when no toolCallId is available."
  (save-excursion
    (goto-char (eca-chat--content-insertion-point))
    (eca-chat--insert
     (concat "\n"
             (propertize (concat "Q: " (plist-get question :question))
                         'font-lock-face 'eca-chat-question-face)
             "\n"))
    (let ((block-start (point))
          (options (plist-get question :options)))
      (eca-chat--insert
       (concat
        (when options
          (concat
           "\n"
           (mapconcat
            (lambda (opt)
              (let* ((ld (eca-chat--normalize-question-option opt))
                     (label (car ld))
                     (desc (cdr ld))
                     (btn (eca-chat--question-button
                           (propertize label 'font-lock-face 'eca-chat-question-option-face)
                           (lambda ()
                             (eca-chat--answer-question question label)))))
                (concat "  " btn
                        (when desc
                          (concat "  " (propertize desc 'font-lock-face 'eca-chat-question-description-face)))
                        "\n")))
            options
            "")))
        "\n  "
        (eca-chat--question-button
         (propertize "Cancel" 'font-lock-face '(error :underline t))
         (lambda () (eca-chat--cancel-question question)))
        "\n\n"))
      (make-overlay block-start (point)))))