;ELC   
;;; Compiled
;;; in Emacs version 29.4
;;; with all optimizations.



(byte-code "\300\301!\210\302\303\304\"\210\302\305\306\"\207" [require mh-e autoload mail-header-parse-address "mail-parse" message-fetch-field "message"] 3)#@73 Determine at run time what function should be called to display X-Face.
(defvar mh-show-xface-function 'mh-face-display-function (#$ . 242))
(make-obsolete-variable 'mh-show-xface-function nil "29.1")
(defvar mh-uncompface-executable (executable-find "uncompface"))#@17 Display X-Face.
(defalias 'mh-show-xface #[0 "\205 	\205 \n\204 \204 \f\205 \305 \207" [window-system mh-show-use-xface-flag mh-decode-mime-flag mh-mhl-format-file mh-clean-message-header-flag mh-face-display-function] 1 (#$ . 513)])#@141 Display a Face, X-Face, or X-Image-URL header field.
If more than one of these are present, then the first one found
in this order is used.
(defalias 'mh-face-display-function #[0 "\214eb\210\301\302d\303#\210e`}\210\303\304\305\303\"\304\306\303\"\304\307\303\"\310\211\203- \311!\262\312\262\202T \203< \313!\262\314\262\202T \203F \315\262\202T \316\317 !\211@\262\211A@\262\210\211\205\204 eb\210\301\320d\303#\205\204 \211\315=\203o \321!\202\204 \322\323\303\324\325\326\310\303#\327\330\326\310\303#&\331\")\266\205)\207" [case-fold-search re-search-forward "\n\n" t message-fetch-field "face" "x-face" "x-image-url" nil mh-face-to-png png mh-uncompface pbm url cl-values-list mh-picon-get-image "^from:" mh-x-image-url-display insert-image create-image :foreground face-foreground mh-show-xface :background face-background " "] 17 (#$ . 760)])#@54 Convert base64 encoded DATA to png image.

(fn DATA)
(defalias 'mh-face-to-png #[257 "\300\301\302\"r\211q\210\303\304\"\216\305\306!\210c\210\3071! \310ed\"0\210\202\" \210\311 *\207" [generate-new-buffer " *temp*" t make-closure #[0 "\301\300!\205	 \302\300!\207" [V0 buffer-name kill-buffer] 2] set-buffer-multibyte nil (error) base64-decode-region buffer-string] 5 (#$ . 1634)])#@62 Run DATA through `uncompface' to generate bitmap.

(fn DATA)
(defalias 'mh-uncompface #[257 "\301\302\303\"r\211q\210\304\305\"\216\306\307!\210c\210\205) \310ed\303\311%\312=\205) \313 \210\314 *\207" [mh-uncompface-executable generate-new-buffer " *temp*" t make-closure #[0 "\301\300!\205	 \302\300!\207" [V0 buffer-name kill-buffer] 2] set-buffer-multibyte nil call-process-region (t nil) 0 mh-icontopbm buffer-string] 8 (#$ . 2024)])#@35 Elisp substitute for `icontopbm'.
(defalias 'mh-icontopbm #[0 "eb\210d\300\301\302\303#\203$ \212db\210\304\305\306!\307\"c\210\304\305\310!\307\"c)\210\202 e|\210eb\210\311c\207" [re-search-forward "0x\\(..\\)\\(..\\)," nil t string-to-number match-string 1 16 2 "P4\n48 48\n"] 5 (#$ . 2472)])#@113 List of directories where picons reside.
The directories are searched for in the order they appear in the list.
(defvar mh-picon-directory-list '("~/.picons" "~/.picons/users" "~/.picons/usenix" "~/.picons/news" "~/.picons/domains" "~/.picons/misc" "/usr/share/picons/" "/usr/share/picons/users" "/usr/share/picons/usenix" "/usr/share/picons/news" "/usr/share/picons/domains" "/usr/share/picons/misc") (#$ . 2775))#@35 List of directories to search in.
(defvar mh-picon-existing-directory-list 'unset (#$ . 3195))
(defvar mh-picon-cache (make-hash-table :test 'equal))
(defvar mh-picon-image-types (byte-code "\300\301\211:\203* @\262\3021 \303!0\202 \210\202# \203# B\262A\262\202 \211\237\207" [(xpm xbm gif) nil (error) image-type-available-p] 5))
(autoload 'message-tokenize-header "sendmail")#@51 Find the best possible match and return contents.
(defalias 'mh-picon-get-image #[0 "\303 \210\214\3041 \305\306\307!!@0\202 \210\310\3111 \312!0\202! \210\310@\211\2052 \313\314\"\2052 \315\316\"\227\211\205; \315\317\"\227\320\321#\322\"\205P \323\324\325\326\"\"\203Z \266\207\202c\211\204d \266\310\202c\3272U	\211\203\323 \211@\n\310\211\211\211\211:\203\312 @\262\320\330$\262\331!\203\224 \332\327\"\210\320\330$\262\331!\203\252 \332\327\"\210\320\330$\262\331!\203\300 \332\327\"\210A\262\310\262\202u \266A\266\202\202i \210\333D\211\205R\211@	\211\203J\211@\310\211:\203A\334#\262\n\310\211\211\211:\2035@\262\320\335#\262\331!\203\332\327\"\210\320\336#\262\331!\203+\332\327\"\210A\262\310\262\202\372 \266A\262\310\262\202\347 \266A\266\202\202\336 \210A\266\202\202\327 \2620\337\340!#\262\262\266\207)\207" [mh-picon-cache mh-picon-existing-directory-list mh-picon-image-types mh-picon-set-directory-list (error) message-tokenize-header mh-get-header-field "from:" nil (error) mail-header-parse-address string-match "\\([^+]*\\)\\(\\+.*\\)?@\\(.*\\)" match-string 3 1 format "%s@%s" gethash delete "" split-string "\\." --cl-block-loop-- "%s/%s.%s" file-exists-p throw "unknown" mh-picon-generate-path "%s.%s" "%s/face.%s" puthash mh-picon-file-contents] 23 (#$ . 3591)])#@54 Update `mh-picon-existing-directory-list' if needed.
(defalias 'mh-picon-set-directory-list #[0 "\302=\205* 	\303\211:\203$ @\262\304!\203 B\262A\262\202	 \211\237\266\203\211\207" [mh-picon-existing-directory-list mh-picon-directory-list unset nil file-directory-p] 5 (#$ . 4989)])#@211 Generate the image file path.
HOST-LIST is the parsed host address of the email address, USER
the username and DIRECTORY is the directory relative to which the
path is generated.

(fn HOST-LIST USER DIRECTORY)
(defalias 'mh-picon-generate-path #[771 "\300\301:\203 @\262\302\303#\262A\262\202 \302\304$\207" ["" nil format "%s/%s" "%s/%s%s"] 11 (#$ . 5290)])#@200 Return details about FILE.
A list of consisting of a symbol for the type of the file and the
file contents as a string is returned. If FILE is nil, then both
elements of the list are nil.

(fn FILE)
(defalias 'mh-picon-file-contents #[257 "\211;\203- \300\301\302\"r\211q\210\303\304\"\216\305\306!\210\307\310\"\205# \311\312\313\"!\314!\210\211\315 *D\207\306\211D\207" [generate-new-buffer " *temp*" t make-closure #[0 "\301\300!\205	 \302\300!\207" [V0 buffer-name kill-buffer] 2] set-buffer-multibyte nil string-match ".*\\.\\(...\\)$" intern match-string 1 insert-file-contents-literally buffer-string] 6 (#$ . 5670)])#@48 Function to use to scale image to proper size.
(defvar mh-x-image-scaling-function (byte-code "\300\301!\203 \302\207\300\303!\203 \300\304!\203 \300\305!\203 \306\207\307\207" [executable-find "convert" mh-x-image-scale-with-convert "anytopnm" "pnmscale" "pnmtopng" mh-x-image-scale-with-pnm ignore] 2) (#$ . 6304))#@88 Scale image in INPUT file and write to OUTPUT file using pnm tools.

(fn INPUT OUTPUT)
(defalias 'mh-x-image-scale-with-pnm #[514 "\300\301\302#!\211\303\232?\205 \304!\207" [shell-command-to-string format "anytopnm < %s | pnmscale -xysize 96 48 | pnmtopng > %s" "" delete-file] 7 (#$ . 6630)])#@90 Scale image in INPUT file and write to OUTPUT file using ImageMagick.

(fn INPUT OUTPUT)
(defalias 'mh-x-image-scale-with-convert #[514 "\300\301\302\211\211\303\304&\207" [call-process "convert" nil "-geometry" "96x48"] 11 (#$ . 6934)])
(defvar mh-wget-executable nil)
(defvar mh-wget-choice (byte-code "\301\302!\211\203\n \303\207\301\304!\211\203 \305\207\301\306!\211\205 \307\207" [mh-wget-executable executable-find "wget" wget "fetch" fetch "curl" curl] 2))
(defvar mh-wget-option (byte-code "\301\302\"A\207" [mh-wget-choice assoc ((curl . "-o") (fetch . "-o") (wget . "-O"))] 3))
(defvar mh-x-image-temp-file nil)
(defvar mh-x-image-url nil)
(defvar mh-x-image-marker nil)
(defvar mh-x-image-url-cache-file nil)#@112 Display image from location URL.
If the URL isn't present in the cache then it is fetched with wget.

(fn URL)
(defalias 'mh-x-image-url-display #[257 "\304!\305!\306 \307\300!\210\211\310!?\206l \311=\203  \312\"\207	?\206l \n\313=\206l \314=\206l \204: \211\315\211\223\207\316=\203L \317\315\"\210\320\321$\207\322=\203a \323\324\325\"!\204a \317\314\"\207?\205l \320\321$\207" [mh-x-image-marker mh-wget-executable mh-x-image-scaling-function mh-fetch-x-image-url mh-x-image-url-cache-canonicalize mh-x-image-get-download-state point-marker make-local-variable mh-x-image-url-sane-p ok mh-x-image-display ignore never nil try-again mh-x-image-set-download-state mh-x-image-url-fetch-image mh-x-image-scale-and-display ask y-or-n-p format "Fetch %s? "] 9 (#$ . 7673)])#@48 Directory where X-Image-URL images are cached.
(defvar mh-x-image-cache-directory nil (#$ . 8472))#@130 Set the DIRECTORY where X-Image-URL images are cached.
This is only done if `mh-x-image-cache-directory' is nil.

(fn DIRECTORY)
(defalias 'mh-set-x-image-cache-directory #[257 "?\205 \211\211\207" [mh-x-image-cache-directory] 3 (#$ . 8577)])#@413 Canonicalize URL.
Replace the ?/ character with a ?! character and append .png.
Also replaces special characters with `url-hexify-string'
since not all characters, such as :, are valid within Windows
filenames.  In addition, replaces * with %2a. See URL
`https://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/reference/ifaces/iitemnamelimits/GetValidCharacters.asp'.

(fn URL)
(defalias 'mh-x-image-url-cache-canonicalize #[257 "\301\302\303\304\305\306\307\310\311\"r\211q\210\312\313\"\216c\210\314\315\316\"\210\317 *\262!##\207" [mh-x-image-cache-directory format "%s/%s.png" replace-regexp-in-string "\\*" "%2a" url-hexify-string generate-new-buffer " *temp*" t make-closure #[0 "\301\300!\205	 \302\300!\207" [V0 buffer-name kill-buffer] 2] mh-replace-string "/" "!" buffer-string] 12 (#$ . 8829)])#@69 Check the state of FILE by following any symbolic links.

(fn FILE)
(defalias 'mh-x-image-get-download-state #[257 "\301!\204 \302\303\304\211\211%\210\305!\203 \306\307\310!!!\207\301!\204$ \304\207\311\207" [mh-x-image-cache-directory file-exists-p call-process "mkdir" nil file-symlink-p intern file-name-nondirectory file-chase-links ok] 7 (#$ . 9679)])#@58 Setup a symbolic link from FILE to DATA.

(fn FILE DATA)
(defalias 'mh-x-image-set-download-state #[514 "\211\203\f \300\301!\302#\207\303!\207" [make-symbolic-link symbol-name t delete-file] 6 (#$ . 10049)])#@47 Check if URL is something sensible.

(fn URL)
(defalias 'mh-x-image-url-sane-p #[257 "\211G\211\300V\203\n \301\207\211\302Y\203 \303\302O\304\232\203 \305\207\211\306Y\203, \303\306O\307\232\203, \305\207\301\207" [100 nil 5 0 "http:" t 6 "https:"] 5 (#$ . 10266)])#@45 Display IMAGE at MARKER.

(fn IMAGE MARKER)
(defalias 'mh-x-image-display #[514 "r\302!q\210\303\304 \305\306\"\216\307!\205, \310!?\205, 	=\205, b\210\311\312\313\"!*\266\202)\207" [inhibit-read-only mh-x-image-marker marker-buffer t buffer-modified-p make-closure #[0 "\301\300!\207" [V0 set-buffer-modified-p] 2] file-readable-p file-symlink-p insert-image create-image png] 8 (#$ . 10542)])#@267 Fetch and display the image specified by URL.
After the image is fetched, it is stored in CACHE-FILE. It will
be displayed in a buffer and position specified by MARKER. The
actual display is carried out by the SENTINEL function.

(fn URL CACHE-FILE MARKER SENTINEL)
(defalias 'mh-x-image-url-fetch-image #[1028 "\2030 \306	!\307\310!rq\210\311\302!\210\311\303!\210\311\304!\210\211)\312\313\314\f&\"\207\315\316\"\207" [mh-wget-executable mh-temp-fetch-buffer mh-x-image-url-cache-file mh-x-image-marker mh-x-image-temp-file mh-wget-option generate-new-buffer make-temp-file "mhe-fetch" make-local-variable set-process-sentinel start-process "*mh-x-image-url-fetch*" mh-x-image-set-download-state try-again] 14 (#$ . 10952)])#@112 When the wget PROCESS terminates scale and display image.
The argument CHANGE is ignored.

(fn PROCESS CHANGE)
(defalias 'mh-x-image-scale-and-display #[514 "\304!\305=\205d \306\211\211\211r\307!\211\262q\210\262	\262\n)\262\310=\2032 \311\312!\210\313\314\"\210\202J \"\210\315!\203E \316\"\210\202J \313\314\"\210\3171a \306\211\223\210\320!\210\321!\210\322!0\207\266\306\207" [mh-x-image-marker mh-x-image-url-cache-file mh-x-image-temp-file mh-x-image-scaling-function process-status exit nil process-buffer ignore message "The \"convert\" program is needed to display X-Image-URL" mh-x-image-set-download-state try-again file-exists-p mh-x-image-display (error) delete-process kill-buffer delete-file] 9 (#$ . 11701)])
(provide 'mh-xface)
