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

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

[nongnu] elpa/org-tree-slide 9d15bd9fa1 113/144: Add support for date he


From: ELPA Syncer
Subject: [nongnu] elpa/org-tree-slide 9d15bd9fa1 113/144: Add support for date header
Date: Tue, 18 Jan 2022 08:59:53 -0500 (EST)

branch: elpa/org-tree-slide
commit 9d15bd9fa1005b73ec40a5a837f2b3bd1d633b9e
Author: Norman Walsh <ndw@nwalsh.com>
Commit: Norman Walsh <ndw@nwalsh.com>

    Add support for date header
---
 org-tree-slide.el | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/org-tree-slide.el b/org-tree-slide.el
index dede32cfa6..71073834fa 100644
--- a/org-tree-slide.el
+++ b/org-tree-slide.el
@@ -708,6 +708,9 @@ If HEADING-LEVEL is non-nil, the provided outline level is 
checked."
 (defvar org-tree-slide-author nil
   "If you have \"#+author:\" line in your org buffer, it will be used as a 
name of the slide author.")
 
+(defvar org-tree-slide-date nil
+  "If you have \"#+date:\" line in your org buffer, it will be used as the 
date.")
+
 (defcustom org-tree-slide-breadcrumbs " > "
   "Display breadcrumbs in the slide header.
 
@@ -733,6 +736,15 @@ concat the headers."
        'org-tree-slide-author "#\\+AUTHOR:[ \t]*\\(.*\\)$" limit)
       (org-tree-slide--set-header-var-by-regxep
        'org-tree-slide-email "#\\+EMAIL:[ \t]*\\(.*\\)$" limit)
+
+      ; Use the date header or the current date if there isn't one
+      (setq org-tree-slide-date nil)
+      (org-tree-slide--set-header-var-by-regxep
+       'org-tree-slide-date "#\\+DATE:[ \t]*\\(.*\\)$" limit)
+      (if (not org-tree-slide-date)
+          (setq org-tree-slide-date
+                (format-time-string "%Y-%m-%d")))
+
       (org-tree-slide--set-header-var-by-regxep
        'org-tree-slide-startup "#\\+STARTUP:[ \t]*\\(.*\\)$" limit))))
 
@@ -778,7 +790,7 @@ Some number of BLANK-LINES will be shown below the header."
                    (concat (if org-tree-slide-title org-tree-slide-title
                              (buffer-name))
                            "\n"
-                           (format-time-string "%Y-%m-%d") "  "
+                           org-tree-slide-date "  "
                            (when org-tree-slide-author
                              (concat org-tree-slide-author "  "))
                            (when org-tree-slide-email



reply via email to

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