branch: elpa/dslide
commit 04b2888a529545d91acbd4f766b9013ce4c936c0
Author: Psionik K <[email protected]>
Commit: Psionik K <[email protected]>
Hide markup action hides affiliated keywords
Also removed old advice to use mc's mc-hide-markup-mode
Really wish the parser would just give me the affiliated keywords
Signed-off-by: Psionik K <[email protected]>
---
dslide.el | 15 +++++++++++++--
test/demo.org | 2 --
2 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/dslide.el b/dslide.el
index eadf21394d..44ebe7874c 100644
--- a/dslide.el
+++ b/dslide.el
@@ -1181,14 +1181,25 @@ for `dslide-contents-map'."
;; ** Hide Markup Action
(defclass dslide-action-hide-markup (dslide-action)
((types
- :initform '(drawer property-drawer keyword)
+ :initform '(drawer property-drawer)
:initarg :types
:description "Either org element or types that should be hidden."))
"Hides element based on type.")
(cl-defmethod dslide-begin ((obj dslide-action-hide-markup))
(dslide-section-map obj (oref obj types)
- (lambda (e) (push (dslide-hide-element e)
dslide--overlays))))
+ (lambda (e) (push (dslide-hide-element e)
dslide--overlays)))
+ ;; Ooooh! right, yeah, the element parser doesn't give you affiliated
keywords
+ ;; when you ask for keywords. As much sense as that would make, the only
+ ;; technique I've found for this is falling back to regex.
+ (save-excursion
+ (let ((bound (org-element-property :end (dslide-heading obj))))
+ (goto-char (oref obj begin))
+ (while (re-search-forward org-keyword-regexp bound t)
+ (let ((overlay (make-overlay (match-beginning 0)
+ (1+ (match-end 0)))))
+ (overlay-put overlay 'invisible t)
+ (push dslide--overlays overlay))))))
(cl-defmethod dslide-end ((obj dslide-action-hide-markup))
(dslide-begin obj))
diff --git a/test/demo.org b/test/demo.org
index fb6379dce9..efd52095a5 100644
--- a/test/demo.org
+++ b/test/demo.org
@@ -263,8 +263,6 @@ If a feature seems like it's missing, it can probably be
added. There is a babe
View customize variables by calling =M-x customize-group RET dslide=
** Slide Actions
Slide actions are configured using the heading's property drawer.
-** Hiding Markup
-Check out ~mc-hide-markup-mode~ in the
[[https://github.com/positron-solutions/master-of-ceremonies][master-of-ceremonies]]
package.
** Steezing Org
The setup used for the Positron's YouTube demos is not much more complex than
this well-documented setup by
[[https://systemcrafters.net/emacs-tips/presentations-with-org-present/][System
Crafters]]. Also see Prot's
[[https://protesilaos.com/codelog/2020-07-17-emacs-mixed-fonts-org/][further]]
documentation on customizing org mode faces and fonts.