%PDF- %PDF-
Direktori : /usr/local/share/emacs/27.2/lisp/ |
Current File : //usr/local/share/emacs/27.2/lisp/doc-view.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\300\304!\210\305\306\307\310\311\312\313\314\315\316\315\317\315\320\321\322&\210\323\324\325\326\327DD\330\331\332\313\333&\210\323\334\325\326\335DD\336\331\332\313\337&\210\323\340\325\326\341DD\342\313\333\331\343&\210\323\344\325\326\345DD\346\331\347\313\337&\210\323\350\325\326\351DD\352\331\353%\210\323\354\325\326\355DD\356\331\357\313\333&\210\323\360\325\326\361DD\362\331\363%\210\323\364\325\326\365DD\366\313\337\331\367&\210\323\370\325\326\371DD\372\313\373\331\363&\210\323\374\325\326\375DD\376\331\332%\210\323\377\325\326\201@ DD\201A \331\332%\210\201B \201C \201D \307#\210\201E \211\203\372 \211@\201C N\203\363 \201D N\204\363 \201F \201D \201C N#\210A\266\202\202\317 \210\201G \201C \201D \337#\210\323\201D \325\326\201H DD\201I \313\337\331\332&\210\323\201J \325\326\201K DD\201L \331\201M \313\337&\210\323\201N \325\326\201O DD\201P \331\332%\210\323\201Q \325\326\201R DD\201S \331\332%\210\323\201T \325\326\201U DD\201V \331\201W %\207" [require cl-lib dired image-mode jka-compr custom-declare-group doc-view nil "In-buffer viewer for PDF, PostScript, DVI, and DJVU files." :link (function-link doc-view) :version "22.2" :group applications data multimedia :prefix "doc-view-" custom-declare-variable doc-view-ghostscript-program funcall function #[0 "\301>\203. \302\303!\203 \303\207\302\304!\203 \304\207\302\305!\203 \305\207\302\306!\205- \307\310!\311U\205/ \306\207\312\207" [system-type (windows-nt ms-dos) executable-find "gswin64c" "gswin32c" "rungs" "mgs" shell-command "mgs -q -dNODISPLAY -c quit" 0 "gs"] 2] "Program to convert PS and PDF files to PNG." :type file "27.1" doc-view-pdfdraw-program #[0 "\300\301!\203 \301\207\300\302!\203 \302\207\300\303!\203 \303\207\302\207" [executable-find "pdfdraw" "mudraw" "mutool"] 2] "Name of MuPDF's program to convert PDF files to PNG." "24.4" doc-view-pdftotext-program-args #[0 "\300\207" [("-raw")] 1] "Parameters to give to the pdftotext command." (repeat string) doc-view-pdf->png-converter-function #[0 "\301!\203 \302\207\303\207" [doc-view-pdfdraw-program executable-find doc-view-pdf->png-converter-mupdf doc-view-pdf->png-converter-ghostscript] 2] "Function to call to convert a PDF file into a PNG file." (radio (function-item doc-view-pdf->png-converter-ghostscript :doc "Use ghostscript") (function-item doc-view-pdf->png-converter-mupdf :doc "Use mupdf") function) doc-view-ghostscript-options #[0 "\300\207" [("-dSAFER" "-dNOPAUSE" "-dTextAlphaBits=4" "-dBATCH" "-dGraphicsAlphaBits=4" "-dQUIET")] 1] "A list of options to give to ghostscript." (repeat string) doc-view-ghostscript-device #[0 "\300\207" [#1="png16m"] 1 #1#] "Output device to give to ghostscript." string doc-view-resolution #[0 "\300\207" [100] 1] "Dots per inch resolution used to render the documents.\nHigher values result in larger images." number doc-view-scale-internally #[0 "\300\207" [t] 1] "Whether we should try to rescale images ourselves.\nIf nil, the document is re-rendered every time the scaling factor is modified.\nThis only has an effect if the image libraries linked with Emacs support\nscaling." boolean doc-view-image-width #[0 "\300\207" [850] 1] "Default image width.\nHas only an effect if `doc-view-scale-internally' is non-nil and support for\nscaling is compiled into Emacs." "24.1" doc-view-dvipdfm-program #[0 "\300\207" [#2="dvipdfm"] 1 #2#] "Program to convert DVI files to PDF.\n\nDVI file will be converted to PDF before the resulting PDF is\nconverted to PNG.\n\nIf this and `doc-view-dvipdf-program' are set,\n`doc-view-dvipdf-program' will be preferred." doc-view-dvipdf-program #[0 "\300\207" [#3="dvipdf"] 1 #3#] "Program to convert DVI files to PDF.\n\nDVI file will be converted to PDF before the resulting PDF is\nconverted to PNG.\n\nIf this and `doc-view-dvipdfm-program' are set,\n`doc-view-dvipdf-program' will be preferred." defvaralias doc-view-unoconv-program doc-view-odf->pdf-converter-program (saved-value saved-variable-comment) put make-obsolete-variable #[0 "\300\301!\203 \301\207\300\302!\203 \302\207\301\207" [executable-find "soffice" "unoconv"] 2] "Program to convert any file type readable by OpenOffice.org to PDF.\n\nNeeded for viewing OpenOffice.org (and MS Office) files." doc-view-odf->pdf-converter-function #[0 "\301\302\"\203 \303\207\301\304\"\205 \305\207" [doc-view-odf->pdf-converter-program string-match "unoconv\\'" doc-view-odf->pdf-converter-unoconv "soffice\\'" doc-view-odf->pdf-converter-soffice] 3] "Function to call to convert a ODF file into a PDF file." (radio (function-item doc-view-odf->pdf-converter-unoconv :doc "Use unoconv") (function-item doc-view-odf->pdf-converter-soffice :doc "Use LibreOffice") function) doc-view-ps2pdf-program #[0 "\300\207" [#4="ps2pdf"] 1 #4#] "Program to convert PS files to PDF.\n\nPS files will be converted to PDF before searching is possible." doc-view-pdftotext-program #[0 "\300\207" [#5="pdftotext"] 1 #5#] "Program to convert PDF files to plain text.\n\nNeeded for searching." doc-view-cache-directory #[0 "\301\302\303\304 \"\"\207" [temporary-file-directory expand-file-name format "docview%d" user-uid] 4] "The base directory, where the PNG images will be saved." directory] 16) #@62 The buffer where messages from the converter programs go to. (defvar doc-view-conversion-buffer " *doc-view conversion output*" (#$ . 5678)) (byte-code "\300\301\302\303\304DD\305\306\307%\210\300\310\302\303\311DD\312\306\313\314\315&\207" [custom-declare-variable doc-view-conversion-refresh-interval funcall function #[0 "\300\207" [1] 1] "Interval in seconds between refreshes of the DocView buffer while converting.\nAfter such a refresh newly converted pages will be available for\nviewing. If set to nil there won't be any refreshes and the\npages won't be displayed before conversion of the whole document\nhas finished." :type integer doc-view-continuous #[0 "\300\207" [nil] 1] "In Continuous mode reaching the page edge advances to next/previous page.\nWhen non-nil, scrolling a line upward at the bottom edge of the page\nmoves to the next page, and scrolling a line downward at the top edge\nof the page moves to the previous page." boolean :version "23.2"] 8) #@23 Only used internally. (defvar doc-view--current-converter-processes nil (#$ . 6660)) (make-variable-buffer-local 'doc-view--current-converter-processes) #@17 (fn WINPROPS) (defalias 'doc-view-new-window-function #[257 "\211@\301=\204 \302@!p=\204 \303\304!\210\305\306\"\211\203* \307!\262\310ed#\210\2028 \311ed\312\301$\262\313\314\301#\210\313\315@#\210\316@!\204U @\301=\204Q \303\317!\210\320!\210\321\306#\210\316@!\205\217 \322\323\";\205\217 ?\205\217 \324@!r\325\326\327\330\331!\332\"\333$\216\334@\335\"\210\336\305\337\301\"!*\262\207" [doc-view--current-converter-processes t window-buffer cl--assertion-failed (or (eq t (car winprops)) (eq (window-buffer (car winprops)) (current-buffer))) image-mode-window-get overlay copy-overlay move-overlay make-overlay nil overlay-put doc-view window windowp (eq t (car winprops)) delete-overlay image-mode-window-put overlay-get display internal--before-with-selected-window make-byte-code 0 "\301\300!\207" vconcat vector [internal--after-with-selected-window] 2 select-window norecord doc-view-goto-page page] 9 (#$ . 6819)]) #@23 Only used internally. (defvar doc-view--current-files nil (#$ . 7775)) (make-variable-buffer-local 'doc-view--current-files) #@23 Only used internally. (defvar doc-view--current-timer nil (#$ . 7906)) (make-variable-buffer-local 'doc-view--current-timer) #@23 Only used internally. (defvar doc-view--current-cache-dir nil (#$ . 8037)) (make-variable-buffer-local 'doc-view--current-cache-dir) #@23 Only used internally. (defvar doc-view--current-search-matches nil (#$ . 8176)) (make-variable-buffer-local 'doc-view--current-search-matches) #@23 Only used internally. (defvar doc-view--pending-cache-flush nil (#$ . 8325)) #@273 Only used internally. The file name used for conversion. Normally it's the same as `buffer-file-name', but for remote files, compressed files and files inside an archive it is a temporary copy of the (uncompressed, extracted) file residing in `doc-view-cache-directory'. (defvar doc-view--buffer-file-name nil (#$ . 8409)) #@89 The type of document in the current buffer. Can be `dvi', `pdf', `ps', `djvu' or `odf'. (defvar doc-view-doc-type nil (#$ . 8739)) #@170 Function to call to convert a single page of the document to a bitmap file. May operate on the source document or on some intermediate (typically PDF) conversion of it. (defvar doc-view-single-page-converter-function nil (#$ . 8877)) #@66 The type of image in the current buffer. Can be `png' or `tiff'. (defvar doc-view--image-type nil (#$ . 9117)) (make-variable-buffer-local 'doc-view--image-type) #@68 The `format' pattern of image file names. Typically "page-%s.png". (defvar doc-view--image-file-pattern nil (#$ . 9285)) (make-variable-buffer-local 'doc-view--image-file-pattern) #@74 Keymap used by `doc-view-mode' when displaying a doc as a set of images. (defvar doc-view-mode-map (byte-code "\301 \302\"\210\303\304\305#\210\303\306\307#\210\303\310\311#\210\303\312\313#\210\303\314\305#\210\303\315\307#\210\303\316\317#\210\303\320\321#\210\303\322\321#\210\303\323\324#\210\303\325\324#\210\303\326\327#\210\303\330\327#\210\303\331\332#\210\303\333\334#\210\303\335\336#\210\303\337\340#\210\303\341\342#\210\303\343\342#\210\303\344\345#\210\303\346\347#\210\303\350\351#\210\303\352\353#\210\303\354\355#\210\303\356\357#\210\303\360\361#\210\303\362\363#\210\303\364\365#\210\303\366\367#\210\303\370\371#\210\303\372\373#\210\303\374\375#\210\303\376\377#\210\303\201@ \377#\210\303\201A \201B #\210\303\201C \201D #\210\303\201E \201F #\210\303\201G \201H #\210\303\201I \201J #\210\211\207" [image-mode-map make-sparse-keymap set-keymap-parent define-key "n" doc-view-next-page "p" doc-view-previous-page [next] forward-page [prior] backward-page [remap forward-page] [remap backward-page] " " doc-view-scroll-up-or-next-page [33554464] doc-view-scroll-down-or-previous-page "" "" doc-view-next-line-or-next-page [down] "" doc-view-previous-line-or-previous-page [up] [134217788] doc-view-first-page [134217790] doc-view-last-page [remap goto-line] doc-view-goto-page " " image-next-line "+" doc-view-enlarge "=" "-" doc-view-shrink "0" doc-view-scale-reset [remap text-scale-adjust] doc-view-scale-adjust "W" doc-view-fit-width-to-window "H" doc-view-fit-height-to-window "P" doc-view-fit-page-to-window "F" doc-view-fit-window-to-page "k" image-kill-buffer "K" doc-view-kill-proc "cs" doc-view-set-slice "cm" doc-view-set-slice-using-mouse "cb" doc-view-set-slice-from-bounding-box "cr" doc-view-reset-slice "" doc-view-search [find] "" doc-view-search-backward "" doc-view-show-tooltip "" doc-view-toggle-display "" doc-view-open-text "r" revert-buffer] 5) (#$ . 9471)) (byte-code "\300\301\302\303#\210\304\301\302\305#\207" [defalias doc-view-revert-buffer revert-buffer nil make-obsolete "27.1"] 4) #@84 Preserve the buffer's current mode and check PDF sanity. (fn ORIG-FUN &rest ARGS) (defalias 'doc-view--revert-buffer #[385 "\303\304 _W\203 \305\300!\210\303\304 _\306\307\310\311\312\313\"\314\"\315$\262 \316=\203L \317\320!\203L \321\320\306\211\211\n%\310U\203@ \211 \202N \322\323!\205N \324\325!\202N \211 \207" [undo-outer-limit doc-view-doc-type doc-view--buffer-file-name 2 buffer-size make-local-variable nil make-byte-code 0 "\306\307\300\301\"\210\f\232?\205 \310 !\210\311\312\211\f#)\207" vconcat vector [revert-buffer-preserve-modes buffer-file-name doc-view--buffer-file-name doc-view-cache-directory t apply doc-view-make-safe-dir write-region nil] 4 pdf executable-find "pdfinfo" call-process called-interactively-p interactive message "Can't revert right now because the file is corrupted."] 10 (#$ . 11563)]) #@25 Menu for Doc View mode. (defvar doc-view-menu nil (#$ . 12409)) (easy-menu-do-define 'doc-view-menu doc-view-mode-map "Menu for Doc View mode." '("DocView" ["Toggle display" doc-view-toggle-display] ("Continuous" ["Off" (setq doc-view-continuous nil) :style radio :selected (eq doc-view-continuous nil)] ["On" (setq doc-view-continuous t) :style radio :selected (eq doc-view-continuous t)] "---" ["Save as Default" (customize-save-variable 'doc-view-continuous doc-view-continuous) t]) "---" ["Set Slice" doc-view-set-slice-using-mouse] ["Set Slice (BoundingBox)" doc-view-set-slice-from-bounding-box] ["Set Slice (manual)" doc-view-set-slice] ["Reset Slice" doc-view-reset-slice] "---" ["Search" doc-view-search] ["Search Backwards" doc-view-search-backward])) #@39 Keymap used by `doc-view-minor-mode'. (defvar doc-view-minor-mode-map (byte-code "\300 \301\302\303#\210\211\207" [make-sparse-keymap define-key "" doc-view-toggle-display] 5) (#$ . 13177)) #@22 (fn &optional WIN) (defalias 'doc-view-current-page '(macro . #[256 "\300\301E\207" [image-mode-window-get 'page] 4 (#$ . 13376)])) (defalias 'doc-view-current-info '(macro . #[0 "\300\207" [(image-mode-window-get 'info)] 1])) (defalias 'doc-view-current-overlay '(macro . #[0 "\300\207" [(image-mode-window-get 'overlay)] 1])) (defalias 'doc-view-current-image '(macro . #[0 "\300\207" [(image-mode-window-get 'image)] 1])) (defalias 'doc-view-current-slice '(macro . #[0 "\300\207" [(image-mode-window-get 'slice)] 1])) (defalias 'doc-view-last-page-number #[0 "G\207" [doc-view--current-files] 1]) #@41 View the page given by PAGE. (fn PAGE) (defalias 'doc-view-goto-page #[257 "\211C\305 \242\306W\203 \306\240\210\202! \242V\203! \204! \240\210\307 \210\310\311\242\312#\210\310\313\314\315\316\242#\317\320#\203A \321\202B \322 \205r \242 \236\205r \314\323\317\320#\324\242 \236A\211\203m \211@\325\326R\262A\266\202\202Y \210\211\262PQ\312#\210\327\315\n\242\"\330 \"\331\332\333#\210\334!\204\252 \203\252 \f\242\335 \336\337\340\341\342\f#\343\"\344$\262$\210\210\345\346\347!\350\346\313!#\262\207" [doc-view--current-converter-processes doc-view--current-search-matches doc-view--image-file-pattern doc-view-single-page-converter-function doc-view--buffer-file-name doc-view-last-page-number 1 force-mode-line-update image-mode-window-put page nil info propertize format "Page %d of %d." face bold " (still converting...)\n" "\n" "Search matches:\n" "" " - \"" "\"\n" expand-file-name doc-view--current-cache-dir doc-view-insert-image :pointer arrow file-exists-p selected-window make-byte-code 0 "p\303\302!=\2055 \304\305\302\"\300\242=\2055 \306\301!\2055 \307\302!r\310\311\312\313\314!\315\"\316$\216\317@\320\"\210\321\300\242!*\262\207" vconcat vector [window-buffer image-mode-window-get page file-readable-p internal--before-with-selected-window make-byte-code 0 "\301\300!\207" vconcat vector [internal--after-with-selected-window] 2 select-window norecord doc-view-goto-page] 7 overlay-put image-mode-window-get overlay help-echo] 17 (#$ . 13987) "nPage: "]) #@47 Browse ARG pages forward. (fn &optional ARG) (defalias 'doc-view-next-page #[256 "\300\301\302\303\"\206\n \304\\!\207" [doc-view-goto-page image-mode-window-get page nil 1] 5 (#$ . 15510) "p"]) #@48 Browse ARG pages backward. (fn &optional ARG) (defalias 'doc-view-previous-page #[256 "\300\301\302\303\"\206\n \304Z!\207" [doc-view-goto-page image-mode-window-get page nil 1] 5 (#$ . 15713) "p"]) #@22 View the first page. (defalias 'doc-view-first-page #[0 "\300\301!\207" [doc-view-goto-page 1] 2 (#$ . 15920) nil]) #@21 View the last page. (defalias 'doc-view-last-page #[0 "\300\301 !\207" [doc-view-goto-page doc-view-last-page-number] 2 (#$ . 16042) nil]) #@250 Scroll page up ARG lines if possible, else goto next page. When `doc-view-continuous' is non-nil, scrolling upward at the bottom edge of the page moves to the next page. Otherwise, goto next page only on typing SPC (ARG is nil). (fn &optional ARG) (defalias 'doc-view-scroll-up-or-next-page #[256 "\204 \211\2042 \301 \302\303\304\"\305\304\306\"\307!U\2051 \310 \210\211\302\303\304\"U\204, \311 \210\312\313!\210\314\315 \"\207\307!\207" [doc-view-continuous window-hscroll image-mode-window-get page nil window-vscroll t image-scroll-up doc-view-next-page image-bob image-bol 1 set-window-hscroll selected-window] 7 (#$ . 16188) "P"]) #@263 Scroll page down ARG lines if possible, else goto previous page. When `doc-view-continuous' is non-nil, scrolling downward at the top edge of the page moves to the previous page. Otherwise, goto previous page only on typing DEL (ARG is nil). (fn &optional ARG) (defalias 'doc-view-scroll-down-or-previous-page #[256 "\204 \211\2042 \301 \302\303\304\"\305\304\306\"\307!U\2051 \310 \210\211\302\303\304\"U\204, \311 \210\312\313!\210\314\315 \"\207\307!\207" [doc-view-continuous window-hscroll image-mode-window-get page nil window-vscroll t image-scroll-down doc-view-previous-page image-eob image-bol 1 set-window-hscroll selected-window] 7 (#$ . 16839) "P"]) #@200 Scroll upward by ARG lines if possible, else goto next page. When `doc-view-continuous' is non-nil, scrolling a line upward at the bottom edge of the page moves to the next page. (fn &optional ARG) (defalias 'doc-view-next-line-or-next-page #[256 "\203. \301 \302\303\304\"\305\304\306\"\307!U\205- \310 \210\211\302\303\304\"U\204( \311 \210\312\313!\210\314\315 \"\207\307!\207" [doc-view-continuous window-hscroll image-mode-window-get page nil window-vscroll t image-next-line doc-view-next-page image-bob image-bol 1 set-window-hscroll selected-window] 7 (#$ . 17515) "p"]) #@209 Scroll downward by ARG lines if possible, else goto previous page. When `doc-view-continuous' is non-nil, scrolling a line downward at the top edge of the page moves to the previous page. (fn &optional ARG) (defalias 'doc-view-previous-line-or-previous-page #[256 "\203. \301 \302\303\304\"\305\304\306\"\307!U\205- \310 \210\211\302\303\304\"U\204( \311 \210\312\313!\210\314\315 \"\207\307!\207" [doc-view-continuous window-hscroll image-mode-window-get page nil window-vscroll t image-previous-line doc-view-previous-page image-eob image-bol 1 set-window-hscroll selected-window] 7 (#$ . 18106) "p"]) #@41 Kill the current converter process(es). (defalias 'doc-view-kill-proc #[0 ":\203 \3031 \304\211A\242!0\202 \210\202 \210\202 \203&