emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] externals/doc-view-follow 30b6c7d89f 18/43: Simplify page synchro


From: ELPA Syncer
Subject: [elpa] externals/doc-view-follow 30b6c7d89f 18/43: Simplify page synchronization in doc-dual-view
Date: Sun, 13 Apr 2025 12:58:29 -0400 (EDT)

branch: externals/doc-view-follow
commit 30b6c7d89f9c3f1aaf0e6e00620f41d58660a277
Author: Paul Nelson <ultrono@gmail.com>
Commit: Paul Nelson <ultrono@gmail.com>

    Simplify page synchronization in doc-dual-view
    
    * doc-dual-view.el (doc-dual-view--sync-pages): Use the goto function
    directly with an idle timer instead of having a separate redisplay
    step.
---
 doc-dual-view.el | 24 +++++++-----------------
 1 file changed, 7 insertions(+), 17 deletions(-)

diff --git a/doc-dual-view.el b/doc-dual-view.el
index 870c30b0ac..f8a69ab982 100644
--- a/doc-dual-view.el
+++ b/doc-dual-view.el
@@ -97,7 +97,6 @@ redisplay-func)."
                (current-page (funcall current-page-func))
                (max-page-func (nth 3 mode-funcs))
                (max-page (funcall max-page-func))
-               (redisplay-func (nth 4 mode-funcs))
                (current-window (selected-window))
                (window-index (seq-position windows current-window)))
           (seq-do-indexed
@@ -110,24 +109,15 @@ redisplay-func)."
                  (with-selected-window win
                    (let ((current (funcall current-page-func)))
                      (when (not (= current target-page))
-                       (funcall goto-func target-page)
-                       (let ((timer-sym
-                              (intern (format
-                                       "doc-dual-view--redisplay-timer-%d" 
i))))
-                         (when (and (boundp timer-sym)
-                                    (timerp (symbol-value timer-sym)))
-                           (cancel-timer (symbol-value timer-sym)))
-                         (set timer-sym
-                              (run-with-idle-timer
-                               0.001 nil
-                               (lambda (w f p)
-                                 (when (window-live-p w)
-                                   (with-selected-window w
-                                     (funcall f p))))
-                               win redisplay-func target-page)))))))))
+                       (run-with-idle-timer
+                        0.001 nil
+                        (lambda (target-win func page)
+                          (when (window-live-p target-win)
+                            (with-selected-window target-win
+                              (funcall func page))))
+                        win goto-func target-page)))))))
            windows))))))
 
-
 ;;;###autoload
 (define-minor-mode doc-dual-view-mode
   "Minor mode to sync pages between two windows showing the same document."



reply via email to

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