;ELC ;;; Compiled ;;; in Emacs version 27.1 ;;; with all optimizations. ;;; This file uses dynamic docstrings, first added in Emacs 19.29. ;;; This file does not contain utf-8 non-ASCII characters, ;;; and so can be loaded in Emacs versions earlier than 23. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (byte-code "\300\301!\210\302\303\304\"\207" [require mh-e autoload message-fetch-field "message"] 3) #@73 Determine at run time what function should be called to display X-Face. (defvar mh-show-xface-function (byte-code "\301Y\203\302\207\303\207" [emacs-major-version 21 mh-face-display-function ignore] 2) (#$ . 510)) (defvar mh-uncompface-executable (byte-code "\300\301!\205 \301\302!\207" [fboundp executable-find "uncompface"] 2)) #@17 Display X-Face. (defalias 'mh-show-xface #[nil "\205 \205\n\204 \204\f\205 \207" [window-system mh-show-use-xface-flag mh-decode-mime-flag mh-mhl-format-file mh-clean-message-header-flag mh-show-xface-function] 1 (#$ . 851)]) #@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 #[nil "\214eb\210\306\307d\310#\210e`}\210\310\311\312\310\"\311\313\310\"\311\314\310\"\315\211 \2030\316 !\317\202U\n\203=\320\n!\321\202U \203F\303\202U\322\323 !\211@A@) \205\216eb\210\306\324d\310#\205\216 \303=\203q\325 !\210\202\215\326\327!\203\215\327\330\f \310\331\332\333\315\310#\334\335\333\315\310#&\336\"\210\315.\207" [case-fold-search face x-face url raw type re-search-forward "\n\n" t message-fetch-field "face" "x-face" "x-image-url" nil mh-face-to-png png mh-uncompface pbm cl-values-list mh-picon-get-image "^from:" mh-x-image-url-display fboundp insert-image create-image :foreground face-foreground mh-show-xface :background face-background " " #1=#:--cl-var--] 13 (#$ . 1096)]) #@43 Convert base64 encoded DATA to png image. (defalias 'mh-face-to-png #[(data) "\302\303!rq\210\304\216\305\306!\203\306\307!\210 c\210\3101#\311ed\"0\202'\210\202(\210\312 +\207" [#1=#:temp-buffer data generate-new-buffer " *temp*" #[nil "\301!\205 \302!\207" [#1# buffer-name kill-buffer] 2] fboundp set-buffer-multibyte nil (error) base64-decode-region buffer-string] 3 (#$ . 2012)]) #@51 Run DATA through `uncompface' to generate bitmap. (defalias 'mh-uncompface #[(data) "\303\304!rq\210\305\216\306\307!\203\307\310!\210 c\210\n\205,\311ed\n\312\313%\314\232\205,\315 \210\316 +\207" [#1=#:temp-buffer data mh-uncompface-executable generate-new-buffer " *temp*" #[nil "\301!\205 \302!\207" [#1# buffer-name kill-buffer] 2] fboundp set-buffer-multibyte nil call-process-region t (t nil) 0 mh-icontopbm buffer-string] 6 (#$ . 2413)]) #@35 Elisp substitute for `icontopbm'. (defalias 'mh-icontopbm #[nil "eb\210d\301\302\303\304#\203%\212db\210\305\306\307!\310\"c\210\305\306\311!\310\"c\210)\202e|\210eb\210\312c)\207" [end re-search-forward "0x\\(..\\)\\(..\\)," nil t string-to-number match-string 1 16 2 "P4\n48 48\n"] 4 (#$ . 2874)]) #@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") (#$ . 3186)) #@35 List of directories to search in. (defvar mh-picon-existing-directory-list 'unset (#$ . 3607)) (defvar mh-picon-cache (make-hash-table :test 'equal)) (defvar mh-picon-image-types (byte-code "\303\304\211:\2031@\3051\306\307!\205\307 !0\202#\210\202*\203* \nBA\211\202\n\237+\207" [#:--cl-var-- type #:--cl-var-- (xpm xbm gif) nil (error) fboundp image-type-available-p] 3)) (autoload 'message-tokenize-header "sendmail") #@51 Find the best possible match and return contents. (defalias 'mh-picon-get-image #[nil "\306 \210\214\3071\310\311\312!!@0\202\210\313\3141&\315\316!\205\"\316!0\202(\210\313@\211\205:\317\320 \"\205:\321\322 \"\227\211\205D\321\323 \"\227\324\325 \n#\326\f \"%\n\205\\\327\330\331\n\332\"\"&%\203h%\202\262&\204q\313\202\262\3332\237'\313(\211)\203\370)@(*+\313\211,-\313\211./+:\203\356+@,\324\334(\f,$-\335-!\203\267\336\333-\"\210\324\334( ,$.\335.!\203\316\336\333.\"\210\324\334(\n,$/\335/!\203\345\336\333/\"\210+A\211+\202\227-)A\211)\204\200* \337D\3130\211)\205\235)@0'\313(\211)\203\222)@(&1\31321:\203\210\34010(#2*3\313\211,4\31353:\203~3@,\324\3412,#4\3354!\203_\336\3334\"\210\324\3422,#5\3355!\203u\336\3335\"\2103A\2113\202@,1A\2111\202#*)A\211)\204*)A\211)\204\313*06\f7 8\3437\3446!8#+.\207" [from-field from host user canonical-address mh-picon-cache mh-picon-set-directory-list (error) message-tokenize-header mh-get-header-field "from:" nil (error) fboundp ietf-drums-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 cached-value host-list mh-picon-existing-directory-list dir --dolist-tail-- mh-picon-image-types #1=#:--cl-var-- type file1 file2 file3 u x y #2=#:--cl-var-- z1 z2 match #3=#:v #4=#:v] 6 (#$ . 4053)]) #@54 Update `mh-picon-existing-directory-list' if needed. (defalias 'mh-picon-set-directory-list #[nil "\305=\205* \306\211\n:\203%\n@\307 !\203 \fB\nA\211\202 \f\237+\211\207" [mh-picon-existing-directory-list mh-picon-directory-list #1=#:--cl-var-- x #2=#:--cl-var-- unset nil file-directory-p] 3 (#$ . 5643)]) #@180 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. (defalias 'mh-picon-generate-path #[(host-list user directory) "\306 \307\n:\203\n@\310\311 #\nA\211\202\310\312\f $+\207" [acc host-list #1=#:--cl-var-- elem directory user "" nil format "%s/%s" "%s/%s%s"] 6 (#$ . 5971)]) #@189 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. (defalias 'mh-picon-file-contents #[(file) ";\2031\303\304!r q\210\305\216\306\307!\203\307\310!\210\311\312\"\205&\313\314\315\"!\316!\210\n\317 ,D\207\310\211D\207" [file #1=#:temp-buffer type generate-new-buffer " *temp*" #[nil "\301!\205 \302!\207" [#1# buffer-name kill-buffer] 2] fboundp set-buffer-multibyte nil string-match ".*\\.\\(...\\)$" intern match-string 1 insert-file-contents-literally buffer-string] 4 (#$ . 6392)]) #@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) (#$ . 7033)) #@69 Scale image in INPUT file and write to OUTPUT file using pnm tools. (defalias 'mh-x-image-scale-with-pnm #[(input output) "\303\304\305 #!\211\306\232?\205\307 !)\207" [input output res shell-command-to-string format "anytopnm < %s | pnmscale -xysize 96 48 | pnmtopng > %s" "" delete-file] 6 (#$ . 7360)]) #@71 Scale image in INPUT file and write to OUTPUT file using ImageMagick. (defalias 'mh-x-image-scale-with-convert #[(input output) "\302\303\304\211\211\305\306 &\207" [input output call-process "convert" nil "-geometry" "96x48"] 9 (#$ . 7676)]) (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) #@102 Display image from location URL. If the URL isn't present in the cache then it is fetched with wget. (defalias 'mh-x-image-url-display #[(url) "\306!\307 !\310 \311\304!\210 \312!?\206z\n\313=\203%\314 \"\202z ?\206z\315=\206z\n\316=\206z\204C \317\211\223\202z\n\320=\203W\321 \317\"\210\322 \323$\202z\324=\203n\325\326\327\"!\204n\321 \316\"\202z\n\317=\205z\322 \323$+\207" [url cache-filename state marker mh-x-image-marker mh-wget-executable 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? " mh-x-image-scaling-function mh-fetch-x-image-url] 5 (#$ . 8418)]) #@48 Directory where X-Image-URL images are cached. (defvar mh-x-image-cache-directory nil (#$ . 9257)) #@114 Set the DIRECTORY where X-Image-URL images are cached. This is only done if `mh-x-image-cache-directory' is nil. (defalias 'mh-set-x-image-cache-directory #[(directory) "?\205 \211\207" [mh-x-image-cache-directory directory] 2 (#$ . 9363)]) #@405 Canonicalize URL. Replace the ?/ character with a ?! character and append .png. Also replaces special characters with `mh-url-hexify-string' since not all characters, such as :, are valid within Windows filenames. In addition, replaces * with %2a. See URL `http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/reference/ifaces/iitemnamelimits/GetValidCharacters.asp'. (defalias 'mh-x-image-url-cache-canonicalize #[(url) "\303\304\305\306\307\310\311\312!r q\210\313\216\nc\210\314\315\316\"\210\317 +!##\207" [mh-x-image-cache-directory #1=#:temp-buffer url format "%s/%s.png" mh-replace-regexp-in-string "\\*" "%2a" mh-url-hexify-string generate-new-buffer " *temp*" #[nil "\301!\205 \302!\207" [#1# buffer-name kill-buffer] 2] mh-replace-string "/" "!" buffer-string] 10 (#$ . 9615)]) #@58 Check the state of FILE by following any symbolic links. (defalias 'mh-x-image-get-download-state #[(file) "\302!\204\303\304\305\211\211%\210\306 !\203\307\310\311 !!!\207\302 !\204$\305\207\312\207" [mh-x-image-cache-directory file file-exists-p call-process "mkdir" nil file-symlink-p intern file-name-nondirectory file-chase-links ok] 6 (#$ . 10450)]) #@42 Setup a symbolic link from FILE to DATA. (defalias 'mh-x-image-set-download-state #[(file data) "\203\f\302\303! \304#\207\305 !\207" [data file make-symbolic-link symbol-name t delete-file] 4 (#$ . 10819)]) #@37 Check if URL is something sensible. (defalias 'mh-x-image-url-sane-p #[(url) "G\211\302W\203 \303\202&\304\305\302#\306\232\204\303\202& \307V\203%\303\202&\310)\207" [url len 5 nil substring 0 "http:" 100 t] 5 (#$ . 11036)]) #@26 Display IMAGE at MARKER. (defalias 'mh-x-image-display #[(image marker) "r\305!q\210\306\307 \310\216\311 !\2051\312 !?\2051\f=\2051b\210\313\314!\2030\314\315 \316\"!\210\317,\207" [marker buffer-modified-flag inhibit-read-only image mh-x-image-marker marker-buffer t buffer-modified-p #[nil "\301!\207" [buffer-modified-flag set-buffer-modified-p] 2] file-readable-p file-symlink-p fboundp insert-image create-image png nil] 4 (#$ . 11278)]) #@230 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. (defalias 'mh-x-image-url-fetch-image #[(url cache-file marker sentinel) "\203G\306\307 !!\310\311!\203\311\312!\206\313\314\315!!r q\210\316\305!\210\f\316\317!\210\316\320!\210\n)\321\322\323 \n&\"*\207\324\f\325\"\207" [mh-wget-executable mh-temp-fetch-buffer filename buffer cache-file mh-x-image-url-cache-file get-buffer-create generate-new-buffer-name fboundp make-temp-file "mhe-fetch" expand-file-name make-temp-name "~/mhe-fetch" make-local-variable mh-x-image-marker mh-x-image-temp-file set-process-sentinel start-process "*mh-x-image-url-fetch*" mh-x-image-set-download-state try-again marker mh-wget-option url sentinel] 8 (#$ . 11739)]) #@91 When the wget PROCESS terminates scale and display image. The argument CHANGE is ignored. (defalias 'mh-x-image-scale-and-display #[(process _change) "\306!\307=\205h\310\211\211\211r\311!\211q\210 )\312=\2034\313\314!\210\315\n\316\"\210\202M \n\"\210\317\n!\203H\320\n\f\"\210\202M\315\n\316\"\210\3211e\f\310\211\223\210\322!\210\323 !\210\324 !0\202g\210\310,\207" [process wget-buffer cache-filename temp-file marker mh-x-image-marker 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 mh-x-image-url-cache-file mh-x-image-temp-file mh-x-image-scaling-function] 4 (#$ . 12649)]) (provide 'mh-xface)