From d93423d4e11da95bcf177b2bc3c74cb1d1acf807 Mon Sep 17 00:00:00 2001 From: Rodrigo Morales <74389646+rdrg109@users.noreply.github.com> Date: Sun, 14 Nov 2021 04:13:43 -0500 Subject: [PATCH] fix(org-roam-db-map-links): goto-char added to point-min (#1969) * fix(org-roam-db-map-links): goto-char added to point-min * fix(org-roam-db-map-links): unnecessary point move removed There's no need to move the point to the beginning of the buffer to get the context of the link at point. See minimal working example below. ,---- | (with-temp-buffer | (org-mode) | (insert "[[a]]") | (goto-char (point-min)) | (pp (org-element-context))) `---- ,---- | (link | (:type "fuzzy" :path "a" :format bracket :raw-link "a" :application nil :search-option nil :begin 1 :end 6 :contents-begin nil :contents-end nil :post-blank 0 :parent | (paragraph | (:begin 1 :end 6 :contents-begin 1 :contents-end 6 :post-blank 0 :post-affiliated 1 :parent nil)))) `---- ,---- | (with-temp-buffer | (org-mode) | (insert "[[a]]") | (pp (org-element-context))) `---- ,---- | (link | (:type "fuzzy" :path "a" :format bracket :raw-link "a" :application nil :search-option nil :begin 1 :end 6 :contents-begin nil :contents-end nil :post-blank 0 :parent | (paragraph | (:begin 1 :end 6 :contents-begin 1 :contents-end 6 :post-blank 0 :post-affiliated 1 :parent nil)))) `---- --- org-roam-db.el | 1 - 1 file changed, 1 deletion(-) diff --git a/org-roam-db.el b/org-roam-db.el index 43719db..da8b16b 100644 --- a/org-roam-db.el +++ b/org-roam-db.el @@ -375,7 +375,6 @@ If UPDATE-P is non-nil, first remove the file in the database." (with-temp-buffer (delay-mode-hooks (org-mode)) (insert link) - (point-min) (setq link (org-element-context))))) (when link (dolist (fn fns)