[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/dslide 3d52359eb9 066/230: Babel blocks can run multiple e
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/dslide 3d52359eb9 066/230: Babel blocks can run multiple end, init, and final blocks |
Date: |
Sun, 7 Jul 2024 19:00:16 -0400 (EDT) |
branch: elpa/dslide
commit 3d52359eb9a2c952e7edfc3d74ff078a8f24c82a
Author: Psionik K <73710933+psionic-k@users.noreply.github.com>
Commit: Psionik K <73710933+psionic-k@users.noreply.github.com>
Babel blocks can run multiple end, init, and final blocks
Much better code re-use. Examples all became much simpler.
Signed-off-by: Psionik K <73710933+psionic-k@users.noreply.github.com>
---
macro-slides.el | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/macro-slides.el b/macro-slides.el
index 51c7126208..cb672a9042 100644
--- a/macro-slides.el
+++ b/macro-slides.el
@@ -1793,8 +1793,9 @@ be special with the keyword:
Other than step-both, which executes in either step direction,
these keywords correspond to the normal methods of the stateful
-sequence class. For blocks that should not occur more than once,
-only the first block found will actually be executed.")
+sequence class. Blocks with method init, end, and final are all
+executed during the corresponding method and do not count as
+steps.")
(cl-defmethod ms--clear-results ((obj ms-action-babel))
(without-restriction
@@ -1827,7 +1828,7 @@ Optional UNNAMED will return unnamed blocks as well."
;; t for don't cache. We likely want effects
(org-babel-execute-src-block t))))
-(cl-defmethod ms--get-block ((obj ms-action-babel) &optional method-name)
+(cl-defmethod ms--get-blocks ((obj ms-action-babel) &optional method-name)
"Return the block with keyword value METHOD-NAME.
The keywords look like:
@@ -1836,7 +1837,7 @@ The keywords look like:
The possible values for METHOD-NAME correspond to the
stateful-sequence class methods. METHOD-NAME is a string."
(let ((predicate (ms--method-block-pred (list method-name))))
- (ms-section-map obj 'src-block predicate nil t)))
+ (ms-section-map obj 'src-block predicate)))
(cl-defmethod ms-step-forward ((obj ms-action-babel))
(when-let* ((predicate (ms--method-block-pred
@@ -1857,17 +1858,16 @@ stateful-sequence class methods. METHOD-NAME is a
string."
t)))
(cl-defmethod ms-init :after ((obj ms-action-babel))
- (when-let ((block-element (ms--get-block obj "init")))
- (ms--block-execute block-element)))
+ (when-let ((block-elements (ms--get-blocks obj "init")))
+ (mapc #'ms--block-execute block-elements)))
(cl-defmethod ms-end :after ((obj ms-action-babel))
- (when-let ((block-element (ms--get-block obj "end")))
- (ms--block-execute block-element)
- 'step))
+ (when-let ((block-elements (ms--get-blocks obj "end")))
+ (mapc #'ms--block-execute block-elements)))
(cl-defmethod ms-final :after ((obj ms-action-babel))
- (when-let ((block-element (ms--get-block obj "final")))
- (ms--block-execute block-element)))
+ (when-let ((block-elements (ms--get-blocks obj "final")))
+ (mapc #'ms--block-execute block-elements)))
;; ** Image Action
- [nongnu] elpa/dslide 0326d4d115 217/230: Fix mode check for dslide-develop command, (continued)
- [nongnu] elpa/dslide 0326d4d115 217/230: Fix mode check for dslide-develop command, ELPA Syncer, 2024/07/07
- [nongnu] elpa/dslide 5d1c50be3d 225/230: Add default to the header face specification, ELPA Syncer, 2024/07/07
- [nongnu] elpa/dslide 4be48e907b 228/230: dslide--overlays now public, ELPA Syncer, 2024/07/07
- [nongnu] elpa/dslide 45e93c645a 223/230: respect customize header option on slide narrow, ELPA Syncer, 2024/07/07
- [nongnu] elpa/dslide a58924cd8e 031/230: line noise, rearrangement, whitespace, minor tweaks, ELPA Syncer, 2024/07/07
- [nongnu] elpa/dslide 5cce77b4eb 032/230: some readme updates, ELPA Syncer, 2024/07/07
- [nongnu] elpa/dslide 86fb3a7e0d 056/230: Pass an :inline argument to every child action, ELPA Syncer, 2024/07/07
- [nongnu] elpa/dslide 280b028e11 065/230: !dirty, pre-refactor commit to comment on architecture, ELPA Syncer, 2024/07/07
- [nongnu] elpa/dslide aea35ee8e7 073/230: line-noise renaming, comments..., ELPA Syncer, 2024/07/07
- [nongnu] elpa/dslide 3945a6a759 061/230: assorted doc noise and one change to be consistent with docstring, ELPA Syncer, 2024/07/07
- [nongnu] elpa/dslide 3d52359eb9 066/230: Babel blocks can run multiple end, init, and final blocks,
ELPA Syncer <=
- [nongnu] elpa/dslide 997fc0905a 106/230: results none is preferable during presentation, ELPA Syncer, 2024/07/07
- [nongnu] elpa/dslide 2650f33a78 100/230: success & error highlights for babel slides, ELPA Syncer, 2024/07/07
- [nongnu] elpa/dslide a9052e5ae2 129/230: demo directions a bit more interactive and clear, ELPA Syncer, 2024/07/07
- [nongnu] elpa/dslide 56fde60604 120/230: dslide-contents-header -> dslide-header, ELPA Syncer, 2024/07/07
- [nongnu] elpa/dslide 98c9c95505 099/230: custom implementation of pulse, ELPA Syncer, 2024/07/07
- [nongnu] elpa/dslide 5c4728025e 111/230: dslide-backward -> dslide-presentation-backward, ELPA Syncer, 2024/07/07
- [nongnu] elpa/dslide e38a7ff5ac 125/230: Introduction in demo, ELPA Syncer, 2024/07/07
- [nongnu] elpa/dslide 4a85855383 133/230: remove redundant :after, ELPA Syncer, 2024/07/07
- [nongnu] elpa/dslide d6f732a080 145/230: collect animation code, use the centralized error indication, ELPA Syncer, 2024/07/07
- [nongnu] elpa/dslide 9cc2872b4b 050/230: update readme to reflect reality, ELPA Syncer, 2024/07/07