[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/aidermacs b3450f17b0 112/466: Merge branch 'main' of githu
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/aidermacs b3450f17b0 112/466: Merge branch 'main' of github.com:tninja/aider.el |
Date: |
Sat, 15 Mar 2025 19:12:18 -0400 (EDT) |
branch: elpa/aidermacs
commit b3450f17b046da27332a7d9c682ec71659eca073
Merge: 2cf6150925 0742aa2666
Author: Kang Tu <kang_tu@apple.com>
Commit: Kang Tu <kang_tu@apple.com>
Merge branch 'main' of github.com:tninja/aider.el
---
README.org | 16 +++++++++++++++-
aider.el | 44 ++++++++++++++++++++++++++++++--------------
2 files changed, 45 insertions(+), 15 deletions(-)
diff --git a/README.org b/README.org
index 5382646e3a..4701442037 100644
--- a/README.org
+++ b/README.org
@@ -41,7 +41,21 @@
** Optional
-- If you use helm, maybe you can load the helm-aider.el manually. That file
added support of command history and completion from helm.
+- Maybe you might want to try helm-aider.el. That file added support of
command history and completion from helm.
+
+- If you enjoy writing aider command in a separate file and send them to aider
session, just like working on python or R script and send code block into REPL,
you might want to try aider-minor-mode. It by default bind C-c C-n to send
current line to aider session, and C-c C-c to send current region to aider
session.
+
+- To automatically enable aider-minor-mode to any file with aider inside
filename
+
+#+BEGIN_SRC emacs-lisp
+ (add-hook 'find-file-hook
+ (lambda ()
+ (when (and (buffer-file-name)
+ (string-match-p "aider" (buffer-file-name)))
+ (aider-minor-mode 1))))
+
+ (provide 'aider)
+#+END_SRC
* Screenshot
diff --git a/aider.el b/aider.el
index 730b5b1d3a..94b8e39ec5 100644
--- a/aider.el
+++ b/aider.el
@@ -55,8 +55,9 @@ This function can be customized or redefined by the user."
]
["Add file to aider"
("f" "Add Current File" aider-add-current-file)
- ("F" "Find Files in the Git Repo" aider-repo-find-name-dired)
+ ("w" "Add All Files in Current Window" aider-add-files-in-current-window)
("b" "Batch Add Dired Marked Files" aider-batch-add-dired-marked-files)
+ ("F" "Find Files in the Git Repo" aider-repo-find-name-dired)
("R" "Open Git Repo Root Dired" aider-git-repo-root-dired)
]
["Code change"
@@ -294,19 +295,34 @@ The command will be formatted as \"/architect \" followed
by the user command an
(point)))))
(aider--send-command (string-trim paragraph) t)))
-(defun aider-mode-setup ()
- "Setup key bindings for Aider mode."
- (local-set-key (kbd "C-c C-n") 'aider-send-line-under-cursor)
- (local-set-key (kbd "C-c C-c") 'aider-send-paragraph))
-
-(add-hook 'aider-mode-hook 'aider-mode-setup)
-
-(define-derived-mode aider-mode fundamental-mode "Aider"
- "Major mode for editing Aider files."
- ;; Add any additional setup for aider-mode here
- )
-
-(add-to-list 'auto-mode-alist '("\\.aider\\'" . aider-mode))
+;; Define the keymap for Aider Minor Mode
+(defvar aider-minor-mode-map
+ (let ((map (make-sparse-keymap)))
+ (define-key map (kbd "C-c C-n") 'aider-send-line-under-cursor)
+ (define-key map (kbd "C-c C-c") 'aider-send-paragraph)
+ map)
+ "Keymap for Aider Minor Mode.")
+
+;; New function to add files in all buffers in current emacs window
+(defun aider-add-files-in-current-window ()
+ "Add files in all buffers in the current Emacs window to the Aider buffer."
+ (interactive)
+ (let ((files (mapcar (lambda (buffer)
+ (with-current-buffer buffer
+ (when buffer-file-name
+ (expand-file-name buffer-file-name))))
+ (mapcar 'window-buffer (window-list)))))
+ (setq files (delq nil files))
+ (if files
+ (let ((command (concat "/add " (mapconcat 'identity files " "))))
+ (aider--send-command command nil))
+ (message "No files found in the current window."))))
+
+;; Define the Aider Minor Mode
+(define-minor-mode aider-minor-mode
+ "Minor mode for Aider with keybindings."
+ :lighter " Aider"
+ :keymap aider-minor-mode-map)
(provide 'aider)
- [nongnu] elpa/aidermacs eec7180732 067/466: refactor: Pass home-path as argument to aider-buffer-name-from-git-repo-path, (continued)
- [nongnu] elpa/aidermacs eec7180732 067/466: refactor: Pass home-path as argument to aider-buffer-name-from-git-repo-path, ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs 439a2c7d71 075/466: feat: custom option of aider program, ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs 77e33c72fc 076/466: enh: autoload entry commands, ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs 8a039d5137 082/466: Merge pull request #5 from AmaiKinono/custom-aider-program, ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs e0e77f3874 090/466: add aider-send-line-under-cursor, ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs c57f083466 097/466: feat: add interactive function to run find-name-dired from Git repository root, ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs 9fc3b04775 099/466: Feat: Git repo find / mark / add files, and buffer send command for .aider file (#7), ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs a181be69c6 102/466: update place to invoke aider--send-command. remove dup, ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs dbcc393ba0 105/466: Feat: aider-minor-mode (#10), ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs 0cb131bd9e 107/466: feat: Add function to add files in current window to Aider buffer, ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs b3450f17b0 112/466: Merge branch 'main' of github.com:tninja/aider.el,
ELPA Syncer <=
- [nongnu] elpa/aidermacs e391bbe222 113/466: Feat: Add function to explain code in selected region, ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs 134c626bc3 117/466: feat: Add option for Architect Discuss and Change in code change menu, ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs 3d4919292e 139/466: Feat: Basic support for Test Driven Development (TDD) (#29), ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs 7f3601920b 140/466: Feat: Add two code reading helper functions (#30), ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs d60824add8 142/466: Refactor: combine function under cursor function and region based function as single one (#34), ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs 257fe7e8f0 152/466: docs: improve README.org organization with clear sections, ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs 5e71503bc8 161/466: refactor: Update aider--escape-string-for-aider to handle multiline strings with special markers, ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs 19e04225f3 206/466: Merge pull request #74 from tninja/kang_feat_2, ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs f90000ca14 211/466: Fix: Handle the case when the current buffer file is not in a git repo (#79), ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs ebe03e12c0 208/466: docs(readme): reorganize sections for better readability, ELPA Syncer, 2025/03/15