From: Noah Friedman Date: Tue, 19 Jul 1994 00:52:56 +0000 (+0000) Subject: type-break-check: Shrink keystroke count if it is less than min-threshold X-Git-Tag: emacs-19.34~7572 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=6b62b567cbda4980bf5c80526a078d494338a086;p=emacs.git 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. --- 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")