by nanna · 2y ago · 0 comments
For something similar to what you're asking, I would just go for something like...
The <<<bbc>>> ([[https://www.bbc.com][site]]) is the UK's state broadcasting company. Now when I write bbc (or BBC) these will be highlighted as links and will take you back to the Radio Target in the first sentence and I can then click on the link
Also note that you can mark a word or region and then hit C-c n r (org-insert-radio-target-brackets) to surround it in angle brackets and enable it as a radio target.
(defun org-insert-radio-target-brackets (start end)
"Wraps a region with angular brackets to create a radio target."
(interactive "r")
(save-excursion
(goto-char end)
(insert ">>>")
(goto-char start)
(insert "<<<")))
(keymap-set org-mode-map "C-c n r" #'org-insert-radio-target-brackets)
[1]: https://orgmode.org/manual/Radio-Targets.htmlHere's how I defined it.
(defun org-insert-radio-target-brackets (&optional arg)
"Surround selected text with Org Radio Target angle brackets (eg. <<<arg>>>) and then find and update all radio targets"
(interactive)
(progn
(insert-pair arg "<<<" ">>>")
(org-update-radio-target-regexp)))