branch: elpa/aidermacs
commit feb662819dd89c4dd1675378ebc65bb6f5fb6350
Author: Kang Tu <kang...@apple.com>
Commit: Kang Tu (aider) <kang...@apple.com>

    feat: add function to batch add marked Dired files to Aider buffer
---
 aider.el | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/aider.el b/aider.el
index aa75f275c9..8a2acac393 100644
--- a/aider.el
+++ b/aider.el
@@ -14,6 +14,7 @@
 (require 'comint)
 (require 'transient)
 (require 'which-func)
+(require 'dired)
 
 (defgroup aider nil
   "Customization group for the Aider package."
@@ -160,6 +161,16 @@ COMMAND should be a string representing the command to 
send."
       ;; Use the shared helper function to send the command
       (aider--send-command command t))))
 
+;; New function to add multiple Dired marked files to Aider buffer
+(defun aider-batch-add-dired-marked-files ()
+  "Add multiple Dired marked files to the Aider buffer with the \"/add\" 
command."
+  (interactive)
+  (let ((files (dired-get-marked-files)))
+    (if files
+        (dolist (file files)
+          (aider--send-command (format "/add %s" (expand-file-name file))))
+      (message "No files marked in Dired."))))
+
 ;; Function to send a custom command to corresponding aider buffer
 (defun aider-general-command ()
   "Prompt the user to input COMMAND and send it to the corresponding aider 
comint buffer."

Reply via email to