From 17169f3761fdc1f520708c84ef35cc750be9d5bd Mon Sep 17 00:00:00 2001 From: Andreas Politz Date: Sat, 20 Oct 2018 14:36:26 +0200 Subject: Avoid errors while trying to read decrypted documents --- lisp/pdf-view.el | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lisp/pdf-view.el b/lisp/pdf-view.el index 80141d7..d0337e9 100644 --- a/lisp/pdf-view.el +++ b/lisp/pdf-view.el @@ -331,6 +331,10 @@ PNG images in Emacs buffers." "-")))) (write-region nil nil tempfile nil 'no-message) (setq-local pdf-view--buffer-file-name tempfile))) + ;; Decryption needs to be done before any other function calls into + ;; pdf-info.el (e.g. from the mode-line during redisplay during + ;; waiting for process output). + (pdf-view-decrypt-document) ;; Setup scroll functions (if (boundp 'mwheel-scroll-up-function) ; not --without-x build @@ -393,9 +397,6 @@ PNG images in Emacs buffers." 'pdf-view-new-window-function nil t) (image-mode-setup-winprops) - ;; Decryption needs to be done before any other function calls into - ;; pdf-info.el . - (pdf-view-decrypt-document) ;; Issue a warning in the future about incompatible modes. (run-with-timer 1 nil #'pdf-view-check-incompatible-modes (current-buffer)) -- cgit v1.0