* lisp/net/browse-url.el (browse-url-of-file): Improve browsing remote files.

This commit is contained in:
Michael Albinus 2021-12-25 14:13:43 +01:00
parent 9966bf9f0c
commit 44c43ba4bd

View file

@ -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))