Commit 9d7fae5a authored by Lars Ingebrigtsen's avatar Lars Ingebrigtsen

Fix reverting doc-view buffers

* lisp/doc-view.el (doc-view--revert-buffer): Actually use the new
version of the PDF data (bug#26996).
parent c9af3434
Pipeline #3372 passed with stage
in 65 minutes and 5 seconds
......@@ -448,7 +448,12 @@ Typically \"page-%s.png\".")
(setq-local undo-outer-limit (* 2 (buffer-size))))
(cl-labels ((revert ()
(let ((revert-buffer-preserve-modes t))
(apply orig-fun args))))
(apply orig-fun args)
;; Update the cached version of the pdf file,
;; too. This is the one that's used when
;; rendering.
(doc-view-make-safe-dir doc-view-cache-directory)
(write-region nil nil doc-view--buffer-file-name))))
(if (and (eq 'pdf doc-view-doc-type)
(executable-find "pdfinfo"))
;; We don't want to revert if the PDF file is corrupted which
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment