;ELC ;;; Compiled ;;; in Emacs version 28.0.50 ;;; with all optimizations. (byte-code "\300\301!\210\300\302!\210\300\303!\207" [require sx sx-filter sx-method] 2) #@335 Get SITE questions. Return page PAGE (the first if nil). Return a list of question. Each question is an alist of properties returned by the API with an added (site SITE) property. KEYWORDS are added to the method call along with PAGE. `sx-method-call' is used with `sx-browse-filter'. (fn SITE &optional PAGE KEYWORDS SUBMETHOD) (defalias 'sx-question-get-questions #[1025 "\301\302\303\304BB\305\306\307\310 \311& \207" [sx-browse-filter sx-method-call questions :keywords page :site :auth t :submethod :filter] 16 (#$ . 177)]) #@122 Query SITE for a QUESTION-ID and return it. If QUESTION-ID doesn't exist on SITE, raise an error. (fn SITE QUESTION-ID) (defalias 'sx-question-get-question #[514 "\301\302\303\304\305\306\307& \211\203\211\310\234\207\311\312#\207" [sx-browse-filter sx-method-call questions :id :site :auth t :filter 0 error "Couldn't find question %S in %S"] 12 (#$ . 725)]) #@125 Get question from SITE to which ANSWER-ID belongs. If ANSWER-ID doesn't exist on SITE, raise an error. (fn SITE ANSWER-ID) (defalias 'sx-question-get-from-answer #[514 "\301\302\303\304\305\306\307\310\311& \211\203\211\312\234\207\313\314#\207" [sx-browse-filter sx-method-call answers :id :site :submethod questions :auth t :filter 0 error "Couldn't find answer %S in %S"] 14 (#$ . 1101)]) #@209 Get question from SITE to which COMMENT-ID belongs. If COMMENT-ID doesn't exist on SITE, raise an error. Note this requires two API requests. One for the comment and one for the post. (fn SITE COMMENT-ID) (defalias 'sx-question-get-from-comment #[514 "\301\302\303\304\305\306\307& \211\204\310\311#\210\312\313\234!\210\211\313\234\314\236A\315\236A\316\236A\317\230\2036\320\2027\321\"\207" [sx-browse-filter sx-method-call comments :id :site :auth t :filter error "Couldn't find comment %S in %S" sx--ensure-site 0 post_type site_par post_id "answer" sx-question-get-from-answer sx-question-get-question] 12 (#$ . 1509)]) #@182 Alist of questions read by the user. Each element has the form (SITE . QUESTION-LIST) where each element in QUESTION-LIST has the form (QUESTION_ID . LAST-VIEWED-DATE). (defvar sx-question--user-read-list nil (#$ . 2161)) #@128 Ensure `sx-question--user-read-list' has been read from cache. If no cache exists for it, initialize one with SITE. (fn SITE) (defalias 'sx-question--ensure-read-list #[257 "?\205\301\302\303CCD\"\211\207" [sx-question--user-read-list sx-cache-get read-questions quote] 5 (#$ . 2402)]) #@105 Non-nil if QUESTION has been read since last updated. See `sx-question--user-read-list'. (fn QUESTION) (defalias 'sx-question--read-p #[257 "\301!\210\211\302\236A\303\236A\304\236A\305!\210\306\"A\211\205)\306\"A\206'\307Y\207" [sx-question--user-read-list sx--ensure-site site_par question_id last_activity_date sx-question--ensure-read-list assoc 0] 9 (#$ . 2701)]) #@179 Inserted NEWELT into LIST sorted by PREDICATE. This is designed for the (site id id ...) lists. So the first car is intentionally skipped. (fn NEWELT LIST &optional PREDICATE) (defalias 'sx-sorted-insert-skip-first '(macro . #[770 "\300\301D\302DD\303\304\305\306\307\310D\311BB\312BBE\313BB\314BBB\207" [let tail x while and (cdr-safe tail) funcall or function (#'<) (x (cadr tail)) ((setq tail (cdr tail))) ((setcdr tail (cons x (cdr tail))))] 12 (#$ . 3090)])) #@217 Mark QUESTION as being read until it is updated again. Returns nil if question (in its current state) was already marked read, i.e., if it was `sx-question--read-p'. See `sx-question--user-read-list'. (fn QUESTION) (defalias 'sx-question--mark-read #[257 "\301!\210\211\302\236A\303\236A\304\236A\305!\210\306\"B\307\204-DB\211\266\206\202m\306\"\211\262\203L\211A\247\203DAV\205k\211\241\266\206\202m\243\203c\310A@\"\203cA\262\202NAB\241\266\202\266\206\262\311\312\"\210\207" [sx-question--user-read-list sx--ensure-site site_par question_id last_activity_date sx-question--ensure-read-list assoc nil #[514 "@\206\300@\206\f\300V\207" [-1] 4 "\n\n(fn X Y)"] sx-cache-set read-questions] 13 (#$ . 3567)]) #@105 Alist of questions hidden by the user. Each element has the form (SITE QUESTION_ID QUESTION_ID ...) (defvar sx-question--user-hidden-list nil (#$ . 4328)) #@135 Ensure the `sx-question--user-hidden-list' has been read from cache. If no cache exists for it, initialize one with SITE. (fn SITE) (defalias 'sx-question--ensure-hidden-list #[257 "?\205\301\302\303CCD\"\211\207" [sx-question--user-hidden-list sx-cache-get hidden-questions quote] 5 (#$ . 4494)]) #@53 Non-nil if QUESTION has been hidden. (fn QUESTION) (defalias 'sx-question--hidden-p #[257 "\301!\210\211\302\236A\303\236A\304!\210\305\"A\211\205>\207" [sx-question--user-hidden-list sx--ensure-site site_par question_id sx-question--ensure-hidden-list assoc] 7 (#$ . 4805)]) #@47 Mark QUESTION as being hidden. (fn QUESTION) (defalias 'sx-question--mark-hidden #[257 "\301!\210\211\302\236A\303\236A\304\">?\205G\211\204%DB\202C\211\243\203;\211A@V\203;A\262\202'AB\241\266\305\306\"\207" [sx-question--user-hidden-list sx--ensure-site site_par question_id assoc sx-cache-set hidden-questions] 10 (#$ . 5098)]) #@74 Return accepted answer in QUESTION or nil if none exists. (fn QUESTION) (defalias 'sx-question--accepted-answer-id #[257 "\300!\210\211\301\236A\211\250\205\211\207" [sx--ensure-site accepted_answer_id] 4 (#$ . 5463)]) #@66 Return t if answer A has a higher score than answer B. (fn A B) (defalias 'sx-answer-higher-score-p #[514 "\300\236A\262\300\236A\262V\207" [score] 6 (#$ . 5693)]) #@64 Return t if answer A was posted later than answer B. (fn A B) (defalias 'sx-answer-newer-p #[514 "\300\236A\262\300\236A\262V\207" [creation_date] 6 (#$ . 5870)]) #@60 Return t if answer A was updated after answer B. (fn A B) (defalias 'sx-answer-more-active-p #[514 "\300\236A\262\300\236A\262V\207" [last_activity_date] 6 (#$ . 6046)]) (provide 'sx-question)