[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/dslide 45a9620a54 054/230: babel blocks can now be used in
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/dslide 45a9620a54 054/230: babel blocks can now be used in both directions |
Date: |
Sun, 7 Jul 2024 19:00:15 -0400 (EDT) |
branch: elpa/dslide
commit 45a9620a54f082909166481f9e2f3131f80b3bfd
Author: Psionik K <73710933+psionic-k@users.noreply.github.com>
Commit: Psionik K <73710933+psionic-k@users.noreply.github.com>
babel blocks can now be used in both directions
lebelling is easier with the "ATTR_METHODS" style.
These could accept arguments later with the same parsing style as used by
actions
Signed-off-by: Psionik K <73710933+psionic-k@users.noreply.github.com>
---
macro-slides.el | 33 +++++++++++++++++++--------------
1 file changed, 19 insertions(+), 14 deletions(-)
diff --git a/macro-slides.el b/macro-slides.el
index d30694fd8f..335b398bef 100644
--- a/macro-slides.el
+++ b/macro-slides.el
@@ -1618,17 +1618,20 @@ deck of progress was made.")
By default blocks execute one by one with step-forward. You can mark a block
to
be special with the keyword:
-- #+attr_method: init
+- #+attr_methods: init
-- #+attr_method: step-forward
+- #+attr_methods: step-forward
-- #+attr_method: step-backward
+- #+attr_methods: step-backward
-- #+attr_method: end
+- #+attr_methods: step-both
-- #+attr_method: final
+- #+attr_methods: end
-These keywords correspond to the normal methods of the stateful
+- #+attr_methods: final
+
+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.")
@@ -1642,12 +1645,14 @@ only the first block found will actually be executed.")
(org-babel-remove-result-one-or-many nil))))))
(defun ms--method-block-pred
- (method-name &optional unnamed)
+ (method-names &optional unnamed)
"Return a predicate to match the METHOD-NAME.
Optional UNNAMED will return unnamed blocks as well."
(lambda (block)
- (if-let ((names (org-element-property :attr_method block)))
- (when (member method-name names)
+ (if-let* ((all-names (car (org-element-property
+ :attr_methods block)))
+ (names (string-split all-names)))
+ (when (seq-intersection method-names names)
block)
(when unnamed
block))))
@@ -1661,19 +1666,19 @@ Optional UNNAMED will return unnamed blocks as well."
(cl-defmethod ms--get-block
((obj ms-action) &optional method-name)
- "Execute the block with keyword value METHOD-NAME.
+ "Return the block with keyword value METHOD-NAME.
The keywords look like:
-#+attr_method: METHOD-NAME
+#+attr_methods: METHOD-NAME
The possible values for METHOD-NAME correspond to the
stateful-sequence class methods. METHOD-NAME is a string."
- (let ((predicate (ms--method-block-pred method-name)))
+ (let ((predicate (ms--method-block-pred (list method-name))))
(ms-section-map obj 'src-block predicate nil t)))
(cl-defmethod ms-step-forward ((obj ms-action-babel))
(when-let* ((predicate (ms--method-block-pred
- "step-forward" t))
+ '("step-forward" "step-both") t))
(next (ms-section-next obj 'src-block predicate)))
(or (ms--block-execute next)
;; If we found a next block, we made progress regardless of the block's
@@ -1682,7 +1687,7 @@ stateful-sequence class methods. METHOD-NAME is a
string."
(cl-defmethod ms-step-backward ((obj ms-action-babel))
(when-let* ((predicate (ms--method-block-pred
- "step-backward"))
+ '("step-backward" "step-both")))
(prev (ms-section-previous obj 'src-block predicate)))
(or (ms--block-execute prev)
;; If we found a previous block, we made progress regardless of the
- [nongnu] elpa/dslide 1a6fe7f61c 068/230: Just some readme and comment updates, (continued)
- [nongnu] elpa/dslide 1a6fe7f61c 068/230: Just some readme and comment updates, ELPA Syncer, 2024/07/07
- [nongnu] elpa/dslide 198a80255b 072/230: move lifecycle & commands to end of package, ELPA Syncer, 2024/07/07
- [nongnu] elpa/dslide f130bedeab 078/230: Update readme, rearrange some demo headlines, bump minor version, ELPA Syncer, 2024/07/07
- [nongnu] elpa/dslide 0a59731410 075/230: Navigation from contents to same heading, ELPA Syncer, 2024/07/07
- [nongnu] elpa/dslide dc5d0b965e 119/230: disinformation cleanup, a few lingering ms symbols, ELPA Syncer, 2024/07/07
- [nongnu] elpa/dslide a8f7174ef3 095/230: dead expression, ELPA Syncer, 2024/07/07
- [nongnu] elpa/dslide f24e5b8538 088/230: Rename argument, display-action -> display, ELPA Syncer, 2024/07/07
- [nongnu] elpa/dslide 18e079c83f 113/230: Clean up misinformation & propagate naming, ELPA Syncer, 2024/07/07
- [nongnu] elpa/dslide 4af6955e23 090/230: missing feedback on last slide, ELPA Syncer, 2024/07/07
- [nongnu] elpa/dslide 8bc5783536 051/230: Sorry taka. It's been a good 13 years of org-tree-slide, ELPA Syncer, 2024/07/07
- [nongnu] elpa/dslide 45a9620a54 054/230: babel blocks can now be used in both directions,
ELPA Syncer <=
- [nongnu] elpa/dslide f3ae2af0cc 039/230: changed sequence-callbacks to not include sequence as a key, ELPA Syncer, 2024/07/07
- [nongnu] elpa/dslide 015796186f 048/230: !fixme Not sure if this is necessary. Shipping my last tested., ELPA Syncer, 2024/07/07
- [nongnu] elpa/dslide 4e2086e49e 034/230: rename display-state -> slide-buffer-state, ELPA Syncer, 2024/07/07
- [nongnu] elpa/dslide 30196efe70 010/230: The header overlay should be buffer local, ELPA Syncer, 2024/07/07
- [nongnu] elpa/dslide e75488d7ac 018/230: rearrange, ELPA Syncer, 2024/07/07
- [nongnu] elpa/dslide cf56e034ff 008/230: Overlays for selective display of contents, ELPA Syncer, 2024/07/07
- [nongnu] elpa/dslide 39a9045682 011/230: Simplify blank-lines expression using make-string, ELPA Syncer, 2024/07/07
- [nongnu] elpa/dslide 0316764255 006/230: moving a comment, automatic formatting, ELPA Syncer, 2024/07/07
- [nongnu] elpa/dslide 3969814eb4 015/230: rearrangement, ELPA Syncer, 2024/07/07
- [nongnu] elpa/dslide a0460d4070 012/230: Return early by user-error when not in org-tree-slide-mode, ELPA Syncer, 2024/07/07