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

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

[nongnu] elpa/dslide 31fc027f52 057/230: !temporary basic composition su


From: ELPA Syncer
Subject: [nongnu] elpa/dslide 31fc027f52 057/230: !temporary basic composition support
Date: Sun, 7 Jul 2024 19:00:15 -0400 (EDT)

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

    !temporary basic composition support
    
    Experimenting with sometimes containing the child action within the slide
    action.  This slight nuance is useful for scripting babel that just needs 
to run
    on the contents of the parent.
    
    Signed-off-by: Psionik K <73710933+psionic-k@users.noreply.github.com>
---
 macro-slides.el | 21 +++++++++++++++------
 1 file changed, 15 insertions(+), 6 deletions(-)

diff --git a/macro-slides.el b/macro-slides.el
index 1fad6ab7b4..42347bc621 100644
--- a/macro-slides.el
+++ b/macro-slides.el
@@ -1193,7 +1193,12 @@ lifecycle.  See `ms-default-section-actions'.")
 See `ms-default-child-action'.")
    (begin
     :initform nil :initarg :begin
-    :documentation "Marker for retrieving this heading's org element."))
+    :documentation "Marker for retrieving this heading's org element.")
+   (compose
+    :initform nil :initarg :compose
+    :documentation "Run child actions within the slide action.
+This is a temporary solution to support a basic form of action
+composition, Running actions as sequences within other actions."))
   "Slides store some local state and delegate behavior to several
 functions. The Slide is a stateful node that hydrates around a
 heading and stores actions and their states.")
@@ -1246,13 +1251,17 @@ heading and stores actions and their states.")
 
 (cl-defmethod ms-step-backward ((obj ms-slide))
   (let ((section-actions (reverse (oref obj section-actions)))
+        (child-action (oref obj child-action))
+        (slide-action (oref obj slide-action))
         progress)
     ;; section display action happens before any section-actions
-    (setq progress (or (when-let ((child-action (oref obj child-action)))
-                         (ms-step-backward child-action))
-                       (when-let ((display-action
-                                   (oref obj slide-action)))
-                         (ms-step-backward display-action))))
+
+    (setq progress
+          (if (oref obj compose)
+              (or (when slide-action (ms-step-backward slide-action))
+                  (when child-action (ms-step-backward child-action)))
+            (or (when child-action (ms-step-backward child-action))
+                (when slide-action (ms-step-backward slide-action)))))
     (while (and (not progress)
                 section-actions)
       (let ((action (pop section-actions)))



reply via email to

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