%PDF- %PDF-
Direktori : /usr/local/share/emacs/27.2/lisp/gnus/ |
Current File : //usr/local/share/emacs/27.2/lisp/gnus/gnus-fun.elc |
;ELC ;;; Compiled ;;; in Emacs version 27.2 ;;; 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\300\302!\210\300\303!\210\304\305\306\307\310\311\312\313\314\315& \210\304\316\317\320\310\321\312\313\314\322& \210\304\323\324\325\310\321\312\313\314\315& \210\304\326\317\327\310\321\312\313\314\330& \210\304\331\332\333\310\311\312\313\314\334& \210\304\335\336\337\310\311\312\313\314\340& \210\304\341\342\343\310\311\312\313\314\344& \207" [require mm-util gnus-util gnus custom-declare-variable gnus-x-face-directory (expand-file-name "x-faces" gnus-directory) "Directory where X-Face PBM files are stored." :version "22.1" :group gnus-fun :type directory gnus-x-face-omit-files nil "Regexp to match faces in `gnus-x-face-directory' to be omitted." "25.1" (choice (const nil) string) gnus-face-directory (expand-file-name "faces" gnus-directory) "Directory where Face PNG files are stored." gnus-face-omit-files "Regexp to match faces in `gnus-face-directory' to be omitted." (choice (const nil) string) gnus-convert-pbm-to-x-face-command "pbmtoxbm %s | compface" "Command for converting a PBM to an X-Face." string gnus-convert-image-to-x-face-command "convert -scale 48x48! %s xbm:- | xbm2xface.pl" "Command for converting an image to an X-Face.\nThe command must take an image filename (use \"%s\") as input.\nThe output must be the X-Face header data on stdout." (choice (const :tag "giftopnm, netpbm (GIF input only)" "giftopnm %s | ppmnorm | pnmscale -width 48 -height 48 | ppmtopgm | pgmtopbm | pbmtoxbm | compface") (const :tag "convert" "convert -scale 48x48! %s xbm:- | xbm2xface.pl") (string)) gnus-convert-image-to-face-command "convert -scale 48x48! %s -colors %d png:-" "Command for converting an image to a Face.\n\nThe command must take an image filename (first format argument\n\"%s\") and the number of colors (second format argument: \"%d\")\nas input. The output must be the Face header data on stdout in\nPNG format." (choice (const :tag "djpeg, netpbm (JPG input only)" "djpeg %s | ppmnorm | pnmscale -width 48 -height 48 | ppmquant %d | pnmtopng") (const :tag "convert" "convert -scale 48x48! %s -colors %d png:-") (string))] 10) #@59 Like `shell-command-to-string' except not mingling ERROR. (defalias 'gnus-shell-command-to-string #[(command) "\304\305!\306\216\307 \310\310D\310\n&\210)rq\210\311 +\207" [standard-output shell-file-name shell-command-switch command generate-new-buffer " *string-output*" #[nil "\301!\207" [standard-output kill-buffer] 2] call-process nil buffer-string] 7 (#$ . 2498)]) #@86 Return file from DIR with extension EXT, omitting matches of OMIT, processed by FUN. (defalias 'gnus--random-face-with-type #[(dir ext omit fun) "\305!\205! \306\307\310\311\312\313 #\"\"\314\nG!\n8\211\205 \f!*\207" [dir ext files file fun file-exists-p remove nil mapcar #[(f) "\302\206 \303 \"?\205 \207" [omit f string-match "^$"] 3] directory-files t random] 9 (#$ . 2884)]) (byte-code "\300\301\302\303\304$\210\300\305\302\303\304$\207" [autoload message-goto-eoh "message" nil t message-insert-header] 5) #@152 Get a random face using FUN and insert it as a header TYPE. For instance, to insert an X-Face use `gnus-random-x-face' as FUN and "X-Face" as TYPE. (defalias 'gnus--insert-random-face-with-type #[(fun type) " \212 \203 \303 \210\n\304 \305\261\202 \306\307\310!\"*\207" [fun data type message-goto-eoh ": " "\n" message "No face returned by the function %s." symbol-name] 4 (#$ . 3414)]) #@134 Return X-Face header data chosen randomly from `gnus-x-face-directory'. Files matching `gnus-x-face-omit-files' are not considered. (defalias 'gnus-random-x-face #[nil "\302\303 \304$\207" [gnus-x-face-directory gnus-x-face-omit-files gnus--random-face-with-type "\\.pbm$" #[(file) "\302\303\304 !\"!\207" [gnus-convert-pbm-to-x-face-command file gnus-shell-command-to-string format shell-quote-argument] 5]] 5 (#$ . 3818) nil]) #@61 Insert a random X-Face header from `gnus-x-face-directory'. (defalias 'gnus-insert-random-x-face-header #[nil "\300\301\302\"\207" [gnus--insert-random-face-with-type gnus-random-x-face X-Face] 3 (#$ . 4256) nil]) #@141 Insert an X-Face header based on an image FILE. Depending on `gnus-convert-image-to-x-face-command' it may accept different input formats. (defalias 'gnus-x-face-from-file #[(file) "\302!\205 \303\304 \305\306!!\"!\207" [file gnus-convert-image-to-x-face-command file-exists-p gnus-shell-command-to-string format shell-quote-argument expand-file-name] 6 (#$ . 4477) "fImage file name: "]) #@136 Return a Face header based on an image FILE. Depending on `gnus-convert-image-to-face-command' it may accept different input formats. (defalias 'gnus-face-from-file #[(file) "\306!\205e \307\310\311\204K \312V\203K \313\314\315 \316\317!! #!)\211G\320V\203E \211\321W\2037 \312\2028 \322Z\323\324\325\nG $\210\202\f \326\211\203 \205d \327\330!rq\210\331\216\332 \210\nc\210\333 ++\207" [file quant attempt done coding-system-for-read gnus-convert-image-to-face-command file-exists-p nil "" 16 1 binary gnus-shell-command-to-string format shell-quote-argument expand-file-name 726 10 2 gnus-message 9 "Length %d; trying quant %d" t generate-new-buffer " *temp*" #[nil "\301!\205 \302!\207" [#1=#:temp-buffer buffer-name kill-buffer] 2] mm-disable-multibyte gnus-face-encode #1#] 7 (#$ . 4877) "fImage file name: "]) (defalias 'gnus-face-encode #[nil "\301\302ed\"\210eb\210\303\304\305\306#\203 \307\310!\210\202\n eb\210d`ZV\203/ u\210\311c\210\312\202 \313 )\207" [step 72 base64-encode-region search-forward "\n" nil t replace-match "" "\n " 76 buffer-string] 4]) #@83 Convert FACE (which is base64-encoded) to a PNG. The PNG is returned as a string. (defalias 'gnus-convert-face-to-png #[(face) "\302\303!rq\210\304\216\305 \210 c\210\3061 \307ed\"0\202 \210\202! \210\310 +\207" [#1=#:temp-buffer face generate-new-buffer " *temp*" #[nil "\301!\205 \302!\207" [#1# buffer-name kill-buffer] 2] mm-disable-multibyte (error) base64-decode-region buffer-string] 3 (#$ . 5978)]) #@104 Convert FILE to a Face. FILE should be a PNG file that's 48x48 and smaller than or equal to 726 bytes. (defalias 'gnus-convert-png-to-face #[(file) "\302\303!rq\210\304\216\305 \210\306 !\210\307 \310V\203 \311\312\307 \"\210\313 +\207" [#1=#:temp-buffer file generate-new-buffer " *temp*" #[nil "\301!\205 \302!\207" [#1# buffer-name kill-buffer] 2] mm-disable-multibyte insert-file-contents buffer-size 726 error "The file is %d bytes long, which is too long" gnus-face-encode] 3 (#$ . 6399)]) #@116 Return randomly chosen Face from `gnus-face-directory'. Files matching `gnus-face-omit-files' are not considered. (defalias 'gnus-random-face #[nil "\302\303 \304$\207" [gnus-face-directory gnus-face-omit-files gnus--random-face-with-type "\\.png$" gnus-convert-png-to-face] 5 (#$ . 6908) nil]) #@57 Insert a random Face header from `gnus-face-directory'. (defalias 'gnus-insert-random-face-header #[nil "\300\301\302\"\207" [gnus--insert-random-face-with-type gnus-random-face Face] 3 (#$ . 7211)]) (custom-declare-face 'gnus-x-face '((t (:foreground "black" :background "white"))) "Face to show X-Face.\nThe colors from this face are used as the foreground and background\ncolors of the displayed X-Faces." :group 'gnus-article-headers) #@45 Display the X-Face DATA in the From header. (defalias 'gnus-display-x-face-in-from #[(data) "\303\304!\210\305\306\307!\204 \306\300!\205X \310 !\211\205X \212\214\311 \210\312\313!\210o\203- \314c\210\315u\210\316\307\317\306\307!\203E \320\321\322 P\307\323\307\n\236A%\202O \320\321\300\323\300\n\236A%\305\307#\"\210\324\307!*)\207" [pbm data gnus-face-properties-alist require gnus-art nil gnus-image-type-available-p xface uncompface article-narrow-to-head gnus-article-goto-header "from" "From: [no 'from' set]\n" -17 gnus-add-image gnus-put-image apply gnus-create-image "X-Face: " t gnus-add-wash-type] 10 (#$ . 7656)]) #@59 Grab a picture off the camera and make it into an X-Face. (defalias 'gnus-grab-cam-x-face #[nil "\302\303!\210\304\305\306\307\310#\211\204 \311\312!\210\202 @\313\314!r q\210\315\216\302\316\317\"p\"\210\320!\210\321 ,\207" [file #1=#:temp-buffer shell-command "xawtv-remote snap ppm" nil directory-files "/tftpboot/sparky/tmp" t "snap.*ppm" sleep-for 1 generate-new-buffer " *temp*" #[nil "\301!\205 \302!\207" [#1# buffer-name kill-buffer] 2] format "pnmcut -left 110 -top 30 -width 144 -height 144 '%s' | ppmnorm 2>/dev/null | pnmscale -width 48 | ppmtopgm | pgmtopbm -threshold -value 0.92 | pbmtoxbm | compface" delete-file buffer-string] 4 (#$ . 8295) nil]) #@59 Grab a picture off the camera and make it into an X-Face. (defalias 'gnus-grab-cam-face #[nil "\304\305!\210\306\307\310\306\311#\306\312\313\314\315#\211\204 \316\317!\210\202 \n@\304\320\321\n #!\210\320\322\323 \"\324 !)\325\n!\210+\207" [result tempfile file gnus-convert-image-to-face-command shell-command "xawtv-remote snap ppm" nil make-temp-file "gnus-face-" ".ppm" directory-files "/tftpboot/sparky/tmp" t "snap.*ppm" sleep-for 1 format "pnmcut -left 110 -top 30 -width 144 -height 144 '%s' | pnmscale -width 48 -height 48 | ppmtopgm >> %s" "cat '%%s' | ppmquant %%d | ppmchange %s | pnmtopng" gnus-fun-ppm-change-string gnus-face-from-file delete-file] 5 (#$ . 8978) nil]) (defalias 'gnus-fun-ppm-change-string #[nil "\305\306\307\310!8\311Q\312\313\314\fW\203+ \301 \211\211\211\211\211&\nBT\211\202 *\315\316\n\317#+\207" [possibilities format values i --dotimes-limit-- ("%02x0000" "00%02x00" "0000%02x" "%02x%02x00" "00%02x%02x" "%02x00%02x") "'#%02x%02x%02x' '#" random 6 "'" nil 255 0 mapconcat identity " "] 9]) (defalias 'gnus-funcall-no-warning #[(function &rest args) "\302!\205\n \303 \"\207" [function args fboundp apply] 3]) (provide 'gnus-fun)