;ELC ;;; Compiled ;;; in Emacs version 28.0.50 ;;; with all optimizations. (byte-code "\300\301!\210\302\303\304\305\306DD\307\310\311\312\313&\207" [require w3m-image custom-declare-variable w3m-favicon-size funcall function #[0 "\300\207" [nil] 1] "Size of favicon. The value should be `(WIDTH . HEIGHT)' or nil.\nWhere WIDTH and HEIGHT are positive integers; both or any of them can\nbe omitted." :group w3m :type (radio (const :tag "Not specified" nil) (cons :format "%v" (integer :format "Width: %v " :value 16 :size 8) (integer :format "Height: %v " :value 16 :size 8)))] 8) #@19 The favicon name. (defconst w3m-favicon-name "favicon.ico" (#$ . 595)) (byte-code "\300\301\302\"\210\303\304\305\306\307DD\310\311\312\313\314&\210\303\315\305\306\316DD\317\311\312\313\320&\210\303\321\305\306\322DD\323\311\312\313\324&\210\303\325\305\306\326DD\327\311\312\313\330&\210\303\331\305\306\332DD\333\311\312\313\334&\210\303\335\305\306\336DD\337\311\312\313\340&\210\303\341\305\306\342DD\343\311\312\313\344&\207" [add-hook w3m-display-functions w3m-favicon-setup custom-declare-variable w3m-favicon-use-cache-file funcall function #[0 "\300\207" [nil] 1] "If non-nil, use favicon cache file." :group w3m :type boolean w3m-favicon-cache-file #[0 "\300\207" [nil] 1] "Filename of saving favicon cache.\nIt defaults to the file named \".favicon\" under the directory specified\nby the `w3m-profile-directory' variable." (radio (const :format "Not specified\n") (file :format "%t: %v")) w3m-favicon-cache-expire-wait #[0 "\300\207" [2592000] 1] "The cache will be expired after specified seconds passed since retrieval.\nIf this variable is nil, never expired." integer w3m-favicon-type #[0 "\300\301!\205'\3022'\303\211\203#\211@\304!\203\305\302\"\210A\266\202\202 \306\2620\207" [boundp image-types det (gif png pbm svg xpm bmp) image-type-available-p throw nil] 5] "Image type of favicon." (radio :convert-widget w3m-widget-type-convert-widget (if (boundp 'image-types) (let ((types (delq 'imagemagick (delq 'postscript (copy-sequence image-types))))) (nconc (mapcar (lambda (x) `(const :format "%v " ,x)) (butlast types)) `((const ,(car (last types)))))) '((const :match (lambda (widget value) t) nil)))) w3m-space-before-favicon #[0 "\300\207" [#1=" "] 1 #1#] "String of space char(s) to be put in front of favicon in the mode-line.\nIt may be better to use two or more spaces if you are using oblique or\nitalic font in the modeline." string w3m-favicon-convert-args #[0 "\300\207" [nil] 1] "List of additional arguments passed to ImageMagick's convert program.\nArgs that are always passed to convert in addition to this value are:\n\n(\"-geometry\" \"WIDTHxHEIGHT\" \"fromTYPE:temp-file\" \"toTYPE:-\")\n\nArgs might also contain (\"-transparent\" \"COLOR\") in the beginning." (repeat (group :format "%v" :inline t :match-inline (lambda (widget vals) (if (and (eq (aref (car vals) 0) 45) (cdr vals) (not (eq (aref (nth 1 vals) 0) 45))) (cons (list (car vals) (nth 1 vals)) (nthcdr 2 vals)) (cons (list (car vals)) (cdr vals)))) (string :format "Arg: %v " :value "-") (group :format "%v" :inline t (checklist :inline t (string :format "Value: %v"))))) w3m-favicon-default-background #[0 "\300\207" [nil] 1] "Color name used as transparent color of favicon image.\nNil means to use the background color of the Emacs frame. The null\nstring \"\" is special, that will be replaced with the background color\nof the tab line or the mode line on which the favicon is displayed." (radio (string :format "Color: %v" :match (lambda (widget value) (and (stringp value) (> (length value) 0)))) (const :tag "Use the background color of the Emacs frame" nil) (const :tag "Null string" ""))] 8) #@72 A cons of what image type Emacs says and its real type generally told. (defvar w3m-favicon-type-alist '((pbm . ppm)) (#$ . 3726)) #@260 A list of favicon cache (internal variable). Each information is a list whose elements are: 0. URL 1. (RAW_DATA . TYPE) 2. DATE when the RAW_DATA was retrieved 3. IMAGE Where IMAGE highly depends on the Emacs version and is not saved in the cache file. (defvar w3m-favicon-cache-data nil (#$ . 3863)) (byte-code "\300\301\302\303#\210\304\301!\210\304\305!\207" [put w3m-modeline-favicon risky-local-variable t make-variable-buffer-local w3m-favicon-image] 4) #@66 Say whether the favicon data for URL has been chached. (fn URL) (defalias 'w3m-favicon-cache-p '(macro . #[257 "\300\301BB\207" [assoc (w3m-favicon-cache-data)] 4 (#$ . 4335)])) #@75 Pull out the favicon image corresponding to URL from the cache. (fn URL) (defalias 'w3m-favicon-cache-favicon '(macro . #[257 "\300\301\302\303BBE\207" [nth 3 assoc (w3m-favicon-cache-data)] 6 (#$ . 4521)])) #@72 Return the time when the favicon data for URL was retrieved. (fn URL) (defalias 'w3m-favicon-cache-retrieved '(macro . #[257 "\300\301\302\303BBE\207" [nth 2 assoc (w3m-favicon-cache-data)] 6 (#$ . 4737)])) #@74 Set IMAGE to `w3m-favicon-image' and `w3m-modeline-favicon'. (fn IMAGE) (defalias 'w3m-favicon-set-image '(macro . #[257 "\300\301\302E\303BB\207" [when setq w3m-favicon-image ((set 'w3m-modeline-favicon (list "" 'w3m-space-before-favicon (propertize " " 'display w3m-favicon-image) (propertize " " 'display '(space :width 0.5)))))] 5 (#$ . 4952)])) #@161 Set up the favicon data in the current buffer. The buffer-local variable `w3m-favicon-image' will be set to non-nil value when the favicon is ready. (fn URL) (defalias 'w3m-favicon-setup #[257 "\306\211\203\307\310\311\312\313#\311\314\313\315#F\n\205\227 \205\227\316 \205\227\317\f!\205\227\306\320\321\"\203a\322\323\324\325\"\326Q!\211\262\203ar q\210\327\330J!\331\"\211\205]\307\310\311\312\313#\311\314\313\315#F\211)\202\225\320\332\"\204y\320\333\"\205\225\334\306O\211\262\205\225 \203\212\335 @ A #\202\225\335\336\337!P\"\331 #\262\207" [w3m-favicon-image w3m-modeline-favicon w3m-use-favicon w3m-current-url w3m-favicon-type w3m-current-buffer nil "" w3m-space-before-favicon propertize " " display " " (space :width 0.5) display-images-p image-type-available-p string-match "\\`about://\\([^/]+\\)/" intern-soft "w3m-about-" match-string 1 "-favicon" w3m-favicon-convert base64-decode-string ico "\\`\\(https?\\|file\\)://" "\\`about://\\(?:header\\|source\\)/https?://" 15 w3m-favicon-retrieve w3m-expand-url "/" w3m-icon-data w3m-favicon-name] 9 (#$ . 5312)]) #@86 Convert the favicon DATA in TYPE to the favicon image and return it. (fn DATA TYPE) (defalias 'w3m-favicon-convert #[514 "\211\306=\203-G\307Y\203\310\307O\311\230\204-G\312Y\205\342\310\312O\313\235\205\342\314\211\262\205\342A\2064\315 \316\211\211 \203\231\n\317\232\203\231\320\321\322\"r\211q\210\323\324\"\216\325\316!\210c\210\326\327\3301r\331ed \322\211\316\332\333\334\"&0\210\202s\210*eb\210\322\204\227\335\336\316\322#\203\227\337\340\341\342!\211\262\"\203y\316\262\202y*\210\343\333\344@\206\243#D\262\205\260\345D\244-\244\262\346\347\350!\350./\236A\206\313.!%\262\211\205\340\351.\322\352\353\354\n&\266\204\207" [w3m-favicon-size w3m-imagick-identify-program w3m-favicon-default-background coding-system-for-write coding-system-for-read case-fold-search ico 4 0 "" 5 ("GIF87" "GIF89") gif frame-char-height nil "" generate-new-buffer " *temp*" t make-closure #[0 "\301\300!\205 \302\300!\207" [V0 buffer-name kill-buffer] 2] set-buffer-multibyte raw-text binary (error) call-process-region "-verbose" format "%s:-" re-search-forward "^ *Transparent +color: *\\([^\n ]+\\(?: +[^\n ]+\\)*\\)" string-match "\\`none\\'" match-string 1 "-geometry" "%dx%d" "-transparent" apply w3m-imagick-convert-data symbol-name create-image :ascent center :background w3m-favicon-convert-args w3m-favicon-type w3m-favicon-type-alist] 18 (#$ . 6432)]) #@219 Retrieve favicon from URL and convert it to image as TYPE in TARGET. TYPE is a symbol like `ico' and TARGET is a buffer where the image is stored in the `w3m-favicon-image' buffer-local variable. (fn URL TYPE TARGET) (defalias 'w3m-favicon-retrieve #[771 "\306\"\203= \203\307 \307\310\306\"8!Z W\203=r\211q\210\311\306\"8\211\2039\312\313\314\315\316\n#\314\317\316\320#F)\202\243\f\321\322 !!p\323\324&\323\325#CBrq\210\326 \327\330\211\211&)\262\331!\203y\332!\202\223\331rC!\262)\211\262!\203\220\332!\202\223!\262\266\204\331!\203\241\332!\210\266\333\334\"\207" [w3m-favicon-cache-data w3m-favicon-cache-expire-wait w3m-favicon-image w3m-modeline-favicon w3m-message-silent w3m-work-buffer-name assoc float-time 2 3 #1="" w3m-space-before-favicon propertize #2=" " display #3=" " #4=(space :width 0.5) w3m-get-buffer-create generate-new-buffer-name make-closure #[257 "\306\304!\203 \304q\210\303\307\211\203P\310 \311Y\203P\312\313{\314\230\203C\315\316!\2034\316 \2034\317ed\"\210\202C\320\211!\"\321ed\322\307\323%\210*\324 \262\325\301\"\262\202W\326\327\330\300!\"\210r\302q\210\211\211#\203r\331\332\333\334\335##\333\336\335\337#F$\300\340 #F%B\211%*\207" [V0 V1 V2 V3 V4 w3m-message-silent buffer-name nil buffer-size 4 1 3 "\213" fboundp zlib-available-p zlib-decompress-region binary shell-command-on-region "gzip -d" t buffer-string w3m-favicon-convert w3m-message "Reading %s...done (no favicon)" w3m-url-readable-string #1# w3m-space-before-favicon propertize #2# display #3# #4# current-time coding-system-for-write coding-system-for-read w3m-favicon-image w3m-modeline-favicon w3m-favicon-cache-data] 11 "\n\n(fn OK)"] #[257 "\302\300!\210\303\301!\203 \301q\210\207" [V0 V1 w3m-kill-buffer buffer-name] 3 "\n\n(fn OK)"] w3m-retrieve raw nil w3m-process-p w3m-process-start-process w3m-force-window-update-later 1] 16 (#$ . 7859)]) #@51 Save the cached favicon data into the local file. (defalias 'w3m-favicon-save-cache-file #[0 "\205\304 \206 \305\306\n\"\307\310\311\312 \"\"\313#\207" [w3m-favicon-use-cache-file w3m-favicon-cache-file w3m-profile-directory w3m-favicon-cache-data w3m-save-list expand-file-name ".favicon" delq nil mapcar #[257 "\211G\300U\205\n\301!\207" [4 butlast] 3 "\n\n(fn ELEM)"] binary] 7 (#$ . 9802)]) #@51 Load the cached favicon data from the local file. (defalias 'w3m-favicon-load-cache-file #[0 "\205Y ?\205Y\304\n\206\305\306 \"\307\"\310\211\211\205W@\262A\262A@\262;\2037A\311B\211\262\240\210\3121E\313@A\"0\202G\210\310\211\262\203C\244 B\202\266\204\207" [w3m-favicon-use-cache-file w3m-favicon-cache-data w3m-favicon-cache-file w3m-profile-directory w3m-load-list expand-file-name ".favicon" binary nil ico (error) w3m-favicon-convert] 7 (#$ . 10209)]) (byte-code "\300\301\302\"\210\300\303\304\"\210\305\306!\207" [add-hook w3m-arrived-setup-functions w3m-favicon-load-cache-file w3m-arrived-shutdown-functions w3m-favicon-save-cache-file provide w3m-favicon] 3)