diff options
author | Artur Malabarba <bruce.connor.am@gmail.com> | 2015-02-12 10:52:26 -0200 |
---|---|---|
committer | Artur Malabarba <bruce.connor.am@gmail.com> | 2015-02-12 13:47:39 -0200 |
commit | b61a296ed58c0cb2fda1dd610ae739c82d872ed8 (patch) | |
tree | d182e5edad22c4a6ae0179cd62119afb287c2637 | |
parent | 7af796271661571791cb338c64769a3dd1f416e5 (diff) |
Define sx-question-list--make-pager helper function
-rw-r--r-- | sx-question-list.el | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/sx-question-list.el b/sx-question-list.el index c66c04b..5812ff2 100644 --- a/sx-question-list.el +++ b/sx-question-list.el @@ -247,6 +247,20 @@ is used." (mapcar #'car sx-question-list--order-methods)))) (cdr-safe (assoc-string order sx-question-list--order-methods)))) +(defun sx-question-list--make-pager (method &optional submethod) + "Return a function suitable for use as a question list pager. +Meant to be used as `sx-question-list--next-page-function'." + (lambda (page) + (sx-method-call method + :keywords `((page . ,page) + ,@(when sx-question-list--order + `((order . ,(if sx-question-list--descending 'desc 'asc)) + (sort . ,sx-question-list--order)))) + :site sx-question-list--site + :auth t + :submethod submethod + :filter sx-browse-filter))) + ;;; Mode Definition (define-derived-mode sx-question-list-mode |