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))))
`----
This commit is contained in:
Rodrigo Morales
2021-11-14 04:13:43 -05:00
committed by GitHub
parent 1af1639ee0
commit d93423d4e1

View File

@ -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)