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

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

[nongnu] elpa/org-journal 1ea9e3b672 2/2: Merge pull request #399 from j


From: ELPA Syncer
Subject: [nongnu] elpa/org-journal 1ea9e3b672 2/2: Merge pull request #399 from jmay/ignore-top-props-drawer-2
Date: Tue, 20 Sep 2022 11:59:09 -0400 (EDT)

branch: elpa/org-journal
commit 1ea9e3b672ed384922ede6af96598446f3691873
Merge: 839a2e1986 844c7084c3
Author: Bastian Bechtold <bastibe@users.noreply.github.com>
Commit: GitHub <noreply@github.com>

    Merge pull request #399 from jmay/ignore-top-props-drawer-2
    
    don't break journaling if CREATED exists at file level #383
---
 org-journal.el | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/org-journal.el b/org-journal.el
index cf33f2baf0..61ff72d243 100644
--- a/org-journal.el
+++ b/org-journal.el
@@ -1061,6 +1061,14 @@ This is the counterpart of 
`org-journal--file-name->calendar-date' for
           (string-to-number (match-string 3 date))    ;; Day
           (string-to-number (match-string 1 date))))) ;; Year
 
+(defun org-journal--skip-meta-data ()
+  "Advance point past any file-level properties drawer.
+
+Extracted from org-roam (org-roam-end-of-meta-data)."
+  (when (looking-at org-property-drawer-re)
+    (goto-char (match-end 0))
+    (forward-line)))
+
 (defun org-journal--file->calendar-dates (file)
   "Return journal dates from FILE."
   (org-journal--with-journal
@@ -1068,6 +1076,7 @@ This is the counterpart of 
`org-journal--file-name->calendar-date' for
     (let (dates)
       (save-excursion
         (goto-char (point-min))
+        (org-journal--skip-meta-data)
         (while (re-search-forward org-journal--created-re nil t)
           (when (= (save-excursion (org-back-to-heading) (org-outline-level)) 
1)
             (push (org-journal--entry-date->calendar-date) dates)))



reply via email to

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