From: Michael Albinus Date: Sat, 25 Dec 2021 13:13:43 +0000 (+0100) Subject: * lisp/net/browse-url.el (browse-url-of-file): Improve browsing remote files. X-Git-Tag: emacs-29.0.90~3459 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=44c43ba4bd425ae7dc06d50d46e04081023b4a5e;p=emacs.git * lisp/net/browse-url.el (browse-url-of-file): Improve browsing remote files. --- 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))