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

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

[nongnu] elpa/dslide ccb8064891 152/230: ensure-slide-buffer only displa


From: ELPA Syncer
Subject: [nongnu] elpa/dslide ccb8064891 152/230: ensure-slide-buffer only displays when not already displayed
Date: Sun, 7 Jul 2024 19:00:30 -0400 (EDT)

branch: elpa/dslide
commit ccb8064891d959ec08f172240fae580f2e238b00
Author: Psionik K <73710933+psionic-k@users.noreply.github.com>
Commit: Psionik K <73710933+psionic-k@users.noreply.github.com>

    ensure-slide-buffer only displays when not already displayed
    
    Signed-off-by: Psionik K <73710933+psionic-k@users.noreply.github.com>
---
 dslide.el | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/dslide.el b/dslide.el
index f4e616e452..f8edf863fc 100644
--- a/dslide.el
+++ b/dslide.el
@@ -2342,13 +2342,19 @@ hooks must occur in the deck's :slide-buffer."
   (setq dslide--contents-hl-line-overlay nil))
 
 (defun dslide--ensure-slide-buffer (&optional display)
-  "Run in commands that must run in the slide buffer.
-Unless optional DISPLAY is non-nil, the buffer is only set."
+  "Switch to the slide buffer.
+Use this in functions which must run in the slide buffer but
+could be called from another buffer. Optional DISPLAY will also
+ensure that the slide buffer is visible."
   (unless (dslide-live-p)
     (error "Live deck not found"))
   (if display
-      (display-buffer (oref dslide--deck slide-buffer)
-                      dslide--display-actions)
+      (let ((slide-buffer (oref dslide--deck slide-buffer)))
+        ;; TODO requires further taming if user is using multiple frames, such
+        ;; as displaying some information on a projector and other information
+        ;; on another frame
+        (unless (get-buffer-window slide-buffer)
+          (display-buffer slide-buffer dslide--display-actions)))
     (set-buffer (oref dslide--deck slide-buffer))))
 
 (defun dslide--keyword-value (key)



reply via email to

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