branch: externals/auctex
commit 91da27754be7f3728858fc27eb4b7866cecd591c
Author: Ikumi Keita <ik...@ikumi.que.jp>
Commit: Ikumi Keita <ik...@ikumi.que.jp>

    Keep preview images when killing indirect buffer (bug#65462)
    
    * preview.el.in (preview-kill-buffer-cleanup): Don't clearout in
    indirect buffer.
    Fix filling of doc string.
---
 preview.el.in | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/preview.el.in b/preview.el.in
index e26f478c93..af0997aad6 100644
--- a/preview.el.in
+++ b/preview.el.in
@@ -2290,13 +2290,14 @@ all previews."
 (defun preview-kill-buffer-cleanup (&optional buf)
   "This is a cleanup function just for use in hooks.
 Cleans BUF or current buffer.  The difference to
-`preview-clearout-buffer' is that previews
-associated with the last buffer modification time are
-kept."
-  (with-current-buffer (or buf (current-buffer))
-    (save-restriction
-      (widen)
-      (preview-clearout (point-min) (point-max) (visited-file-modtime)))))
+`preview-clearout-buffer' is that previews associated with the
+last buffer modification time are kept."
+  ;; Do nothing for indirect buffers. (bug#65462)
+  (unless (buffer-base-buffer (or buf (setq buf (current-buffer))))
+    (with-current-buffer buf
+      (save-restriction
+        (widen)
+        (preview-clearout (point-min) (point-max) (visited-file-modtime))))))
 
 (add-hook 'kill-buffer-hook #'preview-kill-buffer-cleanup)
 (add-hook 'before-revert-hook #'preview-kill-buffer-cleanup)


Reply via email to