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

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

[nongnu] elpa/dslide 04b2888a52 192/230: Hide markup action hides affili


From: ELPA Syncer
Subject: [nongnu] elpa/dslide 04b2888a52 192/230: Hide markup action hides affiliated keywords
Date: Sun, 7 Jul 2024 19:00:37 -0400 (EDT)

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

    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 <73710933+psionic-k@users.noreply.github.com>
---
 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.
 



reply via email to

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