branch: elpa/dslide commit bf99a7df69fbc3f8914ca0a1ba6b1b059395c841 Author: Psionik K <73710933+psioni...@users.noreply.github.com> Commit: Psionik K <73710933+psioni...@users.noreply.github.com>
attr_methods -> atter_ms Using the package prefix is more appopriate. Affiliated keywords are evidently namespaced to the export backend. I guess macro slides is a backend. Signed-off-by: Psionik K <73710933+psioni...@users.noreply.github.com> --- README.org | 2 +- macro-slides.el | 16 ++++++++-------- test/demo.org | 32 ++++++++++++++++---------------- 3 files changed, 25 insertions(+), 25 deletions(-) diff --git a/README.org b/README.org index 6ed0c4ba8c..2f39a79d4e 100644 --- a/README.org +++ b/README.org @@ -160,7 +160,7 @@ The default classes and actions can be configured at the document or customize l ** Babel Scripting You can write custom scripts into your presentation as Org Babel blocks. These can be executed with the ~ms-action-babel~ action. You just need to label your blocks with lifecycle methods if you want to be able to go forwards and backwards. See the ~ms-action-babel~ class and examples in [[./test/demo.org]]. -The =#+attr_methods:= affiliated keyword is used to configure which methods will run the block. Block labels that are understood: +The =#+attr_ms:= affiliated keyword is used to configure which methods will run the block. Block labels that are understood: - =init= and =end= are run when the slide is instantiated, going forward and backward respectively. You can have several blocks with these methods, and they will be run from *top-to-bottom* always, making it easier to re-use code usually. diff --git a/macro-slides.el b/macro-slides.el index e2fd37f01e..755a258002 100644 --- a/macro-slides.el +++ b/macro-slides.el @@ -1327,17 +1327,17 @@ 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_methods: init +- #+attr_ms: init -- #+attr_methods: step-forward +- #+attr_ms: step-forward -- #+attr_methods: step-backward +- #+attr_ms: step-backward -- #+attr_methods: step-both +- #+attr_ms: step-both -- #+attr_methods: end +- #+attr_ms: end -- #+attr_methods: final +- #+attr_ms: final Other than step-both, which executes in either step direction, these keywords correspond to the normal methods of the stateful @@ -1360,7 +1360,7 @@ steps.") Optional UNNAMED will return unnamed blocks as well." (lambda (block) (if-let* ((all-names (car (org-element-property - :attr_methods block))) + :attr_ms block))) (names (string-split all-names))) (when (seq-intersection method-names names) block) @@ -1410,7 +1410,7 @@ Optional UNNAMED will return unnamed blocks as well." "Return the block with keyword value METHOD-NAME. The keywords look like: -#+attr_methods: METHOD-NAME +#+attr_ms: METHOD-NAME The possible values for METHOD-NAME correspond to the stateful-sequence class methods. METHOD-NAME is a string." diff --git a/test/demo.org b/test/demo.org index 1e482c2faf..85b81edf17 100644 --- a/test/demo.org +++ b/test/demo.org @@ -69,7 +69,7 @@ This is an image slide. You can view the images inline using ~org-toggle-inline Both backwards and forward are supported on this slide. -#+attr_methods: init end +#+attr_ms: init end #+begin_src elisp :results none (setq-local overlays nil) (goto-char (point-min)) @@ -79,27 +79,27 @@ Both backwards and forward are supported on this slide. (push overlay overlays))) #+end_src -#+attr_methods: step-backward +#+attr_ms: step-backward #+begin_src elisp :results none (mapc (lambda (o) (overlay-put o 'display nil)) overlays) #+end_src -#+attr_methods: step-both +#+attr_ms: step-both #+begin_src elisp :results none (mapc (lambda (o) (overlay-put o 'display "🥞")) overlays) #+end_src -#+attr_methods: step-both +#+attr_ms: step-both #+begin_src elisp :results none (mapc (lambda (o) (overlay-put o 'display "🥞🥞")) overlays) #+end_src -#+attr_methods: step-forward end +#+attr_ms: step-forward end #+begin_src elisp :results none (mapc (lambda (o) (overlay-put o 'display "🥞🥞🥞")) overlays) #+end_src -#+attr_methods: final +#+attr_ms: final #+begin_src elisp :results none (mapc #'delete-overlay overlays) (makunbound 'overlays) @@ -118,7 +118,7 @@ These three org blocks will not be displayed since this slide has no slide actio - Blocks can have methods - Multiple blocks can have the init, end, and final method. They are always executed top to bottom. This allows better code re-use. -#+attr_methods: end init +#+attr_ms: end init #+begin_src elisp :results none ;; No need to deal with restriction or restore point. (org-up-heading-safe) @@ -129,7 +129,7 @@ These three org blocks will not be displayed since this slide has no slide actio #+end_src Some extra init can also be returned to with step backwards -#+attr_methods: init step-backward +#+attr_ms: init step-backward #+begin_src elisp :results none (overlay-put ms-can-has-overlay 'after-string (propertize " No display! Only execute!" @@ -137,7 +137,7 @@ Some extra init can also be returned to with step backwards #+end_src When going backwards, we begin at the end, which can also be stepped forwards to -#+attr_methods: step-forward end +#+attr_ms: step-forward end #+begin_src elisp :results none (overlay-put ms-can-has-overlay 'after-string (propertize " No display! Only execute!" @@ -145,7 +145,7 @@ When going backwards, we begin at the end, which can also be stepped forwards to #+end_src Our cleanup is always run -#+attr_methods: final +#+attr_ms: final #+begin_src elisp :results none (when (bound-and-true-p ms-can-has-overlay) (delete-overlay ms-can-has-overlay) @@ -158,29 +158,29 @@ Our cleanup is always run - Let arbitrary buffers be shown while still completing steps within the slide-show - Run babel against other buffers 😈 -#+attr_methods: init +#+attr_ms: init #+begin_src elisp :results none (require 'master-of-ceremonies) #+end_src -#+attr_methods: final step-backward +#+attr_ms: final step-backward #+begin_src elisp :results none (when-let ((buffer (get-buffer "*MC Focus*"))) (kill-buffer buffer)) #+end_src -#+attr_methods: step-both +#+attr_ms: step-both #+begin_src elisp :results none (mc-focus "🖊️") #+end_src -#+attr_methods: step-both +#+attr_ms: step-both #+begin_src elisp :results none (mc-focus "🖊️🍍") #+end_src -#+attr_methods: step-both +#+attr_ms: step-both #+begin_src elisp :results none (mc-focus "🖊️🍍🍎") #+end_src -#+attr_methods: step-both +#+attr_ms: step-both #+begin_src elisp :results none (mc-focus "🖊️🍍🍎🖊️") #+end_src