]> git.eshelyaron.com Git - emacs.git/commitdiff
type-break-check: Shrink keystroke count if it is less than min-threshold
authorNoah Friedman <friedman@splode.com>
Tue, 19 Jul 1994 00:52:56 +0000 (00:52 +0000)
committerNoah Friedman <friedman@splode.com>
Tue, 19 Jul 1994 00:52:56 +0000 (00:52 +0000)
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

index abd7a5d3d9d7dfaf02d3827b5013f3a8062566fa..511d977b868a95f761e036160d8bd0002b5b03ea 100644 (file)
@@ -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")