From 2d5c33c8d974344c575e672fa0562987b200d978 Mon Sep 17 00:00:00 2001 From: tninja Date: Tue, 11 Nov 2025 08:19:24 -0800 Subject: [PATCH] Remove ai-code--claude-code-send-command-impl and update backends to use claude-code--do-send-command directly --- .gitignore | 5 +++++ ai-code-backends.el | 21 +-------------------- ai-code-codex-cli.el | 3 +-- ai-code-github-copilot-cli.el | 3 +-- 4 files changed, 8 insertions(+), 24 deletions(-) diff --git a/.gitignore b/.gitignore index 13d89ce..071df9f 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,8 @@ GTAGS GRTAGS GPATH +.ai.code.prompt.org +.projectile +GTAGS +GRTAGS +GPATH diff --git a/ai-code-backends.el b/ai-code-backends.el index 78cc67e..86c3717 100644 --- a/ai-code-backends.el +++ b/ai-code-backends.el @@ -27,25 +27,6 @@ (interactive "P") (ai-code--unsupported-resume arg)) -(defun ai-code--claude-code-send-command-impl (cmd) - "Send CMD to claude-code terminal backend programmatically. -This function bypasses the interactive prompt in `claude-code-send-command' -and directly sends the command to the terminal. It first attempts to use -`claude-code--do-send-command' if available, otherwise falls back to -`claude-code--term-send-string'." - (cond - ;; Try the newer claude-code--do-send-command if available (returns selected-buffer) - ((and (fboundp 'claude-code--do-send-command) - (boundp 'claude-code-terminal-backend)) - (claude-code--do-send-command cmd)) - ;; Fall back to older claude-code--term-send-string - ((and (fboundp 'claude-code--term-send-string) - (boundp 'claude-code-terminal-backend)) - (claude-code--term-send-string claude-code-terminal-backend - (concat cmd "\n"))) - (t - (error "claude-code backend functions not available")))) - ;;;###autoload (defun ai-code-claude-code-send-command (cmd) "Send CMD to claude-code programmatically or interactively. @@ -54,7 +35,7 @@ which no longer accepts a command parameter. When called interactively, prompts for the command. When called from Lisp code, sends CMD directly without prompting." (interactive "sClaude command: ") - (ai-code--claude-code-send-command-impl cmd)) + (claude-code--do-send-command cmd)) ;;;###autoload (defcustom ai-code-backends diff --git a/ai-code-codex-cli.el b/ai-code-codex-cli.el index 00c0437..41951f4 100644 --- a/ai-code-codex-cli.el +++ b/ai-code-codex-cli.el @@ -12,7 +12,6 @@ (declare-function claude-code--start "claude-code" (arg extra-switches &optional force-prompt force-switch-to-buffer)) (declare-function claude-code--term-send-string "claude-code" (backend string)) -(declare-function ai-code--claude-code-send-command-impl "ai-code-backends" (cmd)) (defvar claude-code-terminal-backend) @@ -45,7 +44,7 @@ When called interactively, prompts for the command. When called from Lisp code, sends LINE directly without prompting." (interactive "sCodex> ") - (ai-code--claude-code-send-command-impl line)) + (claude-code--do-send-command line)) ;;;###autoload (defun codex-cli-resume (&optional arg) diff --git a/ai-code-github-copilot-cli.el b/ai-code-github-copilot-cli.el index 840f762..5146871 100644 --- a/ai-code-github-copilot-cli.el +++ b/ai-code-github-copilot-cli.el @@ -18,7 +18,6 @@ (declare-function claude-code-switch-to-buffer "claude-code" (&optional arg)) (declare-function claude-code--start "claude-code" (arg extra-switches &optional force-prompt force-switch-to-buffer)) (declare-function claude-code--term-send-string "claude-code" (backend string)) -(declare-function ai-code--claude-code-send-command-impl "ai-code-backends" (cmd)) (defgroup ai-code-github-copilot-cli nil @@ -50,7 +49,7 @@ When called interactively, prompts for the command. When called from Lisp code, sends LINE directly without prompting." (interactive "sCopilot> ") - (ai-code--claude-code-send-command-impl line)) + (claude-code--do-send-command line)) ;;;###autoload (defun github-copilot-cli-resume (&optional arg)