From 44c43ba4bd425ae7dc06d50d46e04081023b4a5e Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Sat, 25 Dec 2021 14:13:43 +0100 Subject: [PATCH] * lisp/net/browse-url.el (browse-url-of-file): Improve browsing remote files. --- lisp/net/browse-url.el | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lisp/net/browse-url.el b/lisp/net/browse-url.el index b7840f05890..9a41f018f28 100644 --- a/lisp/net/browse-url.el +++ b/lisp/net/browse-url.el @@ -701,8 +701,10 @@ 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))) + (when (and (file-remote-p file) + (not browse-url-temp-file-name)) + (setq browse-url-temp-file-name (file-local-copy file) + file browse-url-temp-file-name)) (browse-url (browse-url-file-url file)) (run-hooks 'browse-url-of-file-hook)) -- 2.39.2