Prevent extra variable from being passed in macro.

In the PDF module, there is a macro that is used to prevent the
file-too-big prompt for PDFs since they're always too big. However, this
macro has an extra variable listed that then gets passed on to the
wrapped function and causes an error if the function doesn't support the
extra variable.

This fix simply checks if the extra value is present or not and only
calls the wrapped function with it if is actually present. After all,
the variable will still be nil even if nil isn't passed.
This commit is contained in:
Samuel Jackson 2021-07-04 14:59:29 -07:00
parent 2731685095
commit bb677cf7a5

View file

@ -126,7 +126,9 @@
(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))))
(if offer-raw
(funcall orig-fn size op-type filename offer-raw)
(funcall orig-fn size op-type filename)))))
(use-package! saveplace-pdf-view