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

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

[nongnu] elpa/dslide 46ffb0114a 1/7: Header margins


From: ELPA Syncer
Subject: [nongnu] elpa/dslide 46ffb0114a 1/7: Header margins
Date: Wed, 20 Nov 2024 18:59:34 -0500 (EST)

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

    Header margins
    
    - enable partial line height
    - fix the white space in edge cases
---
 dslide.el | 38 +++++++++++++++++++++++---------------
 1 file changed, 23 insertions(+), 15 deletions(-)

diff --git a/dslide.el b/dslide.el
index 3d9b1d150d..b6ff7d4a6b 100644
--- a/dslide.el
+++ b/dslide.el
@@ -2272,40 +2272,48 @@ from existing state cleanup."
                      (format-time-string "%Y-%m-%d")))
            (email (when-let ((email (or dslide-email
                                         (cadr (assoc-string "EMAIL" 
keywords)))))
-                    (concat "<" email ">"))))
-
-      ;;  The calls to `propertize' make up for the fact that these values may 
be
-      ;;  strings, set from elsewhere, but we want to display these strings as 
if
-      ;;  they were fontified within the buffer.
+                    (concat "<" email ">")))
+           (info-line (concat
+                       (when (and  dslide-header-date date)
+                         (dslide--info-face (concat date "  ")))
+                       (when (and  dslide-header-author author)
+                         (dslide--info-face (concat author "  ")))
+                       (when (and  dslide-header-email email)
+                         (dslide--info-face (concat email "  ")))))
+           (info-line (when info-line
+                        (concat info-line (dslide--info-face "\n")))))
+
+      ;;  The calls to `propertize' are needed in case the strings are
+      ;;  specified without properties they normally would have when gathered
+      ;;  from the fontified buffer text.
       (if dslide-header
           (overlay-put
            dslide--header-overlay 'before-string
            (concat (dslide--margin-lines dslide-margin-title-above)
                    (propertize title 'face '(org-document-title default))
                    (dslide--margin-lines dslide-margin-title-below)
-                   (when (and  dslide-header-date date)
-                     (dslide--info-face (concat date "  ")))
-                   (when (and  dslide-header-author author)
-                     (dslide--info-face (concat author "  ")))
-                   (when (and  dslide-header-email email)
-                     (dslide--info-face (concat email "  ")))
+                   info-line
                    (when (and breadcrumbs
                               dslide-breadcrumb-separator)
-                     (concat (dslide--info-face "\n")
-                             (dslide--get-parents
+                     (concat (dslide--get-parents
                               dslide-breadcrumb-separator)))
+                   (dslide--info-face "\n")
                    (dslide--margin-lines dslide-margin-content)))
 
         (overlay-put dslide--header-overlay 'before-string
                      (dslide--margin-lines dslide-margin-content))))))
 
 (defun dslide--info-face (s)
-  (propertize s 'face '(org-document-info default)))
+  (prog1 s (add-face-text-property
+            0 (length s) '(org-document-info default) t s)))
 
 (defun dslide--margin-lines (lines)
   (dslide--info-face
    (if (display-graphic-p)
-       (propertize "\n" 'line-height (float lines))
+       (propertize "\n"
+                   'line-height (float lines)
+                   'face (when (< lines 1.0)
+                           (list :height lines)))
      (make-string (floor lines) ?\n))))
 
 (defun dslide--breadcrumbs-reducer (delim)



reply via email to

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