diff options
author | Sean Allred <code@seanallred.com> | 2014-11-27 11:21:02 -0500 |
---|---|---|
committer | Sean Allred <code@seanallred.com> | 2014-11-27 11:21:02 -0500 |
commit | 92ec323425057284de93c90b7ae0e8f5e96611b6 (patch) | |
tree | 65112f05a72c0ba4ac74076d1c53f6612deeb1cd /sx-question-list.el | |
parent | 9c2df708ac4dc62c34882b7978761cf1f73e063f (diff) | |
parent | 6848008b60938100d04cda96c093a24cb3370f9a (diff) |
Merge branch 'master' into issue-100
Diffstat (limited to 'sx-question-list.el')
-rw-r--r-- | sx-question-list.el | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/sx-question-list.el b/sx-question-list.el index 2965ede..fbed4ea 100644 --- a/sx-question-list.el +++ b/sx-question-list.el @@ -371,19 +371,25 @@ a new list before redisplaying." (setq sx-question-list--unread-count 0) (unless no-update (setq sx-question-list--pages-so-far 1)) - (let ((question-list - (or (and no-update sx-question-list--dataset) - (and (functionp sx-question-list--refresh-function) - (funcall sx-question-list--refresh-function)) - (and (functionp sx-question-list--next-page-function) - (funcall sx-question-list--next-page-function 1)) - sx-question-list--dataset))) + (let* ((question-list + (or (and no-update sx-question-list--dataset) + (and (functionp sx-question-list--refresh-function) + (funcall sx-question-list--refresh-function)) + (and (functionp sx-question-list--next-page-function) + (funcall sx-question-list--next-page-function 1)) + sx-question-list--dataset)) + ;; Preserve window positioning. + (window (get-buffer-window (current-buffer))) + (old-start (when window (window-start window)))) (setq sx-question-list--dataset question-list) ;; Print the result. (setq tabulated-list-entries (mapcar sx-question-list--print-function - (cl-remove-if #'sx-question--hidden-p question-list)))) - (when redisplay (tabulated-list-print 'remember))) + (cl-remove-if #'sx-question--hidden-p question-list))) + (when redisplay (tabulated-list-print 'remember)) + (when window + (set-window-start window old-start))) + (sx-message "Done.")) (defcustom sx-question-list-ago-string " ago" "String appended to descriptions of the time since something happened. |