;ELC ;;; Compiled ;;; in Emacs version 28.0.50 ;;; with all optimizations. (byte-code "\300\301!\210\300\302!\210\300\303!\210\304\305!\204\306\305\307\"\210\300\310!\210\304\311!\204'\306\311\312\313#\210\300\207" [require cl-lib format-spec faces fboundp alist-get defalias #[1026 "\236\211\203\n\211A\207\207" [] 6 "Get the value associated to KEY in ALIST.\nDEFAULT is the value to return if KEY is not found in ALIST.\nREMOVE, if non-nil, means that when setting this element, we should\nremove the entry if the new value is `eql' to DEFAULT.\n\n(fn KEY ALIST &optional DEFAULT REMOVE)"] register register-read-with-preview read-char "Compatibility alias for pdf-tools."] 4) #@61 Return the width of WINDOW in pixel. (fn &optional WINDOW) (defalias 'pdf-util-window-pixel-width '(macro . #[256 "\300\301K!A\302W\203\303\304!\305DC\306\301D\307\310DDEE\207\301\311BB\207" [subr-arity window-body-width 2 make-symbol "window" let * frame-char-width window-frame (t)] 9 (#$ . 699)])) (byte-code "\302V\204 \302U\203 \303Y\204 \304\305!\210\306\307K!\210\310\311\312\"\210\302\207" [emacs-major-version emacs-minor-version 24 4 require image-mode (lambda (def-tmp-var) (defvar image-mode-winprops-original-function def-tmp-var)) image-mode-winprops eval-after-load "image-mode" #[0 "\300\301\302\"\207" [defalias image-mode-winprops #[512 "\303=\204 \"\207\204!p\304 =\203\305 \202\306\262\2022\306=\2042\307!\2042\310\311\"\210\211\203>\312\313\314\315\n\"\"\n\236\211\203M\211\312\n\"B\207\316\n@A!B\262\211\nB\317\320\"\210\207" [major-mode image-mode-winprops-original-function image-mode-winprops-alist pdf-view-mode window-buffer selected-window t windowp error "Not a window: %s" delq nil mapcar #[257 "\211\242\300!\203\301!\205\207" [windowp window-live-p] 4 "\n\n(fn WINPROP)"] copy-alist run-hook-with-args image-mode-new-window-functions] 7 "\n\n(fn &optional WINDOW CLEANUP)"]] 3]] 3) #@553 Scale LIST-OF-EDGES-OR-POS by SCALE. SCALE is a cons (SX . SY), by which edges/positions are scaled. If ROUNDING-FN is non-nil, it should be a function of one argument, a real value, returning a rounded value (e.g. `ceiling'). The elements in LIST-OF-EDGES-OR-POS should be either a list (LEFT TOP RIGHT BOT) or a position (X . Y). LIST-OF-EDGES-OR-POS may also be a single such element. Return scaled list of edges if LIST-OF-EDGES-OR-POS was indeed a list, else return the scaled singleton. (fn LIST-OF-EDGES-OR-POS SCALE &optional ROUNDING-FN) (defalias 'pdf-util-scale #[770 "@<\211\204 C\262@A\300\301\302$\"\203\207\211@\207" [mapcar make-closure #[257 "\211A:\203$\211@\301_A@\302_\3038\301_\3048\302_F\300\203#\305\300\"\207\207\300\2036\300@\301_!\300A\302_!B\207\211@\301_A\302_B\207" [V0 V1 V2 2 3 mapcar] 6 "\n\n(fn EDGES)"]] 12 (#$ . 1970)]) #@173 Scale LIST-OF-EDGES in FROM basis to TO. FROM and TO should both be a cons (WIDTH . HEIGTH). See also `pdf-util-scale'. (fn LIST-OF-EDGES FROM TO &optional ROUNDING-FN) (defalias 'pdf-util-scale-to #[1027 "\300\301@!\301@!\245\301A!\301A!\245B#\207" [pdf-util-scale float] 10 (#$ . 2862)]) #@201 Scale LIST-OF-PIXEL-EDGES to point values. The result depends on the currently displayed page in WINDOW. See also `pdf-util-scale'. (fn LIST-OF-PIXEL-EDGES &optional ROUNDING-FN DISPLAYED-P WINDOW) (defalias 'pdf-util-scale-pixel-to-points #[1025 "\300!\210\301\302\"\303\304\305\"!$\207" [pdf-util-assert-pdf-window pdf-util-scale-to pdf-view-image-size pdf-cache-pagesize image-mode-window-get page] 11 (#$ . 3170)]) #@203 Scale LIST-OF-POINTS-EDGES to point values. The result depends on the currently displayed page in WINDOW. See also `pdf-util-scale'. (fn LIST-OF-POINTS-EDGES &optional ROUNDING-FN DISPLAYED-P WINDOW) (defalias 'pdf-util-scale-points-to-pixel #[1025 "\300!\210\301\302\303\304\"!\305\"$\207" [pdf-util-assert-pdf-window pdf-util-scale-to pdf-cache-pagesize image-mode-window-get page pdf-view-image-size] 10 (#$ . 3606)]) #@195 Scale LIST-OF-RELATIVE-EDGES to point values. The result depends on the currently displayed page in WINDOW. See also `pdf-util-scale'. (fn LIST-OF-RELATIVE-EDGES &optional ROUNDING-FN WINDOW) (defalias 'pdf-util-scale-relative-to-points #[769 "\300!\210\301\302\303\304\305\"!$\207" [pdf-util-assert-pdf-window pdf-util-scale-to (1.0 . 1.0) pdf-cache-pagesize image-mode-window-get page] 10 (#$ . 4043)]) #@132 Scale LIST-OF-POINTS-EDGES to relative values. See also `pdf-util-scale'. (fn LIST-OF-POINTS-EDGES &optional ROUNDING-FN WINDOW) (defalias 'pdf-util-scale-points-to-relative #[769 "\300!\210\301\302\303\304\"!\305$\207" [pdf-util-assert-pdf-window pdf-util-scale-to pdf-cache-pagesize image-mode-window-get page (1.0 . 1.0)] 9 (#$ . 4462)]) #@204 Scale LIST-OF-PIXEL-EDGES to relative values. The result depends on the currently displayed page in WINDOW. See also `pdf-util-scale'. (fn LIST-OF-PIXEL-EDGES &optional ROUNDING-FN DISPLAYED-P WINDOW) (defalias 'pdf-util-scale-pixel-to-relative #[1025 "\300!\210\301\302\"\303$\207" [pdf-util-assert-pdf-window pdf-util-scale-to pdf-view-image-size (1.0 . 1.0)] 9 (#$ . 4816)]) #@196 Scale LIST-OF-EDGES to match SIZE. The result depends on the currently displayed page in WINDOW. See also `pdf-util-scale'. (fn LIST-OF-RELATIVE-EDGES &optional ROUNDING-FN DISPLAYED-P WINDOW) (defalias 'pdf-util-scale-relative-to-pixel #[1025 "\300!\210\301\302\303\"$\207" [pdf-util-assert-pdf-window pdf-util-scale-to (1.0 . 1.0) pdf-view-image-size] 10 (#$ . 5209)]) #@306 Translate LIST-OF-EDGES-OR-POS by OFFSET OFFSET should be a cons (X . Y), by which to translate LIST-OF-EDGES-OR-POS. If OPPOSITE-DIRECTION-P is non-nil translate by (-X . -Y). See `pdf-util-scale' for the LIST-OF-EDGES-OR-POS argument. (fn LIST-OF-EDGES-OR-POS OFFSET &optional OPPOSITE-DIRECTION-P) (defalias 'pdf-util-translate #[770 "@<\211\204 C\262\203@[\202@\203!A[\202#A\300\301\302#\"\2031\207\211@\207" [mapcar make-closure #[257 "\211A:\203\211@\300\\A@\301\\\3028\300\\\3038\301\\F\207\211@\300\\A\301\\B\207" [V0 V1 2 3] 6 "\n\n(fn EDGES)"]] 11 (#$ . 5595)]) #@354 Translate ELTS according to REGION. ELTS may be one edges list or a position or a list thereof. Translate each from region coordinates to (0 0 1 1) or the opposite, if TO-REGION-P is non-nil. All coordinates should be relative. Returns the translated list of elements or the single one depending on the input. (fn REGION ELTS &optional TO-REGION-P) (defalias 'pdf-util-edges-transform #[770 "\205.\242:\211\204C\262\204\202 \300\301\302#\"\203(\211\202*\211@\262\262\207" [mapcar make-closure #[257 "\211A\247\211\203@A@AF\262\302\303\301\203U@\300@Z\304\3008\300@Z\245A@\300A@Z\305\3008\300A@Z\245\3048\300@Z\304\3008\300@Z\245\3058\300A@Z\305\3008\300A@Z\245F\202\217@\304\3008\300@Z_\300@\\A@\305\3008\300A@Z_\300A@\\\3048\304\3008\300@Z_\300@\\\3058\305\3008\300A@Z_\300A@\\F\"\203\233\211@A@B\207\207" [V0 V1 mapcar #[257 "\300\301]^\207" [1.0 0.0] 4 "\n\n(fn N)"] 2 3] 10 "\n\n(fn EDGES)"]] 9 (#$ . 6206)]) #@294 Provide some convenient macros for the edges in LIST-OF-EDGES. LIST-OF-EDGES should be a list of variables (X ...), each one holding a list of edges. Inside BODY the symbols X-left, X-top, X-right, X-bot, X-width and X-height expand to their respective values. (fn LIST-OF-EDGES &rest BODY) (defalias 'pdf-util-with-edges '(macro . #[385 "\300\301\"\204 \302\303!\210\304\305\"\306\307\310\311\304\312\"\"BB!\207" [cl-every symbolp error "Argument should be a list of symbols" mapcar #[257 "\211\300\301\302\"\303\"B\207" [mapcar make-closure #[257 "\301\302\303\300#!\207" [V0 intern format "%s-%s"] 6 "\n\n(fn KIND)"] (left top right bot width height)] 6 "\n\n(fn EDGE)"] macroexpand-all cl-symbol-macrolet apply nconc #[257 "\211@A\211A\262\242\300\301ED\211A\262\242\300\302ED\211A\262\242\300\303ED\211A\262\242\300\304ED\211A\262\242\305\300\303 E\300\301\nEED\211A\262\242\305\300\304\nE\300\302 EED\257\207" [nth 0 1 2 3 -] 14 "\n\n(fn EDGE-SYMS)"]] 10 (#$ . 7176)])) (byte-code "\300\301\302\303#\304\301\305\306#\207" [function-put pdf-util-with-edges lisp-indent-function 1 put edebug-form-spec (sexp &rest form)] 5) #@118 Return the visible region of the image in WINDOW. Returns a list of pixel edges. (fn &optional WINDOW DISPLAYED-P) (defalias 'pdf-util-image-displayed-edges #[512 "\300 \210\301!\302\"\203\303\202\304!\305!\306\307!!_\310\311\"@\\A\\@\312 8 @Z\\^A\313\n8\nA@Z\\^\314\315F\"\207" [pdf-util-assert-pdf-window window-inside-pixel-edges pdf-view-image-size (0 . 0) pdf-view-image-offset window-hscroll frame-char-width window-frame window-vscroll t 2 3 mapcar round] 17 (#$ . 8345)]) #@409 Return the amount of scrolling nescessary, to make image EDGES visible. Scroll as little as necessary. Unless EAGER-P is non-nil, in which case scroll as much as possible. Keep CONTEXT-PIXEL pixel of the image visible at the bottom and top of the window. CONTEXT-PIXEL defaults to 0. Return the required hscroll in columns or nil, if scrolling is not needed. (fn EDGES &optional EAGER-P CONTEXT-PIXEL) (defalias 'pdf-util-required-hscroll #[769 "\300 \210\211\204\n\301\262\302 \303\304!@\305 \306 _\307\310 \304#\211@Z\3118\\W\203G\312\301 \203@\311 8 @ZZ\202A]\305 \245!\207^\3118@Z\\V\205{\312\3118@ZZ \203l\202v\311 8 @ZZ^\305 \245!\207" [pdf-util-assert-pdf-window 0 window-inside-pixel-edges pdf-view-image-size t frame-char-width window-hscroll pdf-util-translate pdf-view-image-offset 2 round] 14 (#$ . 8865)]) #@462 Return the amount of scrolling nescessary, to make image EDGES visible. Scroll as little as necessary. Unless EAGER-P is non-nil, in which case scroll as much as possible. Keep CONTEXT-PIXEL pixel of the image visible at the bottom and top of the window. CONTEXT-PIXEL defaults to an equivalent pixel value of `next-screen-context-lines'. Return the required vscroll in lines or nil, if scrolling is not needed. (fn EDGES &optional EAGER-P CONTEXT-PIXEL) (defalias 'pdf-util-required-vscroll #[769 "\301 \210\302 \303\304!A\305\306\304\"\307\310 \304#\206\311 _A@Z\3128\\W\203J\313\314\n\203A\312\n8\nA@ZZ\202B]\315\311 !\245!\207^\312 8 A@Z\\V\205\204\313\312 8 A@ZZ\n\203r\202}\312\n8\nA@ZZ^\315\311 !\245!\207" [next-screen-context-lines pdf-util-assert-pdf-window window-inside-pixel-edges pdf-view-image-size t window-vscroll nil pdf-util-translate pdf-view-image-offset frame-char-height 3 round 0 float] 15 (#$ . 9735)]) #@182 Scroll window such that image EDGES are visible. Scroll as little as necessary. Unless EAGER-P is non-nil, in which case scroll as much as possible. (fn EDGES &optional EAGER-P) (defalias 'pdf-util-scroll-to-edges #[513 "\300\"\301\"\203\302!\210\211\205\303!\207" [pdf-util-required-vscroll pdf-util-required-hscroll image-set-window-vscroll image-set-window-hscroll] 6 (#$ . 10713)]) #@37 Base directory for temporary files. (defvar pdf-util--base-directory nil (#$ . 11119)) #@52 The relative name of buffer's dedicated directory. (defvar pdf-util--dedicated-directory nil (#$ . 11212)) (make-variable-buffer-local 'pdf-util--dedicated-directory) #@181 Return the name of a existing dedicated directory. The directory is exclusive to the current buffer. It will be automatically deleted, if Emacs or the current buffer are killed. (defalias 'pdf-util-dedicated-directory #[0 "\304 \305\306\"\216\307\310!\210\203\311!\203\312!\203%\313\314\315\"\210\316\317\320\" \2035\311 !\2035\312!\203Q\316 \203B\321 !\202D\322 \323P\320\"\313\324\325\326\320$\210) )\207" [pdf-util--base-directory pdf-util--dedicated-directory temporary-file-directory buffer-file-name default-file-modes make-closure #[0 "\301\300!\207" [V0 set-default-file-modes] 2] set-default-file-modes 448 file-directory-p file-symlink-p add-hook kill-emacs-hook #[0 "\205\301!\205\302\303\"\207" [pdf-util--base-directory file-directory-p delete-directory t] 3] make-temp-file "pdf-tools-" t file-name-nondirectory buffer-name "-" kill-buffer-hook pdf-util-delete-dedicated-directory nil] 6 (#$ . 11386)]) #@46 Delete current buffer's dedicated directory. (defalias 'pdf-util-delete-dedicated-directory #[0 "\300\301 \302\"\207" [delete-directory pdf-util-dedicated-directory t] 3 (#$ . 12337)]) #@74 Expand filename against current buffer's dedicated directory. (fn NAME) (defalias 'pdf-util-expand-file-name #[257 "\300\301 \"\207" [expand-file-name pdf-util-dedicated-directory] 4 (#$ . 12528)]) #@146 Create a temporary file in current buffer's dedicated directory. See `make-temp-file' for the arguments. (fn PREFIX &optional DIR-FLAG SUFFIX) (defalias 'pdf-util-make-temp-file #[769 "\301 \302#)\207" [temporary-file-directory pdf-util-dedicated-directory make-temp-file] 7 (#$ . 12735)]) #@61 Execute BODY only if debugging is enabled. (fn &rest BODY) (defalias 'pdf-util-debug '(macro . #[128 "\300\301BB\207" [when (bound-and-true-p pdf-tools-debug)] 4 (#$ . 13037)])) (byte-code "\300\301\302\303#\304\301\305\306#\207" [function-put pdf-util-debug lisp-indent-function 0 put edebug-form-spec t] 5) #@25 (fn &optional BUFFER) (defalias 'pdf-util-pdf-buffer-p #[256 "\211\203\n\300!\205r\211\203\211q\210\301\302!)\207" [buffer-live-p derived-mode-p pdf-view-mode] 3 (#$ . 13354)]) #@25 (fn &optional BUFFER) (defalias 'pdf-util-assert-pdf-buffer #[256 "\300!?\205\n\301\302!\207" [pdf-util-pdf-buffer-p error "Buffer is not in PDFView mode"] 3 (#$ . 13545)]) #@25 (fn &optional WINDOW) (defalias 'pdf-util-pdf-window-p #[256 "\211\203\300!\204\301\302\300D\"\210\211\204\303 \262\300!\2053\304!r\305\306\"\216\307@\310\"\210\311 *\262\207" [window-live-p signal wrong-type-argument selected-window internal--before-with-selected-window make-closure #[0 "\301\300!\207" [V0 internal--after-with-selected-window] 2] select-window norecord pdf-util-pdf-buffer-p] 5 (#$ . 13728)]) #@25 (fn &optional WINDOW) (defalias 'pdf-util-assert-pdf-window #[256 "\300!?\205\n\301\302!\207" [pdf-util-pdf-window-p error "Window's buffer is not in PdfView mode"] 3 (#$ . 14164)]) #@160 Read contents from FILENAME and delete it. Return the file's content as a unibyte string, unless MULTIBYTE-P is non-nil. (fn FILENAME &optional MULTIBYTE-P) (defalias 'pdf-util-munch-file #[513 "\300\301\"\216\302\303\304\"r\211q\210\300\305\"\216\306!\210\307!\210\310ed\"*\262)\207" [make-closure #[0 "\300\205 \301\300!\205 \302\300!\207" [V0 file-exists-p delete-file] 2] generate-new-buffer " *temp*" t #[0 "\301\300!\205 \302\300!\207" [V0 buffer-name kill-buffer] 2] set-buffer-multibyte insert-file-contents-literally buffer-substring-no-properties] 6 (#$ . 14357)]) #@80 Return COLOR in hex-format. Singal an error, if color is invalid. (fn COLOR) (defalias 'pdf-util-hexcolor #[257 "\300\301\"\203\207\302!\211\204\303\304\305D\"\210\306\307\310\311\312\"#\207" [string-match "\\`#[[:xdigit:]]\\{6\\}\\'" color-values signal wrong-type-argument color-defined-p apply format "#%02x%02x%02x" mapcar #[257 "\300\301\"\207" [lsh -8] 4 "\n\n(fn C)"]] 8 (#$ . 14948)]) #@165 Highlight all occurrences of REGEXP in STRING using FACE. FACE defaults to the `match' face. Returns the new fontified string. (fn REGEXP STRING &optional FACE) (defalias 'pdf-util-highlight-regexp-in-string #[770 "\300\301\302\"r\211q\210\303\304\"\216\212c\210)m\204;\305\306\302#\203;\307\224\307\225U\203,\306u\210\202\310\307\224`\311\2066\312$\210\202\313 *\207" [generate-new-buffer " *temp*" t make-closure #[0 "\301\300!\205 \302\300!\207" [V0 buffer-name kill-buffer] 2] re-search-forward nil 0 put-text-property face match buffer-string] 9 (#$ . 15359)]) #@44 Return a fontified list of defined colors. (defalias 'pdf-util-color-completions #[0 "\300 \301\211\203-\211@\302!\211\203%\211@\303\304\305D#B\262A\266\202\202 \210A\266\202\202\210\211\237\207" [list-colors-duplicates nil reverse propertize face :background] 11 (#$ . 15947)]) #@34 (fn TEXT X Y &optional WINDOW) (defalias 'pdf-util-tooltip-in-window #[1027 "\301!\302@\\!\302A@\\!\303B\304BBB\305!)\207" [tooltip-frame-parameters window-inside-absolute-pixel-edges round left top tooltip-show] 10 (#$ . 16245)]) #@36 (fn IMAGE-TOP &optional TIMEOUT) (defalias 'pdf-util-tooltip-arrow #[513 "\305 \210\306!\203\307\310 A_!\262\311\312 @\206\313\314 @\\\315\316 _\\F\317!\320\321 BB\2068\322\211\203A\323!\210\313\324\325 A\326\311\327\"\316 $]\262\330\331\332\311\"\333\"\203q\334 \3158@Z\310\327!@Z\315\245\\\262\266\335\336\337\340\336\341\340\342\343\344\345\346\347\303!\203\214 \203\214\fA\202\215\350F%##+\207" [x-gtk-use-system-tooltips tooltip-frame-parameters tooltip-hide-delay pdf-view-midnight-minor-mode pdf-view-midnight-colors pdf-util-assert-pdf-window floatp round pdf-view-image-size nil window-margins 0 window-fringes 2 frame-char-height pdf-util-required-vscroll (border-width . 0) (internal-border-width . 0) 3 image-set-window-vscroll - pdf-view-image-offset window-vscroll t overlay-get image-mode-window-get overlay before-string window-inside-pixel-edges pdf-util-tooltip-in-window propertize " " display "→" (height 2) face :foreground "orange red" :background boundp "white"] 20 (#$ . 16495)]) (defvar pdf-util--face-colors-cache (make-hash-table)) (byte-code "\300\301\302\303\304$\210\305\301\304\"\207" [ad-add-advice enable-theme (pdf-util-clear-faces-cache nil t (advice lambda nil (clrhash pdf-util--face-colors-cache))) after nil ad-activate] 5) #@158 Return both colors of FACE as a cons. Look also in inherited faces. If DARK-P is non-nil, return dark colors, otherwise light. (fn FACE &optional DARK-P) (defalias 'pdf-util-face-colors #[513 "\211\203\302\202 \303\304N\305N\306NE\307\"\211\211A\262\242\211A\262\242\2033\310\311\312\313G\\D\"\210\211\203D\232\203D\236A\206\231\314\315\316\"=?\205V\317\320!\321 p\322\323#\216\324\206f\321 \325\"\210\322\326\"\216\327\f\330\315\331$\327 \332\315\331$B\333 \334\335 \" B BD#\210\211\262*\266\202)\266\202\207" [pdf-util--face-colors-cache frame-background-mode dark light face-defface-spec theme-face customized-face gethash signal wrong-number-of-arguments (&optional cspec color-alist) 2 frame-parameter nil background-mode x-create-frame-with-faces ((visibility)) selected-frame make-closure #[0 "\302\300!\203 \303\300\304\"\210\305\301!\205\301q\207" [V0 V1 frame-live-p select-frame norecord buffer-live-p] 3] select-frame norecord #[0 "\300\205 \301\300!\205 \302\300!\207" [V0 frame-live-p delete-frame] 2] face-attribute :foreground default :background puthash mapcar copy-sequence] 18 (#$ . 17803)]) #@268 Attach AWINDOW to WINDOW. This has the following effect. Whenever WINDOW, defaulting to the selected window, stops displaying the buffer it currently displays (e.g., by switching buffers or because it was deleted) AWINDOW is deleted. (fn AWINDOW &optional WINDOW) (defalias 'pdf-util-window-attach #[513 "\211C\211\242\204\f\211\300 \240\210\301\242!\302\303!\211\304\305%M\210\306\307\"\207" [selected-window window-buffer make-symbol "window-attach-hook" make-closure #[0 "\304\301\242!\203\302\305\301\242!=?\205\306\307\303\"\210\310\311\312\313\300$\207" [V0 V1 V2 V3 window-live-p window-buffer remove-hook window-configuration-change-hook run-with-timer 0 nil #[257 "\300!\205\211\301 =?\205\302!\207" [window-live-p selected-window delete-window] 3 "\n\n(fn WIN)"]] 5] add-hook window-configuration-change-hook] 12 (#$ . 18973)]) #@71 Display buffer action using `pdf-util-window-attach'. (fn BUF ALIST) (defalias 'display-buffer-split-below-and-attach #[514 "\302 \303\236A\304\203\305!\203\306\307 _!\262][\262\310\311!\312 %\262\313\"\210\207" [window-min-height display-buffer-mark-dedicated selected-window window-height nil floatp round frame-height window--display-buffer split-window-below window pdf-util-window-attach] 11 (#$ . 19841)]) #@162 Goto LINE and COLUMN in the current buffer. COLUMN defaults to 0. Widen the buffer, if the position is outside the current limits. (fn LINE &optional COLUMN) (defalias 'pdf-util-goto-position #[513 "\300V\205%\212\214~\210\301b\210Sy\300U\205$\211\203#\211\300V\203#\211Su\210`*\211\2059\211eW\2045\211dV\2037~\210\211b\207" [0 1] 5 (#$ . 20280)]) #@1043 Return an alignment of sequences SEQ1 and SEQ2. SIMILARITY-FN should be a function. It is called with two arguments: One element from SEQ1 and one from SEQ2. It should return a number determining how similar the elements are, where higher values mean `more similar'. The default returns 1 if the elements are equal, else -1. ALIGNMENT-TYPE may be one of the symbols `prefix', `suffix', `infix' or nil. If it is `prefix', trailing elements in SEQ2 may be ignored. For example the alignment of (0 1) and (0 1 2) using prefix matching is 0, since the prefixes are equal and the trailing 2 is ignored. The other possible values have similar effects. The default is nil, which means to match the whole sequences. Return a cons (VALUE . ALINGMENT), where VALUE says how similar the sequences are and ALINGMENT is a list of (E1 . E2), where E1 is an element from SEQ1 or nil, likewise for E2. If one of them is nil, it means there is gap at this position in the respective sequence. (fn SEQ1 SEQ2 &optional SIMILARITY-FN ALIGNMENT-TYPE) (defalias 'pdf-util-seq-alignment #[1026 "\300GG\301\302\303T\300X\203\"\304T\300\"B\262T\262\202 \211\237\266\203\"\305>\306>\2063\307\310X\203KH\310[I\210T\262\2026\266\310X\203l\310H\203a\310\202c[I\210T\262\202O\266\303X\203\324\303X\203\313SHHSHSH\203\237\fU\203\237\310\202\240\311\\]SHSHS\234S\234\"\\]HI\266T\262\202z\266T\262\202q\266\300\310V\204\345\310V\203\206\310V\203HHSHHSU\203S\262 \234\nBB\262\202\331\310V\203UHHHSH\310U\203-\2049 U\203=\203=\310\202>\311\\U\203US\262  \234BB\262\202\331\310V\203a\310V\204n\312\313\300\310V\310VD\300$\210S\262S\262 \234 \234BB\262\202\331 HHB\207" [nil apply vector 1 make-vector (prefix infix) (suffix infix) #[514 "\232\203\300\207\301\207" [1 -1] 4 "\n\n(fn A B)"] 0 -1 cl--assertion-failed (and (> i 0) (> j 0))] 21 (#$ . 20648)]) #@73 Escape STRING for use as a PCRE. See also `regexp-quote'. (fn STRING) (defalias 'pdf-util-pcre-quote #[257 "\300\301\302\"\302\211\203$\211@\211>\203\303B\262\211B\262A\266\202\202\210\304\305\237\"\207" [(0 92 124 40 41 91 93 123 125 94 36 42 43 63 46) append nil 92 apply string] 8 (#$ . 22668)]) (byte-code "\300\301\302\303\304DD\305\306\307\310\311&\210\300\312\302\303\313DD\314\306\307\310\315&\207" [custom-declare-variable pdf-util-convert-program funcall function #[0 "\301>?\205\n\302\303!\207" [system-type (ms-dos windows-nt) executable-find "convert"] 2] "Absolute path to the convert program." :group pdf-tools :type executable pdf-util-fast-image-format #[0 "\300\207" [nil] 1] "An image format appropriate for fast displaying.\n\nThis should be a cons (TYPE . EXT) where type is the Emacs\nimage-type and EXT the appropriate file extension starting with a\ndot. If nil, the value is determined automatically.\n\nDifferent formats have different properties, with respect to\nEmacs loading time, convert creation time and the file-size. In\ngeneral, uncompressed formats are faster, but may need a fair\namount of (temporary) disk space." (cons symbol string)] 8) (defalias 'pdf-util-assert-convert-program #[0 "\205\301!?\205\302\303!\207" [pdf-util-convert-program file-executable-p error "The pdf-util-convert-program is unset or non-executable"] 2]) #@99 Determine the size of the image in IMAGE-FILE. Returns a cons (WIDTH . HEIGHT). (fn IMAGE-FILE) (defalias 'pdf-util-image-file-size #[257 "\302 \210\303\304\305\"r\211q\210\306\307\"\216\212\310\311p\311\312\313\314&\315U)\205+p\316 \316 )B*\207" [pdf-util-convert-program standard-input pdf-util-assert-convert-program generate-new-buffer " *temp*" t make-closure #[0 "\301\300!\205 \302\300!\207" [V0 buffer-name kill-buffer] 2] call-process nil "-format" "%w %h" "info:" 0 read] 11 (#$ . 24070)]) #@2226 Convert image IN-FILE to OUT-FILE according to SPEC. IN-FILE should be the name of a file containing an image. Write the result to OUT-FILE. The extension of this filename ususally determines the resulting image-type. SPEC is a property list, specifying what the convert programm should do with the image. All manipulations operate on a rectangle, see below. SPEC may contain the following keys, respectively values. `:foreground' Set foreground color for all following operations. `:background' Dito, for the background color. `:commands' A list of strings representing arguments to convert for image manipulations. It may contain %-escape characters, as follows. %f -- Expands to the foreground color. %b -- Expands to the background color. %g -- Expands to the geometry of the current rectangle, i.e. WxH+X+Y. %x -- Expands to the left edge of rectangle. %X -- Expands to the right edge of rectangle. %y -- Expands to the top edge of rectangle. %Y -- Expands to the bottom edge of rectangle. %w -- Expands to the width of rectangle. %h -- Expands to the height of rectangle. Keep in mind, that every element of this list is seen by convert as a single argument. `:formats' An alist of additional %-escapes. Every element should be a cons (CHAR . STRING) or (CHAR . FUNCTION). In the first case, all occurences of %-CHAR in the above commands will be replaced by STRING. In the second case FUNCTION is called with the current rectangle and it should return the replacement string. `:apply' A list of rectangles ((LEFT TOP RIGHT BOT) ...) in IN-FILE coordinates. Each such rectangle triggers one execution of the last commands given earlier in SPEC. E.g. a call like (pdf-util-convert image-file out-file :foreground "black" :background "white" :commands '("-fill" "%f" "-draw" "rectangle %x,%y,%X,%Y") :apply '((0 0 10 10) (10 10 20 20)) :commands '("-fill" "%b" "-draw" "rectangle %x,%y,%X,%Y") :apply '((10 0 20 10) (0 10 10 20))) would draw a 4x4 checkerboard pattern in the left corner of the image, while leaving the rest of it as it was. Returns OUT-FILE. See url `http://www.imagemagick.org/script/convert.php'. (fn IN-FILE OUT-FILE &rest SPEC) (defalias 'pdf-util-convert #[642 "\301 \210\302!\303\304\305\306\307!\305 \310 C\"B&\211\247\203%\211\311U\204*\312\313\"\210\207" [pdf-util-convert-program pdf-util-assert-convert-program pdf-util-convert--create-commands apply call-process nil get-buffer-create "*pdf-util-convert-output*" append 0 error "The convert program exited with error status: %s"] 14 (#$ . 24588)]) #@199 Like `pdf-util-convert', but asynchronous. If the last argument is a function, it is installed as the process sentinel. Returns the convert process. (fn IN-FILE OUT-FILE &rest SPEC-AND-CALLBACK) (defalias 'pdf-util-convert-asynch #[642 "\301 \210\302!@\303\304!\203\305!\262\202\262\303\262\306!\307\310\311\312\313!\n\314\fC\"B%\203:\315\"\210\207" [pdf-util-convert-program pdf-util-assert-convert-program last nil functionp butlast pdf-util-convert--create-commands apply start-process "pdf-util-convert" get-buffer-create "*pdf-util-convert-output*" append set-process-sentinel] 15 (#$ . 27209)]) #@144 Convert image of current page according to SPECS. Return the converted PNG image as a string. See also `pdf-util-convert'. (fn &rest SPECS) (defalias 'pdf-util-convert-page #[128 "\300 \210\301\302\303\304#\301\302\303\304#\305\306#\216\307\310\311\303\"A\312\"\313\314\315\"\305\316\"\216r\211q\210\317\303!\210\320\321!\210c\210)r\211q\210\322\303\211\303\323%\210*\266\324\325\326$!\262)\207" [pdf-util-assert-pdf-window make-temp-file "pdf-util-convert" nil ".png" make-closure #[0 "\302\300!\203\n\303\300!\210\302\301!\205\303\301!\207" [V0 V1 file-exists-p delete-file] 2] plist-get image-mode-window-get image :data generate-new-buffer " *temp file*" t #[0 "\301\300!\205 \302\300!\207" [V0 buffer-name kill-buffer] 2] set-buffer-multibyte set-buffer-file-coding-system binary write-region 0 pdf-util-munch-file apply pdf-util-convert] 12 (#$ . 27841)]) #@13 (fn SPEC) (defalias 'pdf-util-convert--create-commands #[257 "\300\211\301\211\211\211\211A\262\242\211\262\203\352\204 \302\303 B\"\210\211\304\267\202\211A\262\242\262\202\211A\262\242\262\202\211A\262\242\262\202\305\211A\262\n\242\301#\262\202\211A\262\242\211\203\343\211@\305\306\307\310\"\"\311\312\313\3148@Z\3158A@Z@A@%B\316@B\317\3148B\320A@B\321\3158B\322\314 8 @ZB\323\315\n8\nA@ZB\324B\325B\257 \"\211\203\332\211@\326\"B\262A\266\202\202\304\266A\266\202\202a\210\202\202\237\207" ["red" nil error "Missing value in convert spec:%s" #s(hash-table size 5 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (:foreground 38 :background 50 :commands 62 :formats 74 :apply 90)) append mapcar make-closure #[257 "\211@A;\203 A\202A\300!B\207" [V0] 4 "\n\n(fn F)"] 103 format "%dx%d+%d+%d" 2 3 120 88 121 89 119 104 102 98 format-spec] 21 (#$ . 28728)]) #@132 Return non-nil, if OBJ look like edges. If RELATIVE-P is non-nil, also check that all values <= 1. (fn OBJ &optional RELATIVE-P) (defalias 'pdf-util-edges-p #[513 ":\205\3001G\301U0\202\210\302\207\205\303\304\305\"\"\207" [(error) 4 nil cl-every make-closure #[257 "\211\247\205\211\301Y\205\300?\206\211\302X\207" [V0 0 1] 3 "\n\n(fn X)"]] 6 (#$ . 29704)]) #@53 Return non-nil, if EDGES area is empty. (fn EDGES) (defalias 'pdf-util-edges-empty-p #[257 "\3008@Z\301X\206\3028A@Z\301X\207" [2 0 3] 3 (#$ . 30089)]) #@36 (fn EDGES POS &optional EPSILON) (defalias 'pdf-util-edges-inside-p #[770 "\300@A@AF#\207" [pdf-util-edges-contained-p] 9 (#$ . 30254)]) #@42 (fn EDGES CONTAINED &optional EPSILON) (defalias 'pdf-util-edges-contained-p #[770 "\211\204\300\262@Z@X\2052\3018\\\3018Y\2052A@ZA@X\2052\3028\\\3028Y\207" [0 2 3] 6 (#$ . 30406)]) #@14 (fn E1 E2) (defalias 'pdf-util-edges-intersection #[514 "@@]A@A@]\3008\3008^\3018\3018^X\205+X\205+F\207" [2 3] 10 (#$ . 30614)]) #@20 (fn &rest EDGES) (defalias 'pdf-util-edges-union #[128 "\211A\204\211@\207\300\301\302\303\"\"\300\301\302\304\"\"\300\305\302\306\"\"\300\305\302\307\"\"F\207" [apply min mapcar car cadr max cl-caddr cl-cadddr] 9 (#$ . 30770)]) #@14 (fn E1 E2) (defalias 'pdf-util-edges-intersection-area #[514 "\300\"\211\204\n\301\207\3028@Z\3038A@Z_\207" [pdf-util-edges-intersection 0 2 3] 6 (#$ . 31015)]) #@85 Read a image position using prompt. Return the event position object. (fn PROMPT) (defalias 'pdf-util-read-image-position #[257 "\300 r\301\302\"\216\303\304\305\306#!p\307!\204\310\311!\210\312!\313\211@\262!=\203>\211\211\3148\262\2066\315!\262\242\316=\204B\310\317!\210\211\262\266\202*\207" [internal--before-save-selected-window make-closure #[0 "\301\300!\207" [V0 internal--after-save-selected-window] 2] pdf-util-read-click-event propertize face minibuffer-prompt mouse-event-p error "Not a mouse event" event-start window-buffer 7 posn-string image "Invalid image position"] 9 (#$ . 31191)]) #@33 (fn &optional PROMPT SECONDS) (defalias 'pdf-util-read-click-event #[512 "\300\"\301!\203\302!\303\232\204\304\305!\210\300\"\301!\203(\302!\306\232\204,\304\305!\210\207" [read-event mouse-event-p event-modifiers (down) error "No a mouse click event" (click)] 6 (#$ . 31818)]) #@58 Set POS-OR-AREA in EVENT to 1 and unread it. (fn EVENT) (defalias 'pdf-util-image-map-mouse-event-proxy #[257 "\211A@A\301\240\210\211C\211\207" [unread-command-events 1] 3 (#$ . 32118) "e"]) #@29 (fn ID &optional BUTTONS) (defalias 'pdf-util-image-map-divert-mouse-clicks #[513 "\300\211\2052\211@\206\f\301\211\203*\211@\302\303\304\305\306#!\"\307\"\210A\266\202\202\f\210A\266\202\202\207" [("" "down-" "drag-") (2 3 4 5 6) local-set-key vector intern format "%smouse-%d" pdf-util-image-map-mouse-event-proxy] 14 (#$ . 32318)]) #@275 Read EVENTs while CONDITION executing BODY. Process at most 1/RESOLUTION events per second. If UNREAD-p is non-nil, unread the final non-processed event. (FN (EVENT RESOLUTION &optional UNREAD-p) CONDITION &rest BODY) (fn EVENT-RESOLUTION-UNREAD-P CONDITION &rest BODY) (defalias 'pdf-util-do-events '(macro . #[642 "\211A\203\211A\262\242\202\300\301\302GD\"\211A\262\242\211A\262\242\2031\300\301\302\303G\\D\"\210\304\305!\304\306!\304\307!\304\310!\304\311!\312D D\313B\314B\315\316\317\320\321\320\322BBBBE\323\324E\325BBFD \326B\257\327 \317\330\331 D\332BB\333B\321\334BB\331 \nE\257\321 \335\336\337\211\340\341\342\331DEEFEEF\317\340 E\321\343\344\343\345DEEEF\207" [signal wrong-number-of-arguments (event resolution &optional unread-p) 3 make-symbol "seconds" "timestamp" "clock" "unread-p" "resolution" let* (0) ((float-time)) lambda (&optional secs) when secs setq ((float-time)) - + ((float-time)) ((read-event)) while <= funcall (0) progn (nil) or read-event nil and max 0 unread-command-events append list] 29 (#$ . 32677)])) (byte-code "\300\301\302\303#\304\301\305\306#\207" [function-put pdf-util-do-events lisp-indent-function 2 put edebug-form-spec ((symbolp form &optional form) form body)] 5) #@376 Read mouse movement events executing BODY. See also `pdf-util-do-events'. This macro should be used inside a command bound to a down-mouse event. It evaluates to t, if at least one event was processed in BODY, otherwise nil. In the latter case, the only event (usually a mouse click event) is unread. (FN (EVENT RESOLUTION) &rest BODY) (fn EVENT-RESOLUTION &rest BODY) (defalias 'pdf-util-track-mouse-dragging '(macro . #[385 "\300\301!\302C\303\304\305\306\"\307@D\310\311BBBBBBD\312\313\314BB\315BB\257\207" [make-symbol "ran-once-p" let track-mouse pdf-util-do-events append (t) mouse-movement-p setq (t) when and (unread-command-events) ((setq unread-command-events (butlast unread-command-events)))] 12 (#$ . 33963)])) (byte-code "\300\301\302\303#\304\301\305\306#\207" [function-put pdf-util-track-mouse-dragging lisp-indent-function 1 put edebug-form-spec ((symbolp form) body)] 5) #@62 Remove duplicates from LIST stably using `equal'. (fn LIST) (defalias 'pdf-util-remove-duplicates #[257 "\300\301\302\"\303\211\203&\211@\304\"\204\211B\262\305\306#\210A\266\202\202\237\207" [make-hash-table :test equal nil gethash puthash t] 9 (#$ . 34877)]) (provide 'pdf-util)