Reputation: 6324
When I am in org-mode and I have http links in my todo lists and my cursor is in the middle of a huge http link, is there a keyboard shortcut to copy that link so that I can paste it in a browser?
Take care, Rajiv
Upvotes: 2
Views: 1760
Reputation: 9946
If you're not in org mode, `browse-url' will open a url in your default browser.
Upvotes: 1
Reputation: 20362
I misunderstood you question at first, and I thought that you wanted to e.g. embed the link into an email.
Then this code should have worked.
(defun myorg-copy-link ()
(interactive)
(kill-new
(save-excursion
(skip-chars-forward "^]\n\r")
(when (org-in-regexp org-bracket-link-regexp 1)
(setq link
(org-link-unescape
(org-match-string-no-properties 1))))))
But if you only want browsing, org-open-at-point
is enough.
Upvotes: 5