diff options
author | Artur Malabarba <bruce.connor.am@gmail.com> | 2014-11-08 20:01:27 +0000 |
---|---|---|
committer | Artur Malabarba <bruce.connor.am@gmail.com> | 2014-11-08 20:01:27 +0000 |
commit | b4c5f99a50a61e7642dbe6601ba8da3207d0436e (patch) | |
tree | 0dc2cd4a1787066f0f330884c0837134a15fffc9 /sx-question-list.el | |
parent | e9277af61fe725ef70769add9c050bfed4509a22 (diff) |
Implement no-update argument to sx-question-list-refresh
Diffstat (limited to 'sx-question-list.el')
-rw-r--r-- | sx-question-list.el | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/sx-question-list.el b/sx-question-list.el index 86e9194..0494ef1 100644 --- a/sx-question-list.el +++ b/sx-question-list.el @@ -176,6 +176,9 @@ Letters do not insert themselves; instead, they are commands. (defvar sx-question-list--current-site "emacs" "Site being displayed in the *question-list* buffer.") +(defvar sx-question-list--current-dataset nil + "") + (defun sx-question-list-refresh (&optional redisplay no-update) "Update the list of questions. If REDISPLAY is non-nil, also call `tabulated-list-print'. @@ -184,8 +187,12 @@ a new list before redisplaying." (interactive "pP") ;; Reset the mode-line unread count (we rebuild it here). (setq sx-question-list--unread-count 0) - (let ((question-list (sx-question-get-questions - sx-question-list--current-site))) + (let ((question-list + (if (and no-update sx-question-list--current-dataset) + sx-question-list--current-dataset + (sx-question-get-questions + sx-question-list--current-site)))) + (setq sx-question-list--current-dataset question-list) ;; Print the result. (setq tabulated-list-entries (mapcar #'sx-question-list--print-info question-list))) |