From 6266197bbda4e78ab729848aa5f0088edb0a5bcf Mon Sep 17 00:00:00 2001 From: Ihor Radchenko Date: Sun, 7 May 2023 10:02:18 +0200 Subject: [PATCH] org-at-item-p: Use org-element API --- lisp/org-list.el | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lisp/org-list.el b/lisp/org-list.el index 0713b4021..2c3fa4b74 100644 --- a/lisp/org-list.el +++ b/lisp/org-list.el @@ -485,11 +485,18 @@ group 4: description tag") (forward-line -1)) (t (forward-line -1))))))))))) +;; FIXME: We should make use of org-element API in more places here. (defun org-at-item-p () - "Is point in a line starting a hand-formatted item?" + "Is point in a line starting a hand-formatted item? +Modify match data, matching against `org-item-re'." (save-excursion (beginning-of-line) - (and (looking-at (org-item-re)) (org-list-in-valid-context-p)))) + (and + (org-element-type-p + (org-element-at-point) + '(plain-list item)) + ;; Set match data. + (looking-at (org-item-re))))) (defun org-at-item-bullet-p () "Is point at the bullet of a plain list item?"