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

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

[elpa] externals/org e305755b1a: org-element: Parse malformed clock line


From: ELPA Syncer
Subject: [elpa] externals/org e305755b1a: org-element: Parse malformed clock lines as paragraphs
Date: Wed, 5 Oct 2022 00:57:50 -0400 (EDT)

branch: externals/org
commit e305755b1a7ac41c74ebf9a39e8b9d547acb523d
Author: Ihor Radchenko <yantar92@gmail.com>
Commit: Ihor Radchenko <yantar92@gmail.com>

    org-element: Parse malformed clock lines as paragraphs
    
    * lisp/org-element.el (org-element-clock-line-re): Update the regexp
    matching the actual required clock line structure.
    (org-element--set-regexps): Use `org-element-clock-line-re'.
    
    Link: https://orgmode.org/list/87h7571bpb.fsf@localhost
---
 lisp/org-element.el | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/lisp/org-element.el b/lisp/org-element.el
index ff089e1adf..0216558eec 100644
--- a/lisp/org-element.el
+++ b/lisp/org-element.el
@@ -126,7 +126,15 @@ Key is located in match group 1.")
 Style, if any, is located in match group 1.")
 
 (defconst org-element-clock-line-re
-  (rx line-start (0+ (or ?\t ?\s)) "CLOCK:")
+  (rx line-start (0+ (or ?\t ?\s))
+      "CLOCK: "
+      (regexp org-ts-regexp-inactive)
+      (opt "--"
+           (regexp org-ts-regexp-inactive)
+           (1+ (or ?\t ?\s)) "=>" (1+ (or ?\t ?\s))
+           (1+ digit) ":" digit digit)
+      (0+ (or ?\t ?\s))
+      line-end)
   "Regexp matching a clock line.")
 
 (defconst org-element-comment-string "COMMENT"
@@ -219,7 +227,7 @@ specially in `org-element--object-lex'.")
                ;; LaTeX environments.
                "\\\\begin{\\([A-Za-z0-9*]+\\)}" "\\|"
                ;; Clock lines.
-               "CLOCK:" "\\|"
+               org-element-clock-line-re "\\|"
                ;; Lists.
                (let ((term (pcase org-plain-list-ordered-item-terminator
                              (?\) ")") (?. "\\.") (_ "[.)]")))



reply via email to

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