]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/doc-view.el (doc-view--revert-buffer): Fix last change
authorStefan Monnier <monnier@iro.umontreal.ca>
Tue, 5 Nov 2019 19:33:36 +0000 (14:33 -0500)
committerStefan Monnier <monnier@iro.umontreal.ca>
Tue, 5 Nov 2019 19:33:36 +0000 (14:33 -0500)
lisp/doc-view.el

index d88150735fef553c64a9a3518ddbd32784d0aa5b..15a1dc3b9bdbf4e09b35e4102da7484a02428d25 100644 (file)
@@ -451,9 +451,13 @@ Typically \"page-%s.png\".")
                         (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))))
+                        ;; rendering (bug#26996).
+                        (unless (equal buffer-file-name
+                                       doc-view--buffer-file-name)
+                          ;; FIXME: Lars says he needed to recreate
+                          ;; the dir, we should figure out why.
+                          (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