branch: elpa/aidermacs
commit 9d819c1041d564d1691d1887f378ffdb24091da0
Author: Haris Gušić <harisgusic....@gmail.com>
Commit: Matthew Zeng <matthew...@gmail.com>

    feat: Add aidermacs-run-in-directory with ":" key binding
---
 aidermacs.el | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/aidermacs.el b/aidermacs.el
index 9b145b226f..d928561daf 100644
--- a/aidermacs.el
+++ b/aidermacs.el
@@ -197,6 +197,7 @@ This is the file name without path."
    ["Core"
     ("a" "Start/Open Session" aidermacs-run)
     ("." "Start in Current Dir" aidermacs-run-in-current-dir)
+    (":" "Start in Chosen Dir" aidermacs-run-in-directory)
     ("l" "Clear Chat History" aidermacs-clear-chat-history)
     ("s" "Reset Session" aidermacs-reset)
     ("x" "Exit Session" aidermacs-exit)]
@@ -435,6 +436,15 @@ This is useful for working in monorepos where you want to 
limit aider's scope."
   (let ((aidermacs-subtree-only t))
     (aidermacs-run)))
 
+(defun aidermacs-run-in-directory (directory)
+  "Prompt for a directory and run aidermacs with --subtree-only flag.
+This is useful for working in complex monorepos with nested subprojects."
+  (interactive
+   (list (read-file-name "Choose a directory: " nil nil t nil 
'file-directory-p)))
+   (let ((aidermacs-subtree-only t)
+         (default-directory directory))
+    (aidermacs-run)))
+
 (defun aidermacs--command-may-edit-files (command)
   "Check if COMMAND may result in file edits.
 Returns t if the command is likely to modify files, nil otherwise.

Reply via email to