[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/greader ff3b89c5e9 2/2: First draft of `greader-estimat
From: |
ELPA Syncer |
Subject: |
[elpa] externals/greader ff3b89c5e9 2/2: First draft of `greader-estimated-time-mode'. |
Date: |
Sun, 8 Dec 2024 09:58:05 -0500 (EST) |
branch: externals/greader
commit ff3b89c5e9228d9d48c68cb3b20c683284237f0f
Author: Michelangelo Rodriguez <michelangelo.rodriguez@gmail.com>
Commit: Michelangelo Rodriguez <michelangelo.rodriguez@gmail.com>
First draft of `greader-estimated-time-mode'.
This minor mode keeps updated the mode line with the remaining reading
time of the current buffer.
When you disable it, the banner is removed.
---
greader.el | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/greader.el b/greader.el
index 7055bd1411..f29d7f7f32 100644
--- a/greader.el
+++ b/greader.el
@@ -1809,5 +1809,25 @@ If the region is active, use it."
(dtk-speak (car (greader--estimated-reading-time)))))
(force-mode-line-update))
+;;;###autoload
+(define-minor-mode greader-estimated-time-mode
+ "keep mode line updated in respect of remaining reading time.
+This mode updates the mode line on certain events, such as when pass
+to the next sentence, or when you stop the reading."
+ :lighter " "
+ (if greader-estimated-time-mode
+ (progn
+ (add-hook 'greader-before-read-hook
+ #'greader-estimated-time-update)
+ (add-hook 'greader-after-stop-hook
+ #'greader-estimated-time-update))
+ (remove-hook 'greader-before-read-hook 'greader-estimated-time-update)
+ (remove-hook 'greader-after-stop-hook
+ 'greader-estimated-time-update)
+ (greader--estimated-reading-time-remove))
+ (force-mode-line-update))
+
+
+
(provide 'greader)
;;; greader.el ends here