;ELC ;;; Compiled ;;; in Emacs version 28.0.50 ;;; with all optimizations. (byte-code "\300\301!\210\300\302!\210\303\304\305\306\307\310\311\312\313\301& \210\314\315\316\317\320DD\321\322\323\313\304&\210\324\325\326\327\313\304%\210\324\330\331\332\313\304%\210\324\333\334\335\313\304%\207" [require sx sx-button custom-declare-group sx-user nil "How users are displayed by SX." :prefix "sx-user-" :tag "SX User" :group custom-declare-variable sx-question-mode-fallback-user funcall function #[0 "\300\207" [((about_me . #1="") (accept_rate . -1) (account_id . -1) (age . -1) (answer_count . -1) (badge_counts (bronze . -1) (silver . -1) (gold . -1)) (creation_date . -1) (display_name . "(unknown user)") (down_vote_count . -1) (is_employee) (last_access_date . -1) (last_modified_date . -1) (link . #1#) (location . #1#) (profile_image . ":(") (question_count . -1) (reputation . -1) (reputation_change_day . -1) (reputation_change_month . -1) (reputation_change_quarter . -1) (reputation_change_week . -1) (reputation_change_year . -1) (timed_penalty_date . -1) (up_vote_count . -1) (user_id . -1) (user_type . does_not_exist) (view_count . -1) (website_url . #1#))] 1] "The structure used to represent missing user information.\nNOOTE: SX relies on this variable containing all necessary user\ninformation. You may edit any of its fields, but you'll run into\nerrors if you remove them." :type (alist :options ((about_me string) (accept_rate integer) (account_id integer) (age integer) (answer_count integer) (badge_counts alist) (creation_date integer) (display_name string) (down_vote_count integer) (is_employee boolean) (last_access_date integer) (last_modified_date integer) (link string) (location string) (profile_image string) (question_count integer) (reputation integer) (reputation_change_day integer) (reputation_change_month integer) (reputation_change_quarter integer) (reputation_change_week integer) (reputation_change_year integer) (timed_penalty_date integer) (up_vote_count integer) (user_id integer) (user_type symbol) (view_count integer) (website_url string))) custom-declare-face sx-user-name ((t :inherit font-lock-builtin-face)) "Face used for user names." sx-user-reputation ((t :inherit font-lock-comment-face)) "Face used for user reputations." sx-user-accept-rate ((t)) "Face used for user accept-rates."] 10) #@74 Alist relating % constructs with text properties. See `sx-user--format'. (defvar sx-user--format-property-alist (byte-code "\300\301\302C\303\304\211\305N\206\306\307\"\262\310BBBBB\311\301\302C\303\304\211\305N\206(\306\307\"\262\312BBBBB\313\301\302C\303\304\211\305N\206@\306\307\"\262\314BBBBB\315BBB\207" [100 button t category sx-button-user button-category-symbol error "Unknown button type `%s'" (face sx-user-name) 110 (face sx-user-name) 64 (face sx-user-name) ((114 face sx-user-reputation) (97 face sx-user-accept-rate))] 10) (#$ . 2361)) #@564 Use FORMAT-STRING to format the user object USER. The value is a copy of FORMAT-STRING, but with certain constructs replaced by text that describes the specified USER: %d is the display name. %@ is the display name in a format suitable for @mentions. %l is the link to the profile. %r is the reputation. %a is the accept rate. The string replaced in each of these construct is also given the text-properties specified in `sx-user--format-property-alist'. Specially, %d and %@ are turned into buttons with the `sx-button-user' category. (fn FORMAT-STRING USER) (defalias 'sx-user--format #[514 "\302\303\"!\210\303\"\304\236A\305\236A\306\236A\307\236A\310\311B\312B\313B\314B\315B\316\317\320\"\205?\321\f!B\257 #\322\323!W\203V\324\325\326%\207\207" [sx-question-mode-fallback-user sx-user--format-property-alist sx--ensure-site append display_name link reputation accept_rate sx-format-replacements 100 110 108 114 97 64 string-match "%@" sx-user--@name 0 string-width propertize sx-button-url sx-button-copy] 18 (#$ . 2929)]) #@98 List of replacements to use for non-ascii characters. Used to convert user names into @mentions. (defconst sx-user--ascii-replacement-list '(("[:space:]" . #1="") ("àåáâäãåą" . "a") ("èéêëę" . "e") ("ìíîïı" . "i") ("òóôõöøőð" . "o") ("ùúûüŭů" . "u") ("çćčĉ" . "c") ("żźž" . "z") ("śşšŝ" . "s") ("ñń" . "n") ("ýÿ" . "y") ("ğĝ" . "g") ("ř" . "r") ("ł" . "l") ("đ" . "d") ("ß" . "ss") ("Þ" . "th") ("ĥ" . "h") ("ĵ" . "j") ("^[:ascii:]" . #1#)) (#$ . 3999)) #@385 Convert DISPLAY-NAME into an @mention. In order to correctly @mention the user, all whitespace is removed from DISPLAY-NAME and a series of unicode conversions are performed before it is returned. See `sx-user--ascii-replacement-list'. If all you need is the @name, this is very slightly faster than using `sx-user--format', but it doesn't do any sanity checking. (fn DISPLAY-NAME) (defalias 'sx-user--@name #[257 "\301\302\"P\207" [sx-user--ascii-replacement-list "@" sx--recursive-replace] 5 (#$ . 4516)]) (provide 'sx-user)