Fix: (--outline-path) Always return a string
org-heading-components returns nil for a heading without heading text, which causes string-match to signal an error. So we'll match the regexp ourselves and return an empty string in that case. Should be slightly faster, anyway.
This commit is contained in:
parent
da9be83326
commit
e9e756331c
1 changed files with 4 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue