(feat): move fuzzy links to roam: links (#1105)

This commit is contained in:
Jethro Kuan
2020-09-23 17:58:18 +08:00
committed by GitHub
parent da6af3a468
commit ae32c465de
8 changed files with 539 additions and 384 deletions

View File

@ -74,19 +74,6 @@ If FILE, set `org-roam-temp-file-name' to file and insert its contents."
(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-roam-link-make-string new-loc desc)))
(sit-for 0)))
;;; Shielding regions
(defun org-roam-shield-region (beg end)
"Shield REGION against modifications.