You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"Return an Emacs runtime debugging prompt from DESCRIPTION.
485
-
ENABLE-EVAL-ELISP describes whether `eval_elisp' is available."
486
+
EVAL-AVAILABLE-P reports whether `eval_elisp' is globally enabled.
487
+
REQUEST-EVAL-ELISP reports whether this debug run may use it."
486
488
(format
487
489
(concat
488
490
"Use the Emacs MCP tools available in this session to debug my Emacs runtime.\n"
@@ -493,9 +495,13 @@ ENABLE-EVAL-ELISP describes whether `eval_elisp' is available."
493
495
"Explain what you find, then recommend the smallest fix or next step.\n\n"
494
496
"Runtime issue description:\n"
495
497
"%s")
496
-
(if enable-eval-elisp
497
-
"eval_elisp is enabled in your Emacs MCP config."
498
-
"eval_elisp is disabled in your Emacs MCP config, so rely on non-eval inspection tools unless you first enable ai-code-mcp-debug-tools-enable-eval-elisp.")
498
+
(cond
499
+
((and eval-available-p request-eval-elisp)
500
+
"eval_elisp is enabled in your Emacs MCP config and is allowed for this debugging run.")
501
+
(eval-available-p
502
+
"eval_elisp is enabled in your Emacs MCP config, but it was not requested for this debugging run.")
503
+
(t
504
+
"eval_elisp is disabled in your Emacs MCP config, so rely on non-eval inspection tools unless you first enable ai-code-mcp-debug-tools-enable-eval-elisp."))
499
505
description))
500
506
501
507
;;;###autoload
@@ -508,20 +514,23 @@ ENABLE-EVAL-ELISP describes whether `eval_elisp' is available."
508
514
(let* ((description
509
515
(ai-code-read-string
510
516
"Describe the Emacs runtime issue (it can be an interactive function or a key binding): "))
;; DONE: add a menu item: Debug your emacs runtime. It will temporarily enable ai-code-mcp-debug-tools-enabled, and ask user if they want to enable ai-code-mcp-debug-tools-enable-eval-elisp (eval elisp with AI?) to further help debugging. User can describe what happens (We prompt them that it can debug an interactive function or a key-binding). The final prompt will assemble with user description and then tell AI to user emacs mcp tools to debug. After user confirm the prompt, send to AI.
0 commit comments