Bump :tools pdf
vedang/pdf-tools@d262cf9 -> vedang/pdf-tools@5f77dae Fixes #4989: remove local hacks for retina support in favor of upstream fixes.
This commit is contained in:
parent
044a1a5f2b
commit
38bc1ab81a
2 changed files with 1 additions and 55 deletions
|
@ -72,56 +72,6 @@
|
||||||
(add-hook 'doom-switch-buffer-hook #'+pdf-reload-midnight-minor-mode-h
|
(add-hook 'doom-switch-buffer-hook #'+pdf-reload-midnight-minor-mode-h
|
||||||
nil 'local))))))
|
nil 'local))))))
|
||||||
|
|
||||||
;; Add retina support for MacOS users
|
|
||||||
(eval-when! IS-MAC
|
|
||||||
(defun +pdf-view-create-page-a (page &optional window)
|
|
||||||
"Create an image of PAGE for display on WINDOW."
|
|
||||||
:override #'pdf-view-create-page
|
|
||||||
(let* ((size (pdf-view-desired-image-size page window))
|
|
||||||
(width (if (not (pdf-view-use-scaling-p))
|
|
||||||
(car size)
|
|
||||||
(* 2 (car size))))
|
|
||||||
(data (pdf-cache-renderpage
|
|
||||||
page width width))
|
|
||||||
(hotspots (pdf-view-apply-hotspot-functions
|
|
||||||
window page size)))
|
|
||||||
(pdf-view-create-image data
|
|
||||||
:width width
|
|
||||||
:scale (if (pdf-view-use-scaling-p) 0.5 1)
|
|
||||||
:map hotspots
|
|
||||||
:pointer 'arrow)))
|
|
||||||
|
|
||||||
(defvar +pdf--scaled-p nil)
|
|
||||||
(defadvice! +pdf--scale-up-on-retina-display-a (orig-fn &rest args)
|
|
||||||
"Scale up the PDF on retina displays."
|
|
||||||
:around #'pdf-util-frame-scale-factor
|
|
||||||
(cond ((not pdf-view-use-scaling) 1)
|
|
||||||
((and (memq (pdf-view-image-type) '(imagemagick image-io))
|
|
||||||
(fboundp 'frame-monitor-attributes))
|
|
||||||
(funcall orig-fn))
|
|
||||||
;; Add special support for retina displays on MacOS
|
|
||||||
((and (eq (framep-on-display) 'ns)
|
|
||||||
(not +pdf--scaled-p)
|
|
||||||
EMACS27+)
|
|
||||||
(setq-local +pdf--scaled-p t)
|
|
||||||
2)
|
|
||||||
(1)))
|
|
||||||
|
|
||||||
(defadvice! +pdf--use-scaling-on-ns-a ()
|
|
||||||
:before-until #'pdf-view-use-scaling-p
|
|
||||||
(and (eq (framep-on-display) 'ns)
|
|
||||||
EMACS27+))
|
|
||||||
|
|
||||||
(defadvice! +pdf--supply-width-to-create-image-calls-a (orig-fn &rest args)
|
|
||||||
:around '(pdf-annot-show-annotation
|
|
||||||
pdf-isearch-hl-matches
|
|
||||||
pdf-view-display-region)
|
|
||||||
(letf! (defun create-image (file-or-data &optional type data-p &rest props)
|
|
||||||
(apply create-image file-or-data type data-p
|
|
||||||
:width (car (pdf-view-image-size))
|
|
||||||
props))
|
|
||||||
(apply orig-fn args))))
|
|
||||||
|
|
||||||
;; Silence "File *.pdf is large (X MiB), really open?" prompts for pdfs
|
;; Silence "File *.pdf is large (X MiB), really open?" prompts for pdfs
|
||||||
(defadvice! +pdf-suppress-large-file-prompts-a (orig-fn size op-type filename &optional offer-raw)
|
(defadvice! +pdf-suppress-large-file-prompts-a (orig-fn size op-type filename &optional offer-raw)
|
||||||
:around #'abort-if-file-too-large
|
:around #'abort-if-file-too-large
|
||||||
|
|
|
@ -1,9 +1,5 @@
|
||||||
;; -*- no-byte-compile: t; -*-
|
;; -*- no-byte-compile: t; -*-
|
||||||
;;; tools/pdf/packages.el
|
;;; tools/pdf/packages.el
|
||||||
|
|
||||||
(package! pdf-tools
|
(package! pdf-tools :pin "5f77dae43eb8f71e52e10ba8cf994883f74c3fb7")
|
||||||
:recipe (:host github
|
|
||||||
:repo "vedang/pdf-tools")
|
|
||||||
:pin "d262cf9e19d57c6567e06e51d109150c20753839")
|
|
||||||
|
|
||||||
(package! saveplace-pdf-view :pin "54ed966b842501c3c092dbf57b372e37b033c578")
|
(package! saveplace-pdf-view :pin "54ed966b842501c3c092dbf57b372e37b033c578")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue