org-element-context: Fix when point is at the beginning of parsed value

* lisp/org-element.el (org-element-context): When point is at the
first point in parsed affiliated keyword value, do not return parent
"keyword".

Reported-by: Tom Gillespie <tgbugs@gmail.com>
Link: https://orgmode.org/list/CA+G3_PNt7WqkCzChV+dx1FeSPgTEVkNSE41a3qC5wv3g+jTwrQ@mail.gmail.com
This commit is contained in:
Ihor Radchenko 2023-08-16 11:06:08 +03:00
parent 99c8425bc7
commit 54c09c84e9
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B
1 changed files with 2 additions and 2 deletions

View File

@ -8140,9 +8140,9 @@ This function may modify match data."
(let ((case-fold-search t)) (looking-at org-element--affiliated-re))
(cond
((not (member-ignore-case (match-string 1)
org-element-parsed-keywords))
org-element-parsed-keywords))
(throw 'objects-forbidden element))
((< (match-end 0) pos)
((<= (match-end 0) pos)
(narrow-to-region (match-end 0) (line-end-position)))
((and (match-beginning 2)
(>= pos (match-beginning 2))