branch: elpa/aidermacs
commit 38ec95a1467a63f08e8ff384cd0ab9605787270e
Author: tninja (aider) <tni...@gmail.com>
Commit: tninja (aider) <tni...@gmail.com>

    feat: Enhance aider-function-explain with interactive user input
---
 aider.el | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/aider.el b/aider.el
index 0de970fab0..42927c5055 100644
--- a/aider.el
+++ b/aider.el
@@ -457,10 +457,13 @@ The command will be formatted as \"/ask \" followed by 
the text from the selecte
 ;; New function to ask Aider to explain the function under the cursor
 ;;;###autoload
 (defun aider-function-explain ()
-  "Ask Aider to explain the function under the cursor."
+  "Ask Aider to explain the function under the cursor.
+Prompts user for specific questions about the function."
   (interactive)
   (if-let ((function-name (which-function)))
-      (let ((command (format "/ask Please explain the function: %s" 
function-name)))
+      (let* ((initial-input (format "explain %s: " function-name))
+             (user-question (aider-read-string "Enter your question about the 
function: " initial-input))
+             (command (format "/ask %s" user-question)))
         (aider-add-current-file)
         (aider--send-command command t))
     (message "No function found at cursor position.")))

Reply via email to