tools/pdf: suppress "file is large" prompts for pdfs

This commit is contained in:
Henrik Lissner 2021-04-15 13:28:58 -04:00
parent b158215587
commit 437f122969

View file

@ -137,7 +137,13 @@
(apply create-image file-or-data type data-p
:width (car (pdf-view-image-size))
props))
(apply orig-fn args)))))
(apply orig-fn args))))
;; 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)
:around #'abort-if-file-too-large
(unless (string-match-p "\\.pdf\\'" filename)
(funcall orig-fn size op-type filename offer-raw))))
(use-package! saveplace-pdf-view