From 6b62b567cbda4980bf5c80526a078d494338a086 Mon Sep 17 00:00:00 2001 From: Noah Friedman Date: Tue, 19 Jul 1994 00:52:56 +0000 Subject: [PATCH] type-break-check: Shrink keystroke count if it is less than min-threshold chars from max-threshold, not more. type-break-statistics: If time for scheduled break is less than a minute away, show seconds instead. --- lisp/type-break.el | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/lisp/type-break.el b/lisp/type-break.el index abd7a5d3d9d..511d977b868 100644 --- a/lisp/type-break.el +++ b/lisp/type-break.el @@ -342,7 +342,7 @@ keystroke threshold has been exceeded." ;; will reset the keystroke count anyway. (and max-threshold min-threshold - (> (- max-threshold type-break-keystroke-count) min-threshold) + (< (- max-threshold type-break-keystroke-count) min-threshold) (setq type-break-keystroke-count min-threshold)) (type-break-query)))) ((and max-threshold @@ -417,11 +417,15 @@ Current keystroke count : %s" (current-time-string type-break-time-last-break) "never") (if (and type-break-mode type-break-time-next-break) - (format "%s\t(%d minutes from now)" + (format "%s\t(%s from now)" (current-time-string type-break-time-next-break) - (/ (type-break-time-difference - (current-time) type-break-time-next-break) - 60)) + (let* ((secs (type-break-time-difference + (current-time) + type-break-time-next-break)) + (mins (/ secs 60))) + (if (> mins 0) + (format "%d minutes" mins) + (format "%d seconds" secs)))) "none scheduled") (or (car type-break-keystroke-threshold) "none") (or (cdr type-break-keystroke-threshold) "none") -- 2.39.5