ENH make buffer scanning line re more precise

This commit is contained in:
Nathan Dwarshuis 2022-03-27 12:22:59 -04:00
parent 65389c6611
commit 9b9fd44a77
1 changed files with 4 additions and 5 deletions

View File

@ -1259,8 +1259,8 @@ A date like (YEAR MONTH DAY).")
(defun org-x-dag-line-regexp (kws) (defun org-x-dag-line-regexp (kws)
(let ((level-re "\\(\\*+\\)") (let ((level-re "\\(\\*+\\)")
(kw-re (format "\\(%s\\)?" (s-join "\\|" kws))) (kw-re (format "\\(%s\\)?" (s-join "\\|" kws)))
(title-re "\\(.*?\\)?") (title-re "\\(?:[ ]*\\([^\n]+?\\)\\)??")
(tag-re "\\(?:\\([[:alnum:]_@#%%:]+\\):\\)?")) (tag-re "\\(?:[ ]*:\\([[:alnum:]_@#%%:]+\\):\\)?"))
(format "^%s[ ]+%s%s%s[ ]*$" level-re kw-re title-re tag-re))) (format "^%s[ ]+%s%s%s[ ]*$" level-re kw-re title-re tag-re)))
(defconst org-x-dag-prop-drawer-re (defconst org-x-dag-prop-drawer-re
@ -1350,8 +1350,7 @@ used for optimization."
((and this-todo ((and this-todo
(setq this-pblock (org-x-dag-property-block next-pos) (setq this-pblock (org-x-dag-property-block next-pos)
this-id (org-x-dag-get-local-property this-pblock id-prop))) this-id (org-x-dag-get-local-property this-pblock id-prop)))
(setq bury-level nil (setq bury-level nil)
this-tags nil)
(when this-tags (when this-tags
(setq this-tags (split-string this-tags ":" t))) (setq this-tags (split-string this-tags ":" t)))
(when (and (not node-level) bare-stack) (when (and (not node-level) bare-stack)
@ -1369,7 +1368,7 @@ used for optimization."
:point this-point :point this-point
:level this-level :level this-level
:todo this-todo :todo this-todo
:title (if this-title (s-trim-right this-title) "") :title (or this-title "")
:tags this-tags :tags this-tags
:planning (->> (car this-pblock) :planning (->> (car this-pblock)
(org-x-dag-parse-this-planning)) (org-x-dag-parse-this-planning))