From c51ce08a40ae224287bfef22c148f2a50e68d274 Mon Sep 17 00:00:00 2001 From: Samuel Loury Date: Mon, 16 Aug 2021 15:48:29 +0200 Subject: [PATCH] (fix)org-roam-link-replace-at-point: preseve match-data (#1766) It lies in between org-in-regexp and replace-match. In some situations, like when the link looks like roam:a s'b, it changes the match-data. --- org-roam-node.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/org-roam-node.el b/org-roam-node.el index 231b0ed..741065e 100644 --- a/org-roam-node.el +++ b/org-roam-node.el @@ -631,7 +631,7 @@ Assumes that the cursor was put where the link is." (goto-char (org-element-property :begin link)) (when (and (org-in-regexp org-link-any-re 1) (string-equal type "roam") - (setq node (org-roam-node-from-title-or-alias path))) + (setq node (save-match-data (org-roam-node-from-title-or-alias path)))) (replace-match (org-link-make-string (concat "id:" (org-roam-node-id node)) (or desc path))))))))