;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\300\305!\210\306\307\310\311\312\313\314\315&\207" [require cl-lib json request tabulated-list let-alist custom-declare-group v2ex-mode nil "Major mode for visiting v2ex.com site." :prefix "v2ex-" :group external] 8) #@40 Major mode for visit http://v2ex.com/. (defvar v2ex-mode-map (byte-code "\301 \302\"\210\303\304\305#\210\303\306\307#\210\303\310\311#\210\303\312\313#\210\303\314\315#\210\303\316\317#\210\303\320\321#\210\303\322\323#\210\303\324\325#\210\303\326\327#\210\303\330\317#\210\303\331\321#\210\303\332\327#\210\303\333\325#\210\207" [tabulated-list-mode-map make-sparse-keymap set-keymap-parent define-key "q" quit-window "r" v2ex "H" v2ex-hot "L" v2ex-latest "h" backward-char "j" next-line "k" previous-line "l" forward-char "A" end-of-line "I" beginning-of-line "n" "p" "a" "e"] 5) (#$ . 370)) (byte-code "\300\301\302\303\304DD\305\306\307\310\311&\210\300\312\302\303\313DD\314\306\307\310\311&\207" [custom-declare-variable v2ex-hot-api-uri funcall function #[0 "\300\207" [#1="https://www.v2ex.com/api/topics/hot.json"] 1 #1#] "The hot topic api." :group v2ex-mode :type string v2ex-latest-api-uri #[0 "\300\207" [#2="https://www.v2ex.com/api/topics/latest.json"] 1 #2#] "The url of latest topics api."] 8) #@20 The current visit. (defvar v2ex-current-visit '(:name "latest" :url v2ex-latest-api-uri :desc "最新主题") (#$ . 1407)) (byte-code "\300\301\302\303\304DD\305\306\307\310\311&\207" [custom-declare-variable v2ex-request-timeout funcall function #[0 "\300\207" [10] 1] "Timeout control when connecting v2ex, in seconds." :group v2ex-mode :type number] 8) #@28 JSON object in Emacs Lisp. (defvar v2ex--json nil (#$ . 1770)) (defvar v2ex--buffer-name (byte-code "\301\302\303\304\"\"\207" [v2ex-current-visit format "*v2ex:%s*" plist-get :desc] 5)) #@30 (fn JSON-CONTENT RESPONSE) (defalias 'v2ex--render #[514 "r\304 !q\210\305`\306 \210\307 \210\211b\210)\266\310\311\312 \313\"\"\314 !\210\315 ?\2058\316 \2035\317p!\2028\320p!)\207" [v2ex--json v2ex--buffer-name inhibit-read-only v2ex-current-visit get-buffer-create t erase-buffer v2ex-mode format "*v2ex:%s*" plist-get :desc rename-buffer get-buffer-window one-window-p switch-to-buffer switch-to-buffer-other-window] 7 (#$ . 1964)]) (define-button-type 'v2ex-button 'action #[257 "\300\301\302\"!\207" [browse-url button-get link] 5 "\n\n(fn B)"] 'follow-link t) (defvar v2ex--node-info-cache (make-hash-table :test 'equal)) #@13 (fn NODE) (defalias 'v2ex--request-node-info #[257 "\211\301C\302\303\304\"\"\210\211\242\237\266\202\235\203\305\"\207\306\307\310\311BC\312\313\314\315&\211\316H\262\317#\210\207" [v2ex--node-info-cache nil maphash make-closure #[514 "\300\300\242B\240\207" [V0] 5 "\n\n(fn K --CL-VAR--)"] gethash request "https://www.v2ex.com/api/nodes/show.json" :params "name" :parser #[0 "\300\301\302 \303\"!\207" [json-read-from-string decode-coding-string buffer-string utf-8] 4] :sync t 3 puthash] 9 (#$ . 2611)]) #@108 获得一个从 FROM 到 TO 的直观的时间差. FROM 和 TO 均是以秒计的时间量. (fn FROM TO) (defalias 'v2ex-mode-format-human-readable-time #[514 "\211Z\300\301\302\"!\211\303U\203\301\304\"\207\301\305\"\207" [string-to-number format-seconds "%d" 0 "%2h 小时 %z%2m 分钟前" "%2d 天前"] 7 (#$ . 3142)]) (defvar v2ex-mode-hook nil) (byte-code "\300\301N\204\f\302\300\301\303#\210\304\305!\204\302\305\306\307#\210\300\207" [v2ex-mode-hook variable-documentation put "Hook run after entering V2EX mode.\nNo problems result if this variable is not bound.\n`add-hook' automatically binds it. (This is true for all hook variables.)" boundp v2ex-mode-map definition-name v2ex-mode] 4) (defvar v2ex-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" [v2ex-mode-abbrev-table v2ex-mode-map variable-documentation put purecopy "Keymap for `v2ex-mode'." boundp v2ex-mode-syntax-table definition-name v2ex-mode (lambda (def-tmp-var) (defvar v2ex-mode-syntax-table def-tmp-var)) make-syntax-table "Syntax table for `v2ex-mode'." (lambda (def-tmp-var) (defvar v2ex-mode-abbrev-table def-tmp-var)) define-abbrev-table nil "Abbrev table for `v2ex-mode'." derived-mode-parent tabulated-list-mode] 5) #@317 Major mode for browsing http://v2ex.com/. Letters do not insert themselves; instead, they are commands. \ \{v2ex-mode-map} In addition to any hooks its parent mode `tabulated-list-mode' might have run, this mode runs the hook `v2ex-mode-hook', as the final or penultimate step during initialization. (defalias 'v2ex-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 3=\204R\326 \3253C#\210\327 !\210\330\f!\210 3\3314\332 \210\3335\334\"\334\211:\203\354@\262\335\236A\336\337\236A\236A\340\341\236A\236A\342\341\236A\236A\343\236A\344\236A\340\236A\345\236A\346\347\350\351\352\f!\345\236A\211\262\262\353\352!\354\236A\211\262\262\257B\355\356 \"\357!\347\350\351\nFB%D\266\210\262B\262A\262\202j\211\237\266\2036\360 \210)\361\362!\207" [delay-mode-hooks major-mode mode-name v2ex-mode-map v2ex-mode-syntax-table v2ex-mode-abbrev-table make-local-variable t tabulated-list-mode v2ex-mode "V2EX" 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 [("Member" 12 nil) ("Node" 11 nil) ("Created" 18 nil) ("Replies" 8 nil) ("Title" 0 nil)] tabulated-list-init-header append nil id username member title node name created replies url vector :type v2ex-button link v2ex--request-node-info help-echo header v2ex-mode-format-human-readable-time float-time number-to-string tabulated-list-print run-mode-hooks v2ex-mode-hook local-abbrev-table tabulated-list-format v2ex--json tabulated-list-entries] 24 (#$ . 4616) nil]) #@39 Open v2ex mode. (fn &optional ASYNC) (defalias 'v2ex #[256 "\302\303\203\n\304\202 \305\"\210\306\307\310\"J\311\312\313?\314\315\316\317\320\321\322 & \207" [v2ex-current-visit v2ex-request-timeout message "open v2ex.com using %s way." "async" "sync" request plist-get :url :parser #[0 "\300\301\302 \303\"!\207" [json-read-from-string decode-coding-string buffer-string utf-8] 4] :sync :success #[128 "\300\301\"A@\300\302\"A@\303\304!\210\305\"\207" [plist-member :data :response message "Request http://v2ex.com/ success!" v2ex--render] 6 "\n\n(fn &key DATA &key RESPONSE &allow-other-keys)"] :complete #[128 "\300\301!\207" [message "Request finished and *v2ex* updated!"] 3 "\n\n(fn &rest _)"] :error #[128 "\301\302\"A@\303\304\305\306\"#\207" [v2ex-current-visit plist-member :error-thrown error "Got errror: %S in request %s!Please retry!" plist-get :url] 8 "\n\n(fn &rest ARGS &key ERROR-THROWN &allow-other-keys)"] :timeout] 15 (#$ . 6406) "P"]) #@48 Open v2ex latest topics. (fn &optional ASYNC) (defalias 'v2ex-latest #[256 "\301\302!\207" [v2ex-current-visit (:name "latest" :url v2ex-latest-api-uri :desc "最新主题") v2ex] 3 (#$ . 7382) "P"]) #@45 Open v2ex hot topics. (fn &optional ASYNC) (defalias 'v2ex-hot #[256 "\301\302!\207" [v2ex-current-visit (:name "hot" :url v2ex-hot-api-uri :desc "最热主题") v2ex] 3 (#$ . 7591) "P"]) (provide 'v2ex-mode)