;ELC ;;; Compiled ;;; in Emacs version 28.0.50 ;;; with all optimizations. (byte-code "\300\301!\210\300\302!\210\300\303!\210\300\304!\210\305\306\307\310\311DD\312\313\310\314\315&\207" [require sx sx-switchto sx-question sx-question-print custom-declare-variable sx-question-mode-display-buffer-function funcall function #[0 "\300\207" [pop-to-buffer] 1] "Function used to display the question buffer.\nCalled, for instance, when hitting \\`\\[sx-question-list-display-question]' on an entry in the\nquestion list.\nThis is not used when navigating the question list with `\\[sx-question-list-view-next].\n\nCommon values for this variable are `pop-to-buffer' and `switch-to-buffer'." :type :group sx-question-mode] 8) #@41 Buffer being used to display questions. (defvar sx-question-mode--buffer nil (#$ . 762)) #@43 The data of the question being displayed. (defvar sx-question-mode--data nil (#$ . 857)) (make-variable-buffer-local 'sx-question-mode--data) #@48 Return a window displaying a question, or nil. (defalias 'sx-question-mode--get-window #[0 "\300\301\302\303\304\303#\"\242\207" [cl-member-if #[257 "\300!r\301\302\"\216\303@\304\"\210\305\306!*\207" [internal--before-with-selected-window make-closure #[0 "\301\300!\207" [V0 internal--after-with-selected-window] 2] select-window norecord derived-mode-p sx-question-mode] 5 "\n\n(fn X)"] window-list nil never] 6 (#$ . 1005)]) #@137 Display question given by DATA on WINDOW. If WINDOW is nil, use selected one. Returns the question buffer. (fn DATA &optional WINDOW) (defalias 'sx-question-mode--display #[513 "r\300!q\210\301!)\207" [sx-question-mode--display-buffer sx-question-mode--erase-and-print-question] 4 (#$ . 1444)]) #@134 Erase contents of buffer and print question given by DATA. Also marks the question as read with `sx-question--mark-read'. (fn DATA) (defalias 'sx-question-mode--erase-and-print-question #[257 "\301!\210\302!\210\303\304 \210\305 \210\306!\210p)\207" [inhibit-read-only sx--ensure-site sx-question--mark-read t erase-buffer sx-question-mode sx-question-mode--print-question] 3 (#$ . 1750)]) #@176 Display and return the buffer used for displaying a question. Create `sx-question-mode--buffer' if necessary. If WINDOW is given, use that to display the buffer. (fn WINDOW) (defalias 'sx-question-mode--display-buffer #[257 "\302!\204\n\303\304!\305!\203\306\"\210\202#\307\310\"\204# !\210\207" [sx-question-mode--buffer sx-question-mode-display-buffer-function buffer-live-p generate-new-buffer "*sx-question*" window-live-p set-window-buffer get-buffer-window visible] 4 (#$ . 2152)]) (byte-code "\300\301\302\303\304DD\305\306\307\310\311&\207" [custom-declare-variable sx-question-mode-recenter-line funcall function #[0 "\300\207" [0] 1] "Screen line to which we recenter after moving between sections.\nThis is used as an argument to `recenter', only used if the end\nof section is outside the window.\n\nIf nil, no recentering is performed." :type (choice (const :tag "Don't recenter" nil) integer) :group sx-question-mode] 8) #@129 Move down to next section (question or answer) of this buffer. Prefix argument N moves N sections down or up. (fn &optional N) (defalias 'sx-question-mode-next-section #[256 "\211\203\n\301!\202 \302\211\303V\203+\304\305\"\204\304\305\"\210\306`\307\"\204 \211S\262\202 \210\310 \311 \232\205R\203P\312\313 !\314!\203O\315!\316 V\203O\317!\210\210\320 \207" [sx-question-mode-recenter-line abs 1 0 sx--goto-property-change sx-question-mode--section get-char-property invisible selected-window get-buffer-window sx-question-mode--section-overlays-at line-end-position overlayp overlay-end window-end recenter sx-message-help-echo] 5 (#$ . 3109) "p"]) #@131 Move down to previous section (question or answer) of this buffer. Prefix argument moves N sections up or down. (fn &optional N) (defalias 'sx-question-mode-previous-section #[256 "\300\206\301[!\207" [sx-question-mode-next-section 1] 3 (#$ . 3787) "p"]) #@95 Hide or show section under point. Optional argument _ is for `push-button'. (fn &optional _) (defalias 'sx-question-mode-hide-show-section #[256 "\300\301 !\206\n\300`!\302!\204\303\304!\210\305!b\210\306y\210\307\310\311\310\"?#\207" [sx-question-mode--section-overlays-at line-end-position overlayp sx-user-error "Not inside a question or answer" overlay-start 0 overlay-put invisible overlay-get] 8 (#$ . 4052) nil]) #@133 Return the highest priority section overlay at POS. A section overlay has a `sx-question-mode--section-content' property. (fn POS) (defalias 'sx-question-mode--section-overlays-at #[257 "\300\301\302#\243\207" [get-char-property-and-overlay sx-question-mode--section-content nil] 5 (#$ . 4487)]) #@131 List of key definitions for `sx-question-mode'. This list must follow the form described in `sx--key-definitions-to-header-line'. (defconst sx-question-mode--key-definitions '(("" sx-question-mode-next-section) ("" sx-question-mode-previous-section) ("n" sx-question-mode-next-section "Navigate") ("p" sx-question-mode-previous-section "Navigate") ("g" sx-question-mode-refresh) ("v" sx-visit-externally) ("u" sx-upvote "upvote") ("d" sx-downvote "downvote") ("q" quit-window) ("SPC" scroll-up-command) ("e" sx-edit "edit") ("S" sx-search) ("*" sx-favorite "star") ("K" sx-delete "Delete") ("s" sx-switchto-map "switch-to") ("O" sx-question-mode-order-by "Order") ("c" sx-comment "comment") ("a" sx-answer "answer") ("TAB" forward-button "Navigate") ("" backward-button) ("" backward-button) ("" backward-button)) (#$ . 4792)) #@40 Header-line used on the question list. (defconst sx-question-mode--header-line (sx--key-definitions-to-header-line sx-question-mode--key-definitions) (#$ . 5666)) #@59 Mode-line construct to use in `sx-question-mode' buffers. (defconst sx-question-mode--mode-line '(" " (:propertize (:eval (sx--pretty-site-parameter (let-alist sx-question-mode--data \.site_par))) face mode-line-buffer-id) " " mode-name " [" "Answers: " (:propertize (:eval (number-to-string (let-alist sx-question-mode--data \.answer_count))) face mode-line-buffer-id) ", " "Stars: " (:propertize (:eval (number-to-string (or (let-alist sx-question-mode--data \.favorite_count) 0))) face mode-line-buffer-id) ", " "Views: " (:propertize (:eval (number-to-string (let-alist sx-question-mode--data \.view_count))) face mode-line-buffer-id) "] ") (#$ . 5835)) (defvar sx-question-mode-hook nil) (byte-code "\300\301N\204\f\302\300\301\303#\210\304\305!\204\302\305\306\307#\210\300\207" [sx-question-mode-hook variable-documentation put "Hook run after entering Question mode.\nNo problems result if this variable is not bound.\n`add-hook' automatically binds it. (This is true for all hook variables.)" boundp sx-question-mode-map definition-name sx-question-mode] 4) (defvar sx-question-mode-map (make-sparse-keymap)) (byte-code "\301\302N\204\303\301\302\304\305!#\210\306\307!\204\303\307\310\311#\210\312\313 !\210\307\302N\204-\303\307\302\304\314!#\210\306\300!\204B\303\300\310\311#\210\315\316\300\317\"\210!\210\300\302N\204P\303\300\302\304\320!#\210\303\311\321\322#\207" [sx-question-mode-abbrev-table sx-question-mode-map variable-documentation put purecopy "Keymap for `sx-question-mode'." boundp sx-question-mode-syntax-table definition-name sx-question-mode (lambda (def-tmp-var) (defvar sx-question-mode-syntax-table def-tmp-var)) make-syntax-table "Syntax table for `sx-question-mode'." (lambda (def-tmp-var) (defvar sx-question-mode-abbrev-table def-tmp-var)) define-abbrev-table nil "Abbrev table for `sx-question-mode'." derived-mode-parent special-mode] 5) #@483 Major mode to display and navigate a question and its answers. Letters do not insert themselves; instead, they are commands. Don't activate this mode directly. Instead, to print a question on the current buffer use `sx-question-mode--erase-and-print-question'. \ \{sx-question-mode} In addition to any hooks its parent mode `special-mode' might have run, this mode runs the hook `sx-question-mode-hook', as the final or penultimate step during initialization. (defalias 'sx-question-mode #[0 "\306\300!\210\307\310 \210\311\312\310\313N\203\314\311\313\310\313N#\210\315 !\204'\316 \317 \"\210\320\f!\211\2035\211\321 =\203;\322\f\323 \"\210\210\324 \325\"\204R )=\204R\326 \325)C#\210\327 !\210\330\f!\210 )*+,-\306\331!\210\332\333\332\334\"\204}\335\332\334\336\337\332pF#\210\340\341!\210\342\343\344\307#\210\342\345\346\307#\210)\347\350!\207" [delay-mode-hooks major-mode mode-name sx-question-mode-map sx-question-mode-syntax-table sx-question-mode-abbrev-table make-local-variable t special-mode sx-question-mode "Question" mode-class put keymap-parent set-keymap-parent current-local-map char-table-parent standard-syntax-table set-char-table-parent syntax-table abbrev-table-get :parents abbrev-table-put use-local-map set-syntax-table nobreak-char-display nil window-parameter quit-restore set-window-parameter other window font-lock-mode -1 remove-hook after-change-functions markdown-check-change-for-wiki-link window-configuration-change-hook markdown-fontify-buffer-wiki-links run-mode-hooks sx-question-mode-hook local-abbrev-table sx-question-mode--header-line header-line-format sx-question-mode--mode-line mode-line-format] 7 (#$ . 7734) nil]) (mapc #[257 "\300\301\302\303@D\304A@DF!\207" [eval define-key sx-question-mode-map kbd function] 7 "\n\n(fn X)"] sx-question-mode--key-definitions) #@238 Refresh currently displayed question. Queries the API for any changes to the question or its answers or comments, and redisplays it. With non-nil prefix argument NO-UPDATE, just redisplay, don't query the api. (fn &optional NO-UPDATE) (defalias 'sx-question-mode-refresh #[256 "\301 \210`\302\303 `\"\304\203\202'\305!\210\306\236A\307\236A\310\"\266\202\262!\210b\210\311 \312p!\232\2039\313!\210\266\314\315!\207" [sx-question-mode--data sx-question-mode--ensure-mode count-screen-lines window-start sx-question-mode--erase-and-print-question sx--ensure-site site_par question_id sx-question-get-question selected-window get-buffer-window recenter sx-message "Done."] 10 (#$ . 9598) "P"]) #@54 Ensures we are in question mode, erroring otherwise. (defalias 'sx-question-mode--ensure-mode #[0 "\300\301!?\205\n\302\303!\207" [derived-mode-p sx-question-mode error "Not in `sx-question-mode'"] 2 (#$ . 10313)]) #@159 Order answers in the current buffer by the method SORT. Sets `sx-question-list--order' and then calls `sx-question-list-refresh' with `redisplay'. (fn SORT) (defalias 'sx-question-mode-order-by #[257 "\211\205\301!\205\211\302\303!\207" [sx-question-mode-answer-sort-function functionp sx-question-mode-refresh no-update] 3 (#$ . 10536) (byte-code "\301\302\303\304\"\"\305\"\243\262C\207" [sx-question-mode--sort-methods sx-completing-read "Order answers by: " mapcar car assoc-string] 5)]) (provide 'sx-question-mode)