[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/aidermacs b105ca5e4a 257/466: feat: Add output history dis
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/aidermacs b105ca5e4a 257/466: feat: Add output history display and last output copy functions |
Date: |
Sat, 15 Mar 2025 19:15:31 -0400 (EDT) |
branch: elpa/aidermacs
commit b105ca5e4a8979fff98e5238b6a9d59f5199f778
Author: Mingde (Matthew) Zeng <matthewzmd@posteo.net>
Commit: Mingde (Matthew) Zeng <matthewzmd@posteo.net>
feat: Add output history display and last output copy functions
refactor: Remove local variable scoping for aidermacs output history
variables
---
aidermacs-backends.el | 31 ++++++++++++++++++++++++++++---
aidermacs.el | 3 +++
2 files changed, 31 insertions(+), 3 deletions(-)
diff --git a/aidermacs-backends.el b/aidermacs-backends.el
index 1c10c30a7f..b320aff6da 100644
--- a/aidermacs-backends.el
+++ b/aidermacs-backends.el
@@ -32,14 +32,14 @@ of using a comint process."
:type 'integer
:group 'aidermacs-output)
-(defvar-local aidermacs--output-history nil
+(defvar aidermacs--output-history nil
"List to store aidermacs output history.
Each entry is a cons cell (timestamp . output-text).")
-(defvar-local aidermacs--last-command nil
+(defvar aidermacs--last-command nil
"Store the last command sent to aidermacs.")
-(defvar-local aidermacs--current-output nil
+(defvar aidermacs--current-output nil
"Accumulator for current output being captured.")
(defun aidermacs-get-output-history (&optional limit)
@@ -59,6 +59,31 @@ Returns a list of (timestamp . output-text) pairs, most
recent first."
(interactive)
(setq aidermacs--output-history nil))
+
+(defun aidermacs-show-output-history ()
+ "Display the AI output history in a new buffer."
+ (interactive)
+ (let ((buf (get-buffer-create "*aidermacs-history*"))
+ (history aidermacs--output-history)) ; Get history from current buffer
+ (with-current-buffer buf
+ (erase-buffer)
+ (display-line-numbers-mode 1)
+ (dolist (entry history) ; Use passed history
+ (let ((timestamp (format-time-string "%Y-%m-%d %H:%M:%S" (car entry)))
+ (output (cdr entry)))
+ (insert (format "=== %s ===\n%s\n\n" timestamp output))))
+ (goto-char (point-min)))
+ (display-buffer buf)))
+
+(defun aidermacs-copy-last-output ()
+ "Copy the most recent AI output to the kill ring."
+ (interactive)
+ (if-let ((last-output (cdr (aidermacs-get-last-output))))
+ (progn
+ (kill-new last-output)
+ (message "Copied last AI output to kill ring"))
+ (message "No AI output available")))
+
(defun aidermacs--store-output (output)
"Store OUTPUT in the history with timestamp."
(setq aidermacs--current-output output)
diff --git a/aidermacs.el b/aidermacs.el
index ca362976b6..240dfb2572 100644
--- a/aidermacs.el
+++ b/aidermacs.el
@@ -65,6 +65,7 @@ This is the file name without path."
(defvar aidermacs-read-string-history nil
"History list for aidermacs read string inputs.")
+
(if (bound-and-true-p savehist-loaded)
(add-to-list 'savehist-additional-variables 'aidermacs-read-string-history)
(add-hook 'savehist-mode-hook
@@ -167,6 +168,8 @@ Affects the system message too.")
("Q" "Ask General Question" aidermacs-general-question)
("p" "Open Prompt File" aidermacs-open-prompt-file)
("h" "Help" aidermacs-help)
+ ("H" "Show Output History" aidermacs-show-output-history)
+ ("C" "Copy Last Output" aidermacs-copy-last-output)
]
])
- [nongnu] elpa/aidermacs 5d5b5a8474 147/466: docs: Update README with consistent function descriptions, (continued)
- [nongnu] elpa/aidermacs 5d5b5a8474 147/466: docs: Update README with consistent function descriptions, ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs a7f2153452 167/466: Merge pull request #41 from LukeMauldin/main, ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs 78d61629c1 209/466: improve README clarity and fix grammar issues, ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs 2c837d3354 219/466: Feat: Improve aider-minor-mode (#86), ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs b412d331e5 220/466: docs(readme): reorganize features section for better readability, ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs 154b90da78 239/466: Merge pull request #7 from CeleritasCelery/vterm-theme, ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs 75fdfc4a7d 243/466: docs: Rewrite README with comprehensive usage guide for Aidermacs, ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs 772a6df60b 245/466: docs: Update README keybindings to match transient menu commands, ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs 42a8368df8 254/466: Fix regression from #10, ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs 9041bbe32a 249/466: Merge pull request #10 from zsxh/fix/vterm, ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs b105ca5e4a 257/466: feat: Add output history display and last output copy functions,
ELPA Syncer <=
- [nongnu] elpa/aidermacs 496286785c 282/466: Only show models currently supported by aider, ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs 0e828efdd8 264/466: feat: Add file listing functionality to Aidermacs session management, ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs 571f9ad495 299/466: Merge pull request #20 from CeleritasCelery/auto-start, ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs 9ce579a061 303/466: aidermacs--get-available-models should use new aidermacs--send-command-redirect, ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs a684e349e7 314/466: Sync with aidermacs-helm and aidermacs-doom., ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs 3632d13189 312/466: Respect someone's aidermacs-extra-args --model, ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs 2d39bfa5b3 315/466: Improve README, ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs acdf6b41aa 321/466: Update README, ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs 117fc315af 327/466: fix: don't switch to aider buffer before reading region, ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs 04ee33f6a2 320/466: Improving check for existing .aider.conf.yml, ELPA Syncer, 2025/03/15