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

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

[nongnu] elpa/dslide 1eda39cbd0 3/7: When no slide action is present, ex


From: ELPA Syncer
Subject: [nongnu] elpa/dslide 1eda39cbd0 3/7: When no slide action is present, execute a forward step
Date: Wed, 20 Nov 2024 18:59:35 -0500 (EST)

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

    When no slide action is present, execute a forward step
    
    This prevents situations where the user calls forward and nothing happens.
---
 dslide.el | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/dslide.el b/dslide.el
index 89186a903e..3fe75ce91a 100644
--- a/dslide.el
+++ b/dslide.el
@@ -901,18 +901,22 @@ the slide object coordinates this overlap.  It delegates 
the
 order.")
 
 (cl-defmethod dslide-begin ((obj dslide-slide))
-  (prog1 (when-let ((slide-action (oref obj slide-action)))
-           (dslide-begin slide-action))
-    (mapc #'dslide-begin (oref obj section-actions))))
+  (let* ((slide-action (oref obj slide-action))
+         (progress (when slide-action (dslide-begin slide-action))))
+    (mapc #'dslide-begin (oref obj section-actions))
+    (if slide-action progress
+      (dslide-forward obj))))
 
 (cl-defmethod dslide-end ((obj dslide-slide))
-  (prog1 (when-let ((slide-action (oref obj slide-action)))
-           (dslide-end slide-action))
+  (let* ((slide-action (oref obj slide-action))
+         (progress (dslide-end slide-action)))
     ;; Fairly certain the ordering of slide and section actions won't normally
     ;; matter for `dslide-end', but this ordering matches the situation that 
would
     ;; occur if the user just called `dslide-forward' repeatedly, and we want 
the
     ;; end state to be as close to "normal" as possible.
-    (mapc #'dslide-end (reverse (oref obj section-actions)))))
+    (mapc #'dslide-end (oref obj section-actions))
+    (if slide-action progress
+      (dslide-backward obj))))
 
 (cl-defmethod dslide-final ((obj dslide-slide))
   ;; The order that these are called shouldn't matter.  No use case for 
coupling



reply via email to

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