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

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

[nongnu] elpa/dslide 8837fd12a4 2/7: Options to hide tags and todos


From: ELPA Syncer
Subject: [nongnu] elpa/dslide 8837fd12a4 2/7: Options to hide tags and todos
Date: Wed, 20 Nov 2024 18:59:35 -0500 (EST)

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

    Options to hide tags and todos
---
 dslide.el     | 25 +++++++++++++++++++++++++
 test/demo.org |  2 ++
 2 files changed, 27 insertions(+)

diff --git a/dslide.el b/dslide.el
index b6ff7d4a6b..89186a903e 100644
--- a/dslide.el
+++ b/dslide.el
@@ -250,6 +250,14 @@ properties remain unless shadowed."
   "If non-nil, hide TODO states in the breadcrumbs."
   :type 'boolean)
 
+(defcustom dslide-hide-todo nil
+  "If non-nil, hide TODO states in headings."
+  :type 'boolean)
+
+(defcustom dslide-hide-tags nil
+  "If non-nil, hide tags in headings."
+  :type 'boolean)
+
 (defcustom dslide-animation-duration 1.0
   "How long slide in takes."
   :type 'number)
@@ -1209,6 +1217,23 @@ for `dslide-contents-map'.")
 (cl-defmethod dslide-begin ((obj dslide-action-hide-markup))
   (dslide-section-map obj dslide-hide-markup-types
                       (lambda (e) (push (dslide-hide-element e) 
dslide-overlays)))
+
+  ;; Hide tags and todo keywords
+  (when (or dslide-hide-tags dslide-hide-todo)
+    (save-excursion
+      (goto-char (org-element-property :begin (dslide-heading obj)))
+      (org-heading-components)))
+  (when dslide-hide-todo
+    (when-let* ((todo-beg (match-beginning 2))
+                (overlay (make-overlay (1- todo-beg) (match-end 2))))
+      (overlay-put overlay 'invisible t)
+      (push overlay dslide-overlays)))
+  (when dslide-hide-tags
+    (when-let* ((tags-beg (match-beginning 5))
+                (overlay (make-overlay (1- tags-beg) (match-end 5))))
+      (overlay-put overlay 'invisible t)
+      (push overlay 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.
diff --git a/test/demo.org b/test/demo.org
index 703cc45056..815617d092 100644
--- a/test/demo.org
+++ b/test/demo.org
@@ -135,6 +135,8 @@ There is a comment block above this paragraph.  There is a 
comment below this pa
 # There is a comment after this paragraph too.
 
 This is another case where you can use ~dslide-deck-develop~ to see the 
comments while showing just presentation content in another window.  (use 
~make-frame~ 💡)
+** TODO Todos and Tags :tag1:tag2:tag3:
+Todos and tags are by default hidden.  Set ~dslide-hide-tags~ and 
~dslide-hide-todos~ if you need them visible in a presentation.
 * Babel Integration
 :PROPERTIES:
 :DSLIDE_ACTIONS: dslide-action-babel



reply via email to

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