Skip to content

Instantly share code, notes, and snippets.

@filsinger
Last active August 29, 2015 14:22
Show Gist options
  • Save filsinger/8155f9ebdb8832e1c036 to your computer and use it in GitHub Desktop.
Save filsinger/8155f9ebdb8832e1c036 to your computer and use it in GitHub Desktop.
Emacs: Download a url to a buffer and open the buffer
(defun find-url-at-point (&optional url)
"Open the URL at point."
(interactive)
(switch-to-buffer
(url-retrieve-synchronously
(or url (let ((default-search-string (if (region-active-p) (buffer-substring-no-properties (region-beginning) (region-end)) (thing-at-point-url-at-point) )))
(read-string (format "URL: %s" (or default-search-string "")) nil nil default-search-string) ) )) ))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment