From bb677cf7a5857e45519b7f2d5a67e43639ad19d2 Mon Sep 17 00:00:00 2001 From: Samuel Jackson Date: Sun, 4 Jul 2021 14:59:29 -0700 Subject: [PATCH] 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. --- modules/tools/pdf/config.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/tools/pdf/config.el b/modules/tools/pdf/config.el index 002aa7256d1..b61dd7dcff9 100644 --- a/modules/tools/pdf/config.el +++ b/modules/tools/pdf/config.el @@ -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