summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorGravatar Nicolas Petton2021-03-03 22:27:06 +0100
committerGravatar Nicolas Petton2021-03-03 22:27:06 +0100
commit5ceb4f6729841a713a9ec2c14ce5bdc0a295e7b4 (patch)
tree740d1c790cfeae2e191ea62e40326bc49890fbec
parent64687fc8d4742e0ac7791768428638f555431b0d (diff)
downloadnroam-5ceb4f6729841a713a9ec2c14ce5bdc0a295e7b4.tar.gz
nroam-5ceb4f6729841a713a9ec2c14ce5bdc0a295e7b4.zip
Fix an edge case in `nroam-backlinks--crawl-source’
* nroam-backlinks.el (nroam-backlinks--crawl-source): Do not attempt to get the full outline when outline is nil, as `org-get-outline-path’ will throw.
-rw-r--r--nroam-backlinks.el17
1 files changed, 10 insertions, 7 deletions
diff --git a/nroam-backlinks.el b/nroam-backlinks.el
index 48444c7..5619fdc 100644
--- a/nroam-backlinks.el
+++ b/nroam-backlinks.el
@@ -108,13 +108,16 @@
(with-current-buffer (nroam-backlinks--work-buffer)
(insert-file-contents file nil nil nil 'replace)
(goto-char point)
- (let ((elt (org-element-at-point)))
- (let ((begin (org-element-property :begin elt))
- (end (org-element-property :end elt))
- (type (org-element-type elt))
- (outline (org-get-outline-path))
- (full-outline (org-get-outline-path 'with-self)))
- `(:type ,type :string ,(buffer-substring begin end) :full-outline ,full-outline :outline ,outline)))))
+ (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))))
+ `(:type ,type
+ :string ,(buffer-substring begin end)
+ :outline ,outline
+ :full-outline ,full-outline))))
(defun nroam-backlinks--hide-drawers ()
"Fold all drawers starting at POINT in the current buffer."