diff --git a/org-ql.el b/org-ql.el index c7b9ea3..db3fb85 100644 --- a/org-ql.el +++ b/org-ql.el @@ -429,7 +429,10 @@ Returns cons (INHERITED-TAGS . LOCAL-TAGS)." (defun org-ql--outline-path () "Return outline path for heading at point." (save-excursion - (let ((heading (nth 4 (org-heading-components)))) + (let ((heading (save-match-data + (if (looking-at org-complex-heading-regexp) + (or (match-string 4) "") + "")))) (if (org-up-heading-safe) ;; MAYBE: It seems wrong to call the cache function from ;; inside this function, like a violation of separation of