3 ms·
No, that wouldn't work. Radio Targets are intended for the precise repetitions of the same characters. If you surround a regular org link in three angle bracket
by nanna 2y ago
No, that wouldn't work. Radio Targets are intended for the precise repetitions of the same characters. If you surround a regular org link in three angle brackets, eg <<<[[https://www.bbc.com][bbc] https://www.bbc.com][bbc]]>>>, then the Radio link will clobber the web link on the target itself (ie C-c C-o won't take you anywhere), and it will only highlight repetitions of [[https://www.bbc.com][bbc] https://www.bbc.com][bbc]] rather than just bbc.
For something similar to what you're asking, I would just go for something like...
The <<<bbc>>> ([[https://www.bbc.com][site] 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.
- phforms 2y agoI couldn’t find the command you mentioned “org-insert-radio-target-brackets” in my Emacs and it doesn’t appear to be in the manual[1] either. But of course it is very trivial to write, in case anyone else needs this: (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.html https://orgmode.org/manual/Radio-Targets.html
- nanna 2y agoApologies, you're right - this was a function I'd forgotten that I'd defined myself! The main thing I would add to your definition is to finish with org-update-radio-target-regexp which does what C-c C-c would otherwise do in this context. Here'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)))
- phforms 2y agoGood idea to update the radio targets along with the wrapping. Also, I didn’t know `insert-pair` exists, could have saved me some typing. :)
- chrismorgan 2y agoHow about [[https://www.bbc.com][<<<BBC> https://www.bbc.com][<<<BBC>>>]]?