summaryrefslogtreecommitdiffstatshomepage
path: root/nroam-backlinks.el
diff options
context:
space:
mode:
authorGravatar Gustav Wikström2021-03-04 14:59:12 +0100
committerGravatar Gustav Wikström2021-03-04 17:26:12 +0100
commit03663d5e7666a7c3ba93b08ea119ac8b8b71121e (patch)
treef0fee0cf261c0e6793a43c178d8600dd03d01233 /nroam-backlinks.el
parent6a412e8c327e2da3d0e9dab60f9de4ca909a6923 (diff)
downloadnroam-03663d5e7666a7c3ba93b08ea119ac8b8b71121e.tar.gz
nroam-03663d5e7666a7c3ba93b08ea119ac8b8b71121e.zip
nroam-backlinks.el: Fix edge case (again)
* nroam-backlinks.el (nroam-backlinks--crawl-source): Set full-outline to nil if point is before first heading using a built in org function.
Diffstat (limited to 'nroam-backlinks.el')
-rw-r--r--nroam-backlinks.el13
1 files changed, 7 insertions, 6 deletions
diff --git a/nroam-backlinks.el b/nroam-backlinks.el
index 7bc2cec..e491a25 100644
--- a/nroam-backlinks.el
+++ b/nroam-backlinks.el
@@ -120,12 +120,13 @@ When nil, LEVEL defaults to 3."
(with-current-buffer (nroam-backlinks--work-buffer)
(insert-file-contents file nil nil nil 'replace)
(goto-char point)
- (let* ((elt (org-element-at-point))
- (begin (org-element-property :begin elt))
- (end (org-element-property :end elt))
- (type (org-element-type elt))
- (outline (org-get-outline-path))
- (full-outline (and outline (org-get-outline-path 'with-self))))
+ (let ((elt (org-element-at-point))
+ (begin (org-element-property :begin elt))
+ (end (org-element-property :end elt))
+ (type (org-element-type elt))
+ (outline (org-get-outline-path))
+ (full-outline (unless (org-before-first-heading-p)
+ (org-get-outline-path 'with-self))))
`(:type ,type
:string ,(buffer-substring begin end)
:outline ,outline