Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Apologies, 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)))


Good idea to update the radio targets along with the wrapping. Also, I didn’t know `insert-pair` exists, could have saved me some typing. :)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: