diff options
| author | Michael Albinus <michael.albinus@gmx.de> | 2021-06-07 20:41:30 +0200 |
|---|---|---|
| committer | Michael Albinus <michael.albinus@gmx.de> | 2021-06-07 20:41:30 +0200 |
| commit | fcc827619f2cdac9d574f49e08ce4e5be41daf0a (patch) | |
| tree | f472744db6604108ec9b2888ed9092e56d515f26 | |
| parent | 89f91e502ec484e7e544c3d33de596da5fe53f73 (diff) | |
Improve support of remote files in browse-url.el
* etc/NEWS: Mention support of remote file browsing.
* lisp/net/browse-url.el (browse-url-of-buffer): Revert last change.
(browse-url-of-file): Use temporary file in case of remote file.
(Bug#48397)
| -rw-r--r-- | etc/NEWS | 5 | ||||
| -rw-r--r-- | lisp/net/browse-url.el | 4 |
2 files changed, 8 insertions, 1 deletions
@@ -1599,6 +1599,11 @@ symbol property to the browsing commands. With a new command 'browse-url-with-browser-kind', an URL can explicitly be browsed with either an internal or external browser. +--- +*** Support for browsing of remote files. +If a remote file is taken, a local temporary copy of that file is +passed to the browser. + *** Support for the conkeror browser is now obsolete. *** Support for the Mosaic browser has been removed. diff --git a/lisp/net/browse-url.el b/lisp/net/browse-url.el index 0220c7adf6e..7fa81c5c295 100644 --- a/lisp/net/browse-url.el +++ b/lisp/net/browse-url.el @@ -47,6 +47,7 @@ ;; browse-url-xdg-open freedesktop.org xdg-open ;; browse-url-kde KDE konqueror (kfm) ;; browse-url-elinks Elinks Don't know (tried with 0.12.GIT) +;; eww-browse-url Emacs Web Wowser ;; Browsers can cache Web pages so it may be necessary to tell them to ;; reload the current page if it has changed (e.g., if you have edited @@ -773,6 +774,8 @@ interactively. Turn the filename into a URL with function (cond ((not (buffer-modified-p))) (browse-url-save-file (save-buffer)) (t (message "%s modified since last save" file)))))) + (when (file-remote-p file) + (setq file (file-local-copy file))) (browse-url (browse-url-file-url file)) (run-hooks 'browse-url-of-file-hook)) @@ -806,7 +809,6 @@ narrowed." (or buffer-file-name (and (boundp 'dired-directory) dired-directory))))) (when (or (not file-name) - (file-remote-p file-name) ;; This can happen when we're looking at a file from a ;; zip file buffer, for instance. (not (file-exists-p file-name))) |
