org-element-clock-parser: Do not be case-sensitive
* lisp/org-element.el (org-element-clock-parser): Fix demanding upcased "CLOCK:" string. As per general Org mode syntax principle, keywords in Org mode are case-insensitive. * testing/lisp/test-org-element.el (test-org-element/clock-parser): Add test. Reported-by: Gregor Zattler <telegraph@gmx.net> Link: https://orgmode.org/list/875xx8mvvn.fsf@no.lan
This commit is contained in:
parent
990b89d324
commit
3f20e32f8e
|
@ -2291,9 +2291,8 @@ Return a new syntax node of `clock' type containing `:status',
|
|||
`:value', `:time', `:begin', `:end', `:post-blank' and
|
||||
`:post-affiliated' as properties."
|
||||
(save-excursion
|
||||
(let* ((case-fold-search nil)
|
||||
(begin (point))
|
||||
(value (progn (search-forward "CLOCK:" (line-end-position) t)
|
||||
(let* ((begin (point))
|
||||
(value (progn (search-forward "CLOCK:" (line-end-position))
|
||||
(skip-chars-forward " \t")
|
||||
(org-element-timestamp-parser)))
|
||||
(duration (and (search-forward " => " (line-end-position) t)
|
||||
|
|
|
@ -1157,6 +1157,15 @@ CLOCK: [2023-10-13 Fri 14:40]--[2023-10-13 Fri 14:51] => 0:11"
|
|||
(org-element-property :value clock))
|
||||
"[2012-01-01 sun. 00:01]"))
|
||||
(should-not (org-element-property :duration clock)))
|
||||
;; clock string should not be case-sensitive.
|
||||
(let ((clock (org-test-with-temp-text "Clock: [2012-01-01 sun. 00:01]"
|
||||
(org-element-at-point))))
|
||||
(should (eq (org-element-property :status clock) 'running))
|
||||
(should
|
||||
(equal (org-element-property :raw-value
|
||||
(org-element-property :value clock))
|
||||
"[2012-01-01 sun. 00:01]"))
|
||||
(should-not (org-element-property :duration clock)))
|
||||
;; Closed clock.
|
||||
(let ((clock
|
||||
(org-test-with-temp-text
|
||||
|
|
Loading…
Reference in New Issue