emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

emacs-30 a475360af98: Correct display of Doc View documents after tab sw


From: Po Lu
Subject: emacs-30 a475360af98: Correct display of Doc View documents after tab switching
Date: Sun, 28 Jul 2024 21:20:10 -0400 (EDT)

branch: emacs-30
commit a475360af980673fe97a701633375c3a308364c6
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>

    Correct display of Doc View documents after tab switching
    
    * lisp/doc-view.el (doc-view-new-window-function): Prevent
    creation of duplicate overlays for the same window after a
    window configuration change occasions a call to i-m-r-winprops.
---
 lisp/doc-view.el | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/lisp/doc-view.el b/lisp/doc-view.el
index e7d7ed4a862..15352630d25 100644
--- a/lisp/doc-view.el
+++ b/lisp/doc-view.el
@@ -432,6 +432,15 @@ of the page moves to the previous page."
 
 (defun doc-view-new-window-function (winprops)
   ;; (message "New window %s for buf %s" (car winprops) (current-buffer))
+  ;;
+  ;; If the window configuration changed, `image-mode-reapply-winprops'
+  ;; will have erased any previous property list for this window, but
+  ;; without removing existing overlays for the same, so that they must
+  ;; be located and erased before a new overlay is created.
+  (dolist (tem (car (overlay-lists)))
+    (when (and (eq (overlay-get tem 'window) (car winprops))
+               (overlay-get tem 'doc-view))
+      (delete-overlay tem)))
   (cl-assert (or (eq t (car winprops))
                  (eq (window-buffer (car winprops)) (current-buffer))))
   (let ((ol (image-mode-window-get 'overlay winprops)))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]