Emacs Asked by Carsten on February 27, 2021
Is there some way to download and show a file from a URI/URL?
I now I can use wget
and then open the downloaded file and I guess I could even try to write myself a small function to do this.
But most likely someone did before me so is there a function/package that will let me get a file from the internets (would be great if it did not save the file somewhere first) and open it in a new buffer?
M-x url-handler-mode
C-x C-f http://emacs.stackexchange.com/questions/21180/is-there-a-way-to-show-open-a-file-from-a-uri-url
This opens the HTML file of this stackexchange question in your Emacs.
Correct answer by Michael Albinus on February 27, 2021
You can turn URLs in a buffer into clickable buttons with Emacs goto-address-mode minor mode. If the URL represents a web page, then you can get Emacs to browse that page by clicking on the URL button.
Turn this mode on/off with: M-x goto-address-mode
This works with Emacs running in Graphics mode and in terminal mode. A special key map is activated when point is over the URL button. The C-c RET
key sequence is bound to goto-address-at-point which makes Emacs browse the web page.
It's also possible to add key binding to that special map. In my system I added keys to navigate to the next or previous URL and to copy he content of the file identified by the URL into a local temporary file and then visit it. To do that add a function to the goto-address-mode-hook that maps commands into the goto-address-highlight-keymap
.
Answered by PRouleau on February 27, 2021
If you want the file "rendered", you can use the web browser eww - just do M-x eww RET url RET
Answered by asjo on February 27, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP