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:
parent
2731685095
commit
bb677cf7a5
1 changed files with 3 additions and 1 deletions
|
@ -126,7 +126,9 @@
|
||||||
(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
|
||||||
(unless (string-match-p "\\.pdf\\'" filename)
|
(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
|
(use-package! saveplace-pdf-view
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue