branch: elpa/crux
commit 20c07848049716a0e1aa2560e23b5f4149f2a74f
Author: Trust me I am a doctor <pill...@riseup.net>
Commit: Bozhidar Batsov <bozhidar.bat...@gmail.com>

    Add support for org-mode links to crux-view-url
---
 crux.el | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/crux.el b/crux.el
index ca9d863..3fc313c 100644
--- a/crux.el
+++ b/crux.el
@@ -490,7 +490,9 @@ When invoke with C-u, the newly created file will be 
visited.
 (defun crux-view-url ()
   "Open a new buffer containing the contents of URL."
   (interactive)
-  (let* ((default (thing-at-point-url-at-point))
+  (let* ((default (if (eq major-mode 'org-mode)
+                      (org-element-property :raw-link (org-element-context))
+                    (thing-at-point-url-at-point)))
          (url (read-from-minibuffer "URL: " default)))
     (switch-to-buffer (url-retrieve-synchronously url))
     (rename-buffer url t)

Reply via email to