Server IP : 111.118.215.189 / Your IP : 18.116.98.100 Web Server : Apache System : Linux md-in-83.webhostbox.net 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64 User : a1673wkz ( 2475) PHP Version : 8.2.25 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON Directory (0755) : /usr/share/emacs/24.3/lisp/ |
[ Home ] | [ C0mmand ] | [ Upload File ] |
---|
;ELC ;;; Compiled by mockbuild@buildfarm06-new.corp.cloudlinux.com on Fri Oct 11 10:06:32 2024 ;;; from file /builddir/build/BUILD/emacs-24.3/lisp/thumbs.el ;;; in Emacs version 24.3.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\305\306\307\310\311&\210\312\313\314\315\316\317\310\303&\210\312\320\321\322\316\323\310\303&\210\312\324\325\326\316\327\310\303&\210\312\330\331\332\316\327\310\303&\210\312\333\334\335\316\327\310\303&\210\312\336\337\340\316\323\310\303&\210\312\341\342\343\316\323\310\303&\210\312\344\345\346\316\327\310\303&\210\312\347\350\351\316\327\310\303&\210\312\352\353\354\316\355\310\303&\210\312\356\357\360\316\327\310\303&\210\312\361\362\363\316\317\310\303&\210\312\364\365\366\316\323\310\303&\207" [require dired custom-declare-group thumbs nil "Thumbnails previewer." :version "22.1" :group multimedia custom-declare-variable thumbs-thumbsdir (locate-user-emacs-file "thumbs") "Directory to store thumbnails." :type directory thumbs-geometry "100x100" "Size of thumbnails." string thumbs-per-line 4 "Number of thumbnails per line to show in directory." integer thumbs-max-image-number 16 "Maximum number of images initially displayed in thumbs buffer." thumbs-thumbsdir-max-size 50000000 "Maximum size for thumbnails directory.\nWhen it reaches that size (in bytes), a warning is sent." thumbs-conversion-program (if (eq system-type 'windows-nt) "convert.exe" (or (executable-find "convert") "/usr/X11R6/bin/convert")) "Name of conversion program for thumbnails generation.\nIt must be 'convert'." thumbs-setroot-command "xloadimage -onroot -fullscreen *" "Command to set the root window." thumbs-relief 5 "Size of button-like border around thumbnails." thumbs-margin 2 "Size of the margin around thumbnails.\nThis is where you see the cursor." thumbs-thumbsdir-auto-clean t "If set, delete older file in the thumbnails directory.\nDeletion is done at load time when the directory size is bigger\nthan `thumbs-thumbsdir-max-size'." boolean thumbs-image-resizing-step 10 "Step by which to resize image as a percentage." thumbs-temp-dir temporary-file-directory "Temporary directory to use.\nDefaults to `temporary-file-directory'. Leaving it to\nthis value can let another user see some of your images." thumbs-temp-prefix "emacsthumbs" "Prefix to add to temp files."] 8) #@38 Temporary filename of current image. (defvar thumbs-current-tmp-filename nil (#$ . 2683)) (make-variable-buffer-local 'thumbs-current-tmp-filename) #@28 Filename of current image. (defvar thumbs-current-image-filename nil (#$ . 2837)) (make-variable-buffer-local 'thumbs-current-image-filename) #@52 Counter for showing extra images in thumbs buffer. (defvar thumbs-extra-images 1 (#$ . 2985)) (byte-code "\300\301!\210\302\301\303\304#\207" [make-variable-buffer-local thumbs-extra-images put permanent-local t] 4) #@24 Size of current image. (defvar thumbs-current-image-size nil (#$ . 3207)) #@26 Number of current image. (defvar thumbs-image-num nil (#$ . 3287)) (make-variable-buffer-local 'thumbs-image-num) #@61 Name of buffer containing thumbnails associated with image. (defvar thumbs-buffer nil (#$ . 3407)) (make-variable-buffer-local 'thumbs-buffer) #@20 Current directory. (defvar thumbs-current-dir nil (#$ . 3556)) #@23 List of marked files. (defvar thumbs-marked-list nil (#$ . 3625)) (byte-code "\300\301!\210\302\301\303\304#\210\305\306\307\310!\203 \310\202 \311\312!\210\313\"\207" [make-variable-buffer-local thumbs-marked-list put permanent-local t defalias thumbs-gensym fboundp gensym (lambda (#1=#:def-tmp-var) (defvar thumbs-gensym-counter #1#)) 0 #[(&optional prefix) ";\203 \202\n \304\250\203 \202 \211T\305\306\307\n#!*\207" [prefix thumbs-gensym-counter num pfix "G" make-symbol format "%s%d"] 5 "Generate a new uninterned symbol.\nThe name is made by appending a number to PREFIX, default \"G\"."]] 4) (defalias 'thumbs-temp-dir #[nil "\301\302!!\207" [thumbs-temp-dir file-name-as-directory expand-file-name] 3]) (put 'thumbs-temp-dir 'byte-optimizer 'byte-compile-inline-expand) #@50 Return a unique temporary filename for an image. (defalias 'thumbs-temp-file #[nil "\302\303\304\305!! \306\307!$\207" [thumbs-temp-dir thumbs-temp-prefix format "%s%s-%s.jpg" file-name-as-directory expand-file-name thumbs-gensym "T"] 6 (#$ . 4425)]) #@122 Return the current thumbnails directory (from `thumbs-thumbsdir'). Create the thumbnails directory if it does not exist. (defalias 'thumbs-thumbsdir #[nil "\301\302!!\303!\204 \304\305\"\210\306\307!\210)\207" [thumbs-thumbsdir file-name-as-directory expand-file-name file-directory-p make-directory t message "Creating thumbnails directory"] 3 (#$ . 4684)]) #@179 Clean the thumbnails directory. If the total size of all files in `thumbs-thumbsdir' is bigger than `thumbs-thumbsdir-max-size', files are deleted until the max size is reached. (defalias 'thumbs-cleanup-thumbsdir #[nil "\304\305\306\307\310 \311\312 #\"\313\"\314\315\305\316\"\" \nV\205I \317\320\211@A)\211A@)\"\210\321\211@A)\211A@)!\210 \211@A)@ZA\202 *\207" [files-list dirsize thumbs-thumbsdir-max-size x sort mapcar #[(f) "\302!\303 8\304 8E)\207" [f fattribs-list file-attributes 4 7] 3] directory-files thumbs-thumbsdir t image-file-name-regexp #[(l1 l2) "\302@ @\"\207" [l1 l2 time-less-p] 3] apply + #[(x) "\211A@)\207" [x] 2] message "Deleting file %s" delete-file] 8 (#$ . 5056)]) (byte-code "\203 \301 \210\301\207" [thumbs-thumbsdir-auto-clean thumbs-cleanup-thumbsdir] 1) #@371 Call the convert program. FILEIN is the input file, FILEOUT is the output file, ACTION is the command to send to convert. Optional arguments are: ARG any arguments to the ACTION command, OUTPUT-FORMAT is the file format to output (default is jpeg), ACTION-PREFIX is the symbol to place before the ACTION command (defaults to '-' but can sometimes be '+'). (defalias 'thumbs-call-convert #[(filein fileout action &optional arg output-format action-prefix) "\306\307\211\211 \206\n \310\n\206 \311\f\312\313 \206 \314 #& \207" [thumbs-conversion-program action-prefix action arg filein output-format call-process nil "-" "" format "%s:%s" "jpeg" fileout] 13 (#$ . 5875)]) #@39 New image (a cons of width x height). (defalias 'thumbs-new-image-size #[(s increment) " _\304@\n@_\305\245\\!\304A\nA_\305\245\\!)B\207" [increment thumbs-image-resizing-step d s round 100] 5 (#$ . 6570)]) #@149 Resize image in current buffer. If SIZE is specified use it. Otherwise make the image larger or smaller according to whether INCREMENT is 1 or -1. (defalias 'thumbs-resize-image-1 #[(&optional increment size) "\306 \206\f \307\f \"\310 \311 \210\312\n\206 \313\314@!\315\314A!Q$\210\212\316\317\320#\210)\211,\207" [buffer-read-only thumbs-current-tmp-filename old size thumbs-current-image-size increment nil thumbs-new-image-size thumbs-temp-file erase-buffer thumbs-call-convert "sample" number-to-string "x" thumbs-insert-image jpeg 0 x tmp thumbs-current-image-filename] 8 (#$ . 6790)]) #@59 Resize image interactively to specified WIDTH and HEIGHT. (defalias 'thumbs-resize-image #[(width height) "\302\303 B\"\207" [width height thumbs-resize-image-1 nil] 4 (#$ . 7410) "nWidth: \nnHeight: "]) #@25 Resize image (smaller). (defalias 'thumbs-shrink-image #[nil "\300\301!\207" [thumbs-resize-image-1 -1] 2 (#$ . 7621) nil]) #@24 Resize image (bigger). (defalias 'thumbs-enlarge-image #[nil "\300\301!\207" [thumbs-resize-image-1 1] 2 (#$ . 7751) nil]) #@44 Return a thumbnail name for the image IMG. (defalias 'thumbs-thumbname #[(img) "\302\303!\304\305\306 \307 !\310\311\312\313\314\315 \316\"\"#$)!\207" [img filename convert-standard-filename expand-file-name format "%s%08x-%s.jpg" thumbs-thumbsdir sxhash subst-char-in-string 32 95 apply concat split-string "/"] 13 (#$ . 7880)]) #@31 Create the thumbnail for IMG. (defalias 'thumbs-make-thumb #[(img) "\304!\305!\306 !\204 \307\n \310$\210 *\207" [img tn fn thumbs-geometry expand-file-name thumbs-thumbname file-exists-p thumbs-call-convert "sample"] 5 (#$ . 8218)]) #@38 Return image type from filename IMG. (defalias 'thumbs-image-type #[(img) "\301\302\"\203 \303\207\301\304\"\203 \305\207\301\306\"\203 \307\207\301\310\"\203$ \311\207\301\312\"\203- \313\207\301\314\"\2036 \315\207\301\316\"\203? \317\207\301\320\"\205G \321\207" [img string-match ".*\\.jpe?g\\'" jpeg ".*\\.xpm\\'" xpm ".*\\.xbm\\'" xbm ".*\\.pbm\\'" pbm ".*\\.gif\\'" gif ".*\\.bmp\\'" bmp ".*\\.png\\'" png ".*\\.tiff?\\'" tiff] 3 (#$ . 8464)]) (defalias 'thumbs-file-size #[(img) "\302\303\304\305!\306FC!\307\"\310\311 @!!\312\310\311 A!!Q)\207" [img i image-size find-image :type thumbs-image-type :file t number-to-string round "x"] 6]) #@32 Display the thumbnail for IMG. (defalias 'thumbs-find-thumb #[(img) "\301\302!!\207" [img find-file thumbs-make-thumb] 3 (#$ . 9131) "f"]) #@191 Insert image IMG at point. TYPE and RELIEF will be used in constructing the image; see `image' in the emacs-lisp manual for further documentation. If MARKED is non-nil, the image is marked. (defalias 'thumbs-insert-image #[(img type relief &optional marked) "\306\307\310 \311\n\312\205 \313\314\f\257\315 !\210\316\317!\210\320 \321\"\211)\207" [type img relief marked thumbs-margin i image :type :file :relief :conversion disabled :margin insert-image make-local-variable thumbs-current-image-size image-size t] 11 (#$ . 9278)]) #@83 Insert the thumbnail for IMG at point. If MARKED is non-nil, the image is marked. (defalias 'thumbs-insert-thumb #[(img &optional marked) "\303\304!\305 \n$\210\306`S`\307\310\311!\312BBBB#\207" [img thumbs-relief marked thumbs-insert-image thumbs-make-thumb jpeg add-text-properties thumb-image-file help-echo file-name-nondirectory (rear-nonsticky help-echo)] 8 (#$ . 9822)]) #@43 Insert all thumbnails into thumbs buffer. (defalias 'thumbs-do-thumbs-insertion #[(list) "\306 G\211\f_Z\307 \"\210 \310\211\203A @\311\211\235\"\210\312T\211\"\306U\2038 \313 \210A\211\204 *o\204I \313 \210 \306V\205R \314\315!+\207" [i list length thumbs-max-image-number thumbs-extra-images diff 0 nbutlast nil thumbs-insert-thumb mod newline message "Type + to display more images." img --dolist-tail-- thumbs-marked-list thumbs-per-line] 5 (#$ . 10209)]) (defalias 'thumbs-show-thumbs-list #[(list &optional dir same-window) "\306 \203 \307\310!\204 \311\312!\210\203 \313\202 \314 \203\"