mirror of
https://github.com/org-roam/org-roam
synced 2025-08-01 12:17:21 -05:00
(feat): support fuzzy links (#910)
This commit is contained in:
@ -77,6 +77,19 @@ to look.
|
||||
(s-replace "\\" "\\\\")
|
||||
(s-replace "\"" "\\\"")))
|
||||
|
||||
;;; Link Utilities
|
||||
(defun org-roam-replace-fuzzy-link (new-loc &optional desc)
|
||||
"Replace the current fuzzy link (e.g. [[Foo]]) with a NEW-LOC.
|
||||
If DESC, also replace the desc"
|
||||
(save-match-data
|
||||
(unless (org-in-regexp org-link-bracket-re 1)
|
||||
(user-error "No link at point"))
|
||||
(let ((desc (or desc (match-string-no-properties 1)))
|
||||
(remove (list (match-beginning 0) (match-end 0))))
|
||||
(apply #'delete-region remove)
|
||||
(insert (org-link-make-string new-loc desc)))
|
||||
(sit-for 0)))
|
||||
|
||||
;;; Shielding regions
|
||||
(defun org-roam-shield-region (beg end)
|
||||
"Shield REGION against modifications.
|
||||
|
Reference in New Issue
Block a user