mirror of
https://gitlab.com/dwt1/dotfiles.git
synced 2026-04-22 19:10:24 +10:00
Moving to Doom Emacs!
This commit is contained in:
30
.emacs.d/modules/tools/pdf/autoload/pdf.el
Normal file
30
.emacs.d/modules/tools/pdf/autoload/pdf.el
Normal file
@@ -0,0 +1,30 @@
|
||||
;;; tools/pdf/autoload/pdf.el -*- lexical-binding: t; -*-
|
||||
|
||||
;;;###autoload
|
||||
(defun +pdf--supply-width-to-create-image-calls-a (orig-fn &rest args)
|
||||
(cl-letf* ((old-create-image (symbol-function #'create-image))
|
||||
((symbol-function #'create-image)
|
||||
(lambda (file-or-data &optional type data-p &rest props)
|
||||
(apply old-create-image file-or-data type data-p
|
||||
:width (car (pdf-view-image-size))
|
||||
props))))
|
||||
(apply orig-fn args)))
|
||||
|
||||
;;;###autoload
|
||||
(defun +pdf--util-frame-scale-factor-a (orig-fn)
|
||||
(if (and pdf-view-use-scaling
|
||||
(memq (pdf-view-image-type) '(imagemagick image-io))
|
||||
(fboundp 'frame-monitor-attributes))
|
||||
(funcall orig-fn)
|
||||
;; Add special support for retina displays on MacOS
|
||||
(if (and (eq (framep-on-display) 'ns)
|
||||
EMACS27+)
|
||||
2
|
||||
1)))
|
||||
|
||||
;;;###autoload
|
||||
(defun +pdf--view-use-scaling-p-a ()
|
||||
"Returns t if on ns window-system on Emacs 27+."
|
||||
(and (eq (framep-on-display) 'ns)
|
||||
EMACS27+
|
||||
pdf-view-use-scaling))
|
||||
Reference in New Issue
Block a user