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

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

[nongnu] elpa/dslide e4beb23e57 002/230: Match breadcrumb separator to t


From: ELPA Syncer
Subject: [nongnu] elpa/dslide e4beb23e57 002/230: Match breadcrumb separator to text properties from previous heading
Date: Sun, 7 Jul 2024 19:00:06 -0400 (EDT)

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

    Match breadcrumb separator to text properties from previous heading
---
 org-tree-slide.el | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/org-tree-slide.el b/org-tree-slide.el
index 3a2d69efdf..16df67fa54 100644
--- a/org-tree-slide.el
+++ b/org-tree-slide.el
@@ -827,19 +827,28 @@ concat the headers."
   "Face for `org-tree-slide--header-overlay'."
   :group 'org-tree-slide)
 
+(defun org-tree-slide--breadcrumbs-reducer (delim)
+  (lambda (prev next)
+    (if (not prev) next
+      (let ((props (text-properties-at (1- (length prev)) prev)))
+        (concat prev
+                (apply #'propertize delim props)
+                next)))))
+
 (defun org-tree-slide--get-parents (&optional delim)
   "Get parent headings and concat them with DELIM."
   (setq delim (or delim " > "))
   (save-excursion
     (save-restriction
       (widen)
-      (let ((parents nil))
+      (let ((parents nil)
+            (reducer (org-tree-slide--breadcrumbs-reducer delim)))
         (while (org-up-heading-safe)
           (push (org-get-heading
                  'no-tags
                  org-tree-slide-breadcrumbs-hide-todo-state)
                 parents))
-        (mapconcat 'identity parents delim)))))
+        (seq-reduce reducer parents nil)))))
 
 (defun org-tree-slide--set-slide-header (blank-lines)
   "Set the header with overlay.



reply via email to

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