]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix reverting doc-view buffers
authorLars Ingebrigtsen <larsi@gnus.org>
Sun, 29 Sep 2019 12:58:38 +0000 (14:58 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Sun, 29 Sep 2019 12:58:38 +0000 (14:58 +0200)
* lisp/doc-view.el (doc-view--revert-buffer): Actually use the new
version of the PDF data (bug#26996).

lisp/doc-view.el

index 9d10d03628568ec6ab15366cf7c24f54e1cb1e4c..9fe177a184a3a4f7957847e11728ccf8605b8e21 100644 (file)
@@ -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