diff options
author | Artur Malabarba <bruce.connor.am@gmail.com> | 2014-11-26 12:28:01 +0000 |
---|---|---|
committer | Artur Malabarba <bruce.connor.am@gmail.com> | 2014-11-26 12:36:40 +0000 |
commit | a104916864ab053fff81dcdcba71e6b8af219913 (patch) | |
tree | 373326a7a6c9ff877178ac659e18363f75fac3a9 | |
parent | 16952fa49769398bf47373e7585812ac06392ee8 (diff) |
Use let instead of letf
Older letfs are bugged.
-rw-r--r-- | sx-question-list.el | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/sx-question-list.el b/sx-question-list.el index 98e7736..fbed4ea 100644 --- a/sx-question-list.el +++ b/sx-question-list.el @@ -371,22 +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)) - (cl-letf ((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-start))) + (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)) - (sx-message "Done."))) + (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. |