Last active
August 29, 2015 14:22
-
-
Save filsinger/8155f9ebdb8832e1c036 to your computer and use it in GitHub Desktop.
Emacs: Download a url to a buffer and open the buffer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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