;ELC ;;; Compiled ;;; in Emacs version 28.0.50 ;;; with all optimizations. (byte-code "\300\301!\210\300\302!\210\300\303!\210\300\304!\210\300\305!\210\300\306!\210\300\307!\210\310\311\312\313\314\315%\210\316\317\320\321\314\322%\210\323\324\325\326\327DD\330\314\311\331\332\333\334\333\335& \210\323\336\325\326\337DD\340\314\311\331\341&\210\323\342\325\326\343DD\344\314\311\331\326&\207" [require pdf-info pdf-util pdf-misc pdf-cache pdf-isearch let-alist org custom-declare-group pdf-links nil "Following links in PDF documents." :group pdf-tools custom-declare-face pdf-links-read-link ((((background dark)) (:background "red" :foreground "yellow")) (((background light)) (:background "red" :foreground "yellow"))) "Face used to determine the colors when reading links." pdf-tools-faces custom-declare-variable pdf-links-read-link-convert-commands funcall function #[0 "\300\207" [("-pointsize" "%P" "-undercolor" "%f" "-fill" "%b" "-draw" "text %X,%Y '%c'")] 1] "The commands for the convert program, when decorating links for reading.\nSee `pdf-util-convert' for an explanation of the format.\n\nAside from the description there, two additional escape chars are\navailable.\n\n%P -- The scaled font pointsize, i.e. IMAGE-WIDTH * SCALE (See\n `pdf-links-convert-pointsize-scale').\n%c -- String describing the current link key (e.g. AA, AB,\n etc.)." :type (repeat string) :link (variable-link pdf-isearch-convert-commands) (url-link "http://www.imagemagick.org/script/convert.php") pdf-links-convert-pointsize-scale #[0 "\300\207" [0.01] 1] "The scale factor for the -pointsize convert command.\n\nThis determines the relative size of the font, when interactively\nreading links." (restricted-sexp :match-alternatives ((lambda (x) (and (numberp x) (<= x 1) (>= x 0))))) pdf-links-browse-uri-function #[0 "\300\207" [pdf-links-browse-uri-default] 1] "The function for handling uri links.\n\nThis function should accept one argument, the URI to follow, and\ndo something with it."] 12) (defvar pdf-links-minor-mode-map (byte-code "\300 \301\302\303#\210\301\304\305#\210\207" [make-sparse-keymap define-key "f" pdf-links-isearch-link "F" pdf-links-action-perform] 5)) #@109 Non-nil if Pdf-Links minor mode is enabled. Use the command `pdf-links-minor-mode' to change this variable. (defvar pdf-links-minor-mode nil (#$ . 2195)) (make-variable-buffer-local 'pdf-links-minor-mode) #@894 Handle links in PDF documents.\ This is a minor mode. If called interactively, toggle the `Pdf-Links minor mode' mode. If the prefix argument is positive, enable the mode, and if it is zero or negative, disable the mode. If called from Lisp, toggle the mode if ARG is `toggle'. Enable the mode if ARG is nil, omitted, or is a positive number. Disable the mode if ARG is a negative number. To check whether the minor mode is enabled in the current buffer, evaluate `pdf-links-minor-mode'. The mode's hook is called both when the mode is enabled and when it is disabled. If this mode is enabled, most links in the document may be activated by clicking on them or by pressing \[pdf-links-action-perform] and selecting one of the displayed keys, or by using isearch limited to links via \[pdf-links-isearch-link]. \{pdf-links-minor-mode-map} (fn &optional ARG) (defalias 'pdf-links-minor-mode #[256 "\302 \303=\203 ?\202\247\203\304W\203\305\202\306\307\301!\2031\310\300 \"\2031\300 B\311 \210\203@\312\313\314\"\210\202D\315\313!\210\316\306!\210\317\320\203R\321\202S\322\"\210\323\324!\203u\302 \203g\211\302 \232\203u\325\326\203q\327\202r\330\331#\210\210\332 \210\207" [pdf-links-minor-mode local-minor-modes current-message toggle 1 nil t boundp delq pdf-util-assert-pdf-buffer pdf-view-add-hotspot-function pdf-links-hotspots-function 0 pdf-view-remove-hotspot-function pdf-view-redisplay run-hooks pdf-links-minor-mode-hook pdf-links-minor-mode-on-hook pdf-links-minor-mode-off-hook called-interactively-p any message "Pdf-Links minor mode %sabled%s" "en" "dis" " in current buffer" force-mode-line-update] 6 (#$ . 2407) (byte-code "\203\n\301!\202 \302C\207" [current-prefix-arg prefix-numeric-value toggle] 2)]) (defvar pdf-links-minor-mode-hook nil) (byte-code "\301\302N\204\f\303\301\302\304#\210\303\301\305\306#\210\303\301\307\310C#\210\311\312\310\313\300!\205#\310\211%\207" [pdf-links-minor-mode-map pdf-links-minor-mode-hook variable-documentation put "Hook run after entering or leaving `pdf-links-minor-mode'.\nNo problems result if this variable is not bound.\n`add-hook' automatically binds it. (This is true for all hook variables.)" custom-type hook standard-value nil add-minor-mode pdf-links-minor-mode boundp] 6) #@63 Create hotspots for links on PAGE using SIZE. (fn PAGE SIZE) (defalias 'pdf-links-hotspots-function #[514 "\300!\301\302\303\304\211\203`\211@\305\306\236A \307#\310\311\f T\211\262 #!\312@A@B\3138\3148BBB\315\316\317!FEB\262\320\321\322\"\323\324\"\"\210\320\321\325\"\326\"\266A\266\202\202\210\211\237\207" [pdf-cache-pagelinks "link-%d-%d" 0 hand nil pdf-util-scale edges round intern format rect 2 3 pointer help-echo pdf-links-action-to-string local-set-key vector mouse-1 make-closure #[0 "\301\300!\207" [V0 pdf-links-action-perform] 2 nil "@"] t pdf-util-image-map-mouse-event-proxy] 18 (#$ . 4729)]) #@54 Return a string representation of ACTION. (fn LINK) (defalias 'pdf-links-action-to-string #[257 "\211\300\236A\301\236A\302\236A\303\236A\304\236A\305\267\202g\306V\203(\307\310\"\202l\311\202l\203L\312!\203L\307\313\306V\203F\307\314\"\202G\315#\202l\307\316\"\202lG\306V\203a\307\317\"\202l\307\320!\202l\307\321\"G\306V\205w\307\322\"P\207" [type page filename uri title #s(hash-table size 3 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (goto-dest 27 goto-remote 44 uri 83)) 0 format "Goto page %d" "Destination not found" file-exists-p "Goto %sfile '%s'" "p.%d of " "" "Link to nonexistent file '%s'" "Link to uri '%s'" "Link to empty uri" "Unrecognized link type: %s" " (%s)"] 12 (#$ . 5374)]) #@491 Follow LINK, depending on its type. This may turn to another page, switch to another PDF buffer or invoke `pdf-links-browse-uri-function'. Interactively, link is read via `pdf-links-read-link-action'. This function displays characters around the links in the current page and starts reading characters (ignoring case). After a sufficient number of characters have been read, the corresponding link's link is invoked. Additionally, SPC may be used to scroll the current page. (fn LINK) (defalias 'pdf-links-action-perform #[257 "\211\301\236A\302\236A\303\236A\304\236A\305\236A\306\267\202\217\307 C\310\267\202P\311V\204P\312\313!\210\202P\203;\314!\204@\312\315\"\210\211\316\317!\206M\320!!\240\210\321\242!r\322\323\"\216\324@\325\"\210\326\327!\203\201\311V\203q\330!\210\203\201\331\332\333\322\334##\210*\266\202\226!\266\202\226\312\335\"\266\333\207" [pdf-links-browse-uri-function type page filename top uri #s(hash-table size 3 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (goto-dest 27 goto-remote 27 uri 135)) selected-window #s(hash-table size 2 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (goto-dest 36 goto-remote 49)) 0 error "Link points to nowhere" file-exists-p "Link points to nonexistent file %s" display-buffer find-buffer-visiting find-file-noselect internal--before-with-selected-window make-closure #[0 "\301\300!\207" [V0 internal--after-with-selected-window] 2] select-window norecord derived-mode-p pdf-view-mode pdf-view-goto-page run-with-idle-timer 0.001 nil #[0 "\302\301\242!\205#\303\301\242!r\304\305\"\216\306@\307\"\210\310\311!\205 \312\300!*\262\207" [V0 V1 window-live-p internal--before-with-selected-window make-closure #[0 "\301\300!\207" [V0 internal--after-with-selected-window] 2] select-window norecord derived-mode-p pdf-view-mode pdf-util-tooltip-arrow] 4] "Unrecognized link type: %s"] 16 (#$ . 6135) (byte-code "\300\301!\206 \302\303!C\207" [pdf-links-read-link-action "Activate link (SPC scrolls): " error "No link selected"] 2)]) #@113 Using PROMPT, interactively read a link-action. See `pdf-links-action-perform' for the interface. (fn PROMPT) (defalias 'pdf-links-read-link-action #[257 "\303 \210\304\305\306\307\"!\310G!\311\312\313\314\"\"C\315\316#\317 \320\321\"\322@\323A\324\325\326\327 \"B\330\331\332\nA _]!BD\333\n\334\335\311\336\"!\257\n\204O\337\340!\210\341\216\342\305\306\307\"@@\343$\211\204q\313\344\"\262\345\305\306\307\"@\343$\210\346\347\350 \351#!\210\352 \"\262)\207" [pdf-view-dark-minor-mode pdf-links-convert-pointsize-scale pdf-links-read-link-convert-commands pdf-util-assert-pdf-window pdf-cache-pagelinks image-mode-window-get page nil pdf-links-read-link-action--create-keys mapcar apply-partially apply string cl-mapcar cons pdf-view-image-size pdf-util-face-colors pdf-links-read-link :foreground :background :formats 99 make-closure #[257 "\300\242\300\211\242A\240\210\242\207" [V0] 4 "\n\n(fn EDGES)"] 80 number-to-string 1 :commands :apply pdf-util-scale-relative-to-pixel #[257 "\300\236A\207" [edges] 3 "\n\n(fn L)"] error "No links on this page" #[0 "\300 \207" [pdf-view-redisplay] 1] pdf-cache-get-image pdf-links-read-link-action pdf-util-convert-page pdf-cache-put-image pdf-view-display-image create-image pdf-view-image-type t pdf-links-read-link-action--read-chars] 20 (#$ . 8222)]) #@21 (fn PROMPT ALIST) (defalias 'pdf-links-read-link-action--read-chars #[514 "\3002k\301\302\303\304\"\303\305\303\304\"\"\306C#\307\"C\211\242\226\240\210\211\242\306U\2038\310 \311 U\203f\312\310 !\266\202\313\301\303\314\315\"\"\"\262\302\242C\"\262\242CP\262G\316U\203f\317\301!\210\320\300@A\"\210\266\202\207" [done nil append mapcar caar downcase 32 read-char-choice window-vscroll image-scroll-up image-scroll-down delq make-closure #[257 "\300\242@@=\205\211@AAB\207" [V0] 3 "\n\n(fn ELT)"] 1 message throw] 11 (#$ . 9555)]) #@10 (fn N) (defalias 'pdf-links-read-link-action--create-keys #[257 "\211\300V\205M\301\302\303\"!T\304\300\211W\203G\211\304\300\211W\2037\304\303\246\305\\B\262\303\245\262\210\211T\262\202\266\211B\262\266\211T\262\202\266\211\237\266\202\207" [0 floor log 26 nil 65] 12 (#$ . 10126)]) (defalias 'pdf-links-isearch-link #[0 "\306C\307\310\"B\311\312\313\306\314 \210\211\242\206 ??\205L\315\316\306\" @\317 \320\321\307\322\"\323\307\324\"\325!\"\"\307\326\"\"\211\204F\327\330!\210\331@!\266\204-\207" [isearch-mode-end-hook pdf-isearch-filter-matches-function pdf-isearch-narrow-to-page isearch-message-prefix-add pdf-isearch-batch-mode pdf-isearch-current-match nil make-closure #[0 "\300 \240\207" [V0 isearch-mode-end-hook-quit] 2] pdf-links-isearch-link-filter-matches t "(Links)" isearch-forward image-mode-window-get page pdf-view-image-size sort cl-remove-if #[257 "\301@\300\"\302U\207" [V0 pdf-util-edges-intersection-area 0] 4 "\n\n(fn E)"] mapcar #[257 "\301\302\303\"\300\"B\207" [V0 pdf-util-scale alist-get edges] 5 "\n\n(fn L)"] pdf-cache-pagelinks #[514 "\301\302\303\"\300\"\301\302\303\"\300\"V\207" [V0 pdf-util-edges-intersection-area alist-get edges] 7 "\n\n(fn E1 E2)"] error "No link found at this position" pdf-links-action-perform] 11 nil nil]) #@16 (fn MATCHES) (defalias 'pdf-links-isearch-link-filter-matches #[257 "\300\301\302\303\304\"\305\306\307\310\"!\"\311 \"\312\313\314\"\"\207" [pdf-util-scale mapcar apply-partially alist-get edges pdf-cache-pagelinks image-mode-window-get page nil pdf-view-image-size cl-remove-if-not make-closure #[257 "\301\302\303\300\"\"\207" [V0 cl-some make-closure #[257 "\301\302\303\"\300\"\207" [V0 cl-some make-closure #[257 "\3018@Z\3028A@Z_\301\3008\300@Z\302\3008\300A@Z_^\303\300\"\304!\245\305V\207" [V0 2 3 pdf-util-edges-intersection-area float 0.5] 5 "\n\n(fn LINK)"]] 5 "\n\n(fn EDGES)"]] 5 "\n\n(fn M)"]] 8 (#$ . 11452)]) #@133 Open the string URI using Org. Wraps the URI in [[ ... ]] and calls `org-open-link-from-string' on the resulting string. (fn URI) (defalias 'pdf-links-browse-uri-default #[257 "\211;\204 \300\301\302\303E\"\210\304\305\"\210\306\307\310\"!\207" [signal wrong-type-argument string uri message "Opening `%s' with Org" org-open-link-from-string format "[[%s]]"] 6 (#$ . 12097)]) (provide 'pdf-links)