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

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

[nongnu] elpa/dslide 6d9ebfb79a 08/16: clean up propertize action for sh


From: ELPA Syncer
Subject: [nongnu] elpa/dslide 6d9ebfb79a 08/16: clean up propertize action for showing off
Date: Mon, 25 Nov 2024 01:00:02 -0500 (EST)

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

    clean up propertize action for showing off
    
    first draft was not something I would want others to emulate
---
 dslide.el | 30 +++++++++++++-----------------
 1 file changed, 13 insertions(+), 17 deletions(-)

diff --git a/dslide.el b/dslide.el
index 27d4076cab..f71916787d 100644
--- a/dslide.el
+++ b/dslide.el
@@ -1292,24 +1292,20 @@ for `dslide-contents-map'.")
 
 (cl-defmethod dslide-begin ((obj dslide-action-propertize))
   (dslide-section-map
-   obj t
+   obj t                                ; t for all types
    (lambda (e)
-     (when-let ((props (org-element-property
-                        :attr_dslide_propertize e)))
-       (let ((overlay (make-overlay (org-element-property :post-affiliated e)
-                                    (1- (org-element-property :end e))))
-             (props (car props))        ; TODO multi-value support
-             (offset 0))
-         (while offset
-           (let* ((prop (ignore-error end-of-file
-                          (read-from-string props offset)))
-                  (value (ignore-error end-of-file
-                           (read-from-string props (cdr prop)))))
-             (if (and prop value)
-                 (progn (overlay-put overlay (car prop) (car value))
-                        (setq offset (cdr value)))
-               (setq offset nil))))
-         (push overlay dslide-overlays))))))
+     (when-let ((keywords (org-element-property :attr_dslide_propertize e))
+                (overlay (make-overlay (org-element-property :post-affiliated 
e)
+                                       (1- (org-element-property :end e)))))
+       (while-let ((keyword (pop keywords))
+                   (offset 0))
+         (while-let ((prop (ignore-error end-of-file
+                             (read-from-string keyword offset)))
+                     (value (ignore-error end-of-file
+                              (read-from-string keyword (cdr prop)))))
+           (overlay-put overlay (car prop) (car value))
+           (setq offset (cdr value))))
+       (push overlay dslide-overlays)))))
 
 (cl-defmethod dslide-end ((obj dslide-action-propertize))
   (dslide-begin obj))



reply via email to

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