[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master fcc8276 2/2: Improve support of remote files in browse-url.el
From: |
Michael Albinus |
Subject: |
master fcc8276 2/2: Improve support of remote files in browse-url.el |
Date: |
Mon, 7 Jun 2021 14:41:40 -0400 (EDT) |
branch: master
commit fcc827619f2cdac9d574f49e08ce4e5be41daf0a
Author: Michael Albinus <michael.albinus@gmx.de>
Commit: Michael Albinus <michael.albinus@gmx.de>
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)
---
etc/NEWS | 5 +++++
lisp/net/browse-url.el | 4 +++-
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/etc/NEWS b/etc/NEWS
index ff06a13..64b39d7 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -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 0220c7a..7fa81c5 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)))