I want to write an emacs lisp function that selects the last word and links it to the last item in the kill ring. I've written the following:
(defun link-last-word-from-kill ()
(interactive)
(push-mark)
(backward-word)
(org-insert-link 0 (yank) (buffer-substring (region-beginning) (region-end)))
(pop-mark)
)
I'm uncertain I'm reading (org-insert-link &optional COMPLETE-FILE LINK-LOCATION DESCRIPTION) correctly; I think I've set the link-location to be the kill-ring, but I'm still prompted for input to link. What am I misunderstanding?