Skip to content

Commit

Permalink
(node): org-roam-node-at-point: don't error in non-org buffers (#2329)
Browse files Browse the repository at this point in the history
`=' assumes that both objects being compared are numbers. In some
buffers `outline-level' can return nil, so `=' returns an error. `eq'
does not assume this, but does return t when comparing two numbers.
  • Loading branch information
Hugo-Heagren committed Mar 7, 2023
1 parent b5436f3 commit 5c06471
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions org-roam-node.el
Original file line number Diff line number Diff line change
Expand Up @@ -236,11 +236,10 @@ populated."
(t (org-with-wide-buffer
(while (not (or (org-roam-db-node-p)
(bobp)
;; Handle case where top-level is a heading
(= (funcall outline-level)
(save-excursion
(org-roam-up-heading-or-point-min)
(funcall outline-level)))))
(eq (funcall outline-level)
(save-excursion
(org-roam-up-heading-or-point-min)
(funcall outline-level)))))
(org-roam-up-heading-or-point-min))
(when-let ((id (org-id-get)))
(org-roam-populate
Expand Down

0 comments on commit 5c06471

Please sign in to comment.