aboutsummaryrefslogtreecommitdiff
path: root/sx-question-list.el
diff options
context:
space:
mode:
Diffstat (limited to 'sx-question-list.el')
-rw-r--r--sx-question-list.el9
1 files changed, 8 insertions, 1 deletions
diff --git a/sx-question-list.el b/sx-question-list.el
index 8d06cd0..76fb730 100644
--- a/sx-question-list.el
+++ b/sx-question-list.el
@@ -532,12 +532,19 @@ high (if possible)."
`(window window ,(selected-window) ,sx-question-mode--buffer))
window)))
+(defvar sx-question-list--last-refresh (current-time)
+ "Time of the latest refresh.")
+
(defun sx-question-list-next (n)
"Move cursor down N questions.
This does not update `sx-question-mode--window'."
(interactive "p")
(if (and (< n 0) (bobp))
- (sx-question-list-refresh 'redisplay)
+ (when (> (time-to-seconds
+ (time-subtract (current-time) sx-question-list--last-refresh))
+ 1)
+ (sx-question-list-refresh 'redisplay)
+ (setq sx-question-list--last-refresh (current-time)))
(forward-line n)
;; If we were trying to move forward, but we hit the end.
(when (eobp)