RAbraham
RAbraham

Reputation: 6324

Keyboard shortcut for opening http link in emacs or org-mode

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

Answers (2)

seanmcl
seanmcl

Reputation: 9946

If you're not in org mode, `browse-url' will open a url in your default browser.

Upvotes: 1

abo-abo
abo-abo

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

Related Questions