[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/aidermacs 263f7627bf 462/466: Refactor aidermacs-send-regi
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/aidermacs 263f7627bf 462/466: Refactor aidermacs-send-region-by-line |
Date: |
Sat, 15 Mar 2025 19:19:51 -0400 (EDT) |
branch: elpa/aidermacs
commit 263f7627bf3bb2a9dbedd656d678a40f50d34cad
Author: Mingde (Matthew) Zeng <matthewzmd@posteo.net>
Commit: Mingde (Matthew) Zeng <matthewzmd@posteo.net>
Refactor aidermacs-send-region-by-line
Signed-off-by: Mingde (Matthew) Zeng <matthewzmd@posteo.net>
---
README.md | 5 +++++
aidermacs.el | 25 ++++++++++++-------------
2 files changed, 17 insertions(+), 13 deletions(-)
diff --git a/README.md b/README.md
index a6f117fdf1..02842ef64f 100644
--- a/README.md
+++ b/README.md
@@ -3,7 +3,12 @@
</p>
# Aidermacs: AI Pair Programming in Emacs
+[](https://github.com/MatthewZMD/aidermacs/blob/master/LICENSE)
[](https://melpa.org/#/aidermacs)
+[](https://www.gnu.org/savannah-checkouts/gnu/emacs/emacs.html)
+[](https://github.com/MatthewZMD/aidermacs/graphs/contributors)
+[](https://github.com/MatthewZMD/aidermacs/issues)
+[](https://github.com/MatthewZMD/aidermacs/pull/new)
Missing [Cursor](https://cursor.sh) but prefer living in Emacs? Aidermacs
brings Cursor-like AI-powered development to your Emacs workflow by integrating
[Aider](https://github.com/paul-gauthier/aider), one of the most powerful
open-source AI pair programming tools. As a community-driven project, Aidermacs
prioritizes Emacs users' needs and preferences while providing the same
powerful features found in Cursor!
diff --git a/aidermacs.el b/aidermacs.el
index 1c6defae52..9f5b5c6c7c 100644
--- a/aidermacs.el
+++ b/aidermacs.el
@@ -1094,19 +1094,18 @@ Otherwise, send the line under cursor."
(when text
(aidermacs--send-command text))))
-(defun aidermacs-send-region-by-line ()
- "Send the text of the current selected region, split into lines."
- (interactive)
- (if (use-region-p)
- (let* ((text (buffer-substring-no-properties
- (region-beginning) (region-end)))
- (lines (split-string text "\n" t)))
- (mapc (lambda (line)
- (let ((trimmed (string-trim line)))
- (when (not (string-empty-p trimmed))
- (aidermacs--send-command trimmed))))
- lines))
- (message "No region selected.")))
+(defun aidermacs-send-region-by-line (start end)
+ "Send the text between START and END, line by line.
+Only sends non-empty lines after trimming whitespace."
+ (interactive "r")
+ (with-restriction start end
+ (save-excursion
+ (goto-char (point-min))
+ (while (not (eobp))
+ (let ((line (string-trim (thing-at-point 'line t))))
+ (when (not (string-empty-p line))
+ (aidermacs--send-command line)))
+ (forward-line 1)))))
(defun aidermacs-send-block-or-region ()
"Send the current active region text or current paragraph content.
- [nongnu] elpa/aidermacs da760ca70c 439/466: Fix linting, (continued)
- [nongnu] elpa/aidermacs da760ca70c 439/466: Fix linting, ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs 74b1859c00 440/466: Add Tramp Support, ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs 24f04aba1a 442/466: Merge pull request #56 from rschmukler/rschmukler/tramp, ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs 87a493a530 446/466: Add Doctor PR action file, ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs 7576735dcb 448/466: use ANTHROPIC_API_KEY, ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs 0cf26f7246 449/466: Merge pull request #64 from philip-zhan/setup-doctor-pr, ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs 7c0b60763b 453/466: Bump emacs version dep, ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs ba2d7576c9 454/466: aidermacs-backend-comint: string should be downcase, ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs 8ecfa8cbd7 456/466: Restore aidermacs-send-region-by-line, ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs eb22b29067 461/466: Merge pull request #63 from amake/feature/selective-drop, ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs 263f7627bf 462/466: Refactor aidermacs-send-region-by-line,
ELPA Syncer <=
- [nongnu] elpa/aidermacs 61a23c7992 466/466: Better prepare code edit, ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs 800c109413 289/466: Update paperwork, remove examples, ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs 4b94390318 298/466: Run Aider automatically if it is not already running, ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs d775ffafaa 300/466: Add logo, ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs 04209e9e35 304/466: Merge pull request #21 from CeleritasCelery/redirect-wip, ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs 0b815735a4 305/466: Refactor aidermacs--form-prompt, ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs f6458bcd8a 308/466: Add aidermacs-add-files-interactively, ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs 801c32953d 307/466: Refactor aidermacs-run, ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs 303f970ae9 309/466: Further refactoring, ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs bfe77da986 311/466: Add aidermacs-extra-args, time to remove aidermacs-args from config, ELPA Syncer, 2025/03/15