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

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

[nongnu] elpa/dslide d2217bc74f 07/16: Quick fix for TODO and tag hiding


From: ELPA Syncer
Subject: [nongnu] elpa/dslide d2217bc74f 07/16: Quick fix for TODO and tag hiding in contents
Date: Mon, 25 Nov 2024 01:00:02 -0500 (EST)

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

    Quick fix for TODO and tag hiding in contents
    
    Did not attempt to refactor this.  Duplicated code from the hide markup 
action.
---
 dslide.el | 29 +++++++++++++++++++++++------
 1 file changed, 23 insertions(+), 6 deletions(-)

diff --git a/dslide.el b/dslide.el
index e0818876c2..27d4076cab 100644
--- a/dslide.el
+++ b/dslide.el
@@ -3041,12 +3041,29 @@ each slide show from the contents view."
     ;; hide filtered headings
     (org-element-map data 'headline
       (lambda (e)
-        (unless (funcall filter e)
-          (let ((overlay (make-overlay
-                          (org-element-property :begin e)
-                          (org-element-property :end e))))
-            (overlay-put overlay 'display "\n")
-            (push overlay dslide-overlays))))
+        (when (= 1 (org-element-property :level e))
+          (if (funcall filter e)
+              ;; TODO Consolidate this with hide markup action
+              (progn
+                (when (or dslide-hide-tags dslide-hide-todo)
+                  (save-excursion
+                    (goto-char (org-element-property :begin e))
+                    (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))))
+            (let ((overlay (make-overlay
+                            (org-element-property :begin e)
+                            (org-element-property :end e))))
+              (overlay-put overlay 'display "\n")
+              (push overlay dslide-overlays)))))
       nil nil t)
     (goto-char
      (org-element-property :begin (dslide--root-heading-at-point filter)))



reply via email to

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