From 03663d5e7666a7c3ba93b08ea119ac8b8b71121e Mon Sep 17 00:00:00 2001 From: Gustav Wikström Date: Thu, 4 Mar 2021 14:59:12 +0100 Subject: 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. --- nroam-backlinks.el | 13 +++++++------ 1 file 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 -- cgit v1.2.3-54-g00ecf