From 5c06471c3a11348342719fd9011486455adeb701 Mon Sep 17 00:00:00 2001 From: Hugo-Heagren <62905215+Hugo-Heagren@users.noreply.github.com> Date: Tue, 7 Mar 2023 17:21:01 +0000 Subject: [PATCH] (node): org-roam-node-at-point: don't error in non-org buffers (#2329) `=' 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. --- org-roam-node.el | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/org-roam-node.el b/org-roam-node.el index 61e396b..720c3a0 100644 --- a/org-roam-node.el +++ b/org-roam-node.el @@ -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