branch: elpa/aidermacs
commit 8bf54654ab573a2adf9186ad9c290ba671e0ac45
Author: Reza A'masyi <mnurrr...@gmail.com>
Commit: Matthew Zeng <matthew...@gmail.com>

    feat: Add read-only files configuration to aidermacs
---
 aidermacs.el | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/aidermacs.el b/aidermacs.el
index 8363940b27..22c723c2ea 100644
--- a/aidermacs.el
+++ b/aidermacs.el
@@ -77,6 +77,10 @@ ignoring other configuration settings except 
`aidermacs-extra-args'."
   "Additional arguments to pass to the aidermacs command."
   :type '(repeat string))
 
+(defcustom aidermacs-read-only-files '()
+  "When non-nil, add read-only files to the aidermacs session."
+  :type '(repeat string))
+
 (defcustom aidermacs-subtree-only nil
   "When non-nil, run aider with --subtree-only in the current directory.
 This is useful for working in monorepos where you want to limit aider's scope."
@@ -336,7 +340,11 @@ This function sets up the appropriate arguments and 
launches the process."
              (when aidermacs-weak-model
                (list "--weak-model" aidermacs-weak-model))
              (when aidermacs-subtree-only
-               '("--subtree-only")))))
+               '("--subtree-only"))
+             (when aidermacs-read-only-files
+               (apply #'append
+                 (mapcar (lambda (file) (list "--read" file))
+                         aidermacs-read-only-files))))))
          ;; Take the original aidermacs-extra-args instead of the flat ones
          (final-args (append backend-args aidermacs-extra-args)))
     (if (aidermacs--live-p buffer-name)

Reply via email to