summaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2022-09-02 16:39:49 +0100
committerjao <jao@gnu.org>2022-09-02 16:39:49 +0100
commit75215fe4c57089e14ac9af07ac6c69591f79f664 (patch)
treea8d80f4033979a7ccf964271c5f392e1cca8ddba /lib
parent6a64ae46206bfcb3fde1780126d59229793fa94c (diff)
downloadelibs-75215fe4c57089e14ac9af07ac6c69591f79f664.tar.gz
elibs-75215fe4c57089e14ac9af07ac6c69591f79f664.tar.bz2
jao-dirmon: more friendly delta display
Diffstat (limited to 'lib')
-rw-r--r--lib/eos/jao-dirmon.el17
1 files changed, 12 insertions, 5 deletions
diff --git a/lib/eos/jao-dirmon.el b/lib/eos/jao-dirmon.el
index ad90038..a2535ad 100644
--- a/lib/eos/jao-dirmon.el
+++ b/lib/eos/jao-dirmon.el
@@ -41,6 +41,17 @@
(defvar jao-dirmon-threshold 100)
(defvar jao-dirmon-last-delta nil)
+(defun jao-dirmon--show-deltas (old current deltas)
+ (with-temp-buffer
+ (insert "High deltas since " (car old) "\n------------------\n\n")
+ (dolist (d deltas)
+ (insert d "\n"))
+ (beginning-of-buffer)
+ (pop-to-buffer (current-buffer) nil t)
+ (when (y-or-n-p "Save current state?")
+ (setf (multisession-value jao-dirmon-last)
+ (cons (current-time-string) current)))))
+
;;;###autoload
(defun jao-dirmon-report ()
(interactive)
@@ -52,11 +63,7 @@
(when (> d jao-dirmon-threshold)
(push c high))))
(setq jao-dirmon-last-delta high)
- (let ((prompt (format "High deltas since %s: %s. Save state?"
- (car old) high)))
- (when (y-or-n-p prompt)
- (setf (multisession-value jao-dirmon-last)
- (cons (current-time-string) current))))
+ (jao-dirmon--show-deltas old current jao-dirmon-last-delta)
jao-dirmon-last-delta))
(provide 'jao-dirmon)