[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/emacs-gc-stats 048af820a7 06/24: emacs-gc-stats-save-se
From: |
ELPA Syncer |
Subject: |
[elpa] externals/emacs-gc-stats 048af820a7 06/24: emacs-gc-stats-save-session: Smarter repeated session data save |
Date: |
Sat, 10 Jun 2023 12:58:44 -0400 (EDT) |
branch: externals/emacs-gc-stats
commit 048af820a7f08fe59ca84e6e78c8a254613ab3ec
Author: Ihor Radchenko <yantar92@posteo.net>
Commit: Ihor Radchenko <yantar92@posteo.net>
emacs-gc-stats-save-session: Smarter repeated session data save
* emacs-gc-stats.el (emacs-gc-stats-save-session): Overwrite
previously saved data for the current Emacs session.
---
emacs-gc-stats.el | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/emacs-gc-stats.el b/emacs-gc-stats.el
index e2697f358f..1c2b091749 100644
--- a/emacs-gc-stats.el
+++ b/emacs-gc-stats.el
@@ -131,11 +131,16 @@ Otherwise, collect symbol."
(and (file-readable-p emacs-gc-stats-file)
(with-temp-buffer
(insert-file-contents emacs-gc-stats-file)
- (ignore-errors (read (current-buffer)))))))
+ (ignore-errors (read (current-buffer))))))
+ (session (reverse emacs-gc-stats--data)))
+ ;; remove end data in case if we continue recording.
+ (pop emacs-gc-stats--data)
(with-temp-file emacs-gc-stats-file
;; Override partially saved session.
- (setf (alist-get (car emacs-gc-stats--data) previous-sessions)
- (cdr emacs-gc-stats--data))
+ (let ((existing (assoc (car session) previous-sessions)))
+ (if existing
+ (setcdr (cdr existing) (cdr session))
+ (push session previous-sessions)))
(prin1 previous-sessions (current-buffer)))))
(defun emacs-gc-stats-clear ()
- [elpa] branch externals/emacs-gc-stats created (now fc3792d67c), ELPA Syncer, 2023/06/10
- [elpa] externals/emacs-gc-stats b2c73b2dc0 01/24: Initial commit, ELPA Syncer, 2023/06/10
- [elpa] externals/emacs-gc-stats d2f48f488c 05/24: Update the usage docs, ELPA Syncer, 2023/06/10
- [elpa] externals/emacs-gc-stats 048af820a7 06/24: emacs-gc-stats-save-session: Smarter repeated session data save,
ELPA Syncer <=
- [elpa] externals/emacs-gc-stats 9183a40b15 03/24: Do not use :time keyword in stat data, ELPA Syncer, 2023/06/10
- [elpa] externals/emacs-gc-stats bc6fe1e960 10/24: Record `memory-info' output, ELPA Syncer, 2023/06/10
- [elpa] externals/emacs-gc-stats e06240ad05 14/24: Add license, ELPA Syncer, 2023/06/10
- [elpa] externals/emacs-gc-stats ec9b22d455 15/24: Add README, ELPA Syncer, 2023/06/10
- [elpa] externals/emacs-gc-stats f317944684 19/24: reword README, ELPA Syncer, 2023/06/10
- [elpa] externals/emacs-gc-stats 248ade4f62 04/24: Add `emacs-gc-stats-clear' command, ELPA Syncer, 2023/06/10
- [elpa] externals/emacs-gc-stats fdbb7251b4 07/24: Record init.el stats, ELPA Syncer, 2023/06/10
- [elpa] externals/emacs-gc-stats e64d069950 08/24: Record `memory-info' on init only, ELPA Syncer, 2023/06/10
- [elpa] externals/emacs-gc-stats 30340df54c 18/24: Use Org for README source, ELPA Syncer, 2023/06/10
- [elpa] externals/emacs-gc-stats 1a8cd5dd08 11/24: Add idle time counter, ELPA Syncer, 2023/06/10