From: Tassilo Horn Date: Wed, 6 May 2020 20:23:03 +0000 (+0200) Subject: Restore HTML rendering behavior of browse-url-of-buffer/file. X-Git-Tag: emacs-28.0.90~7423 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=86fef6ab89ee54c6f78bc2064e55c5439e929827;p=emacs.git Restore HTML rendering behavior of browse-url-of-buffer/file. * lisp/net/browse-url.el (browse-url-default-handlers): Add a browser handler for HTML page file:// URLs before the generic file:// handler. (browse-url--browser): New defun. --- diff --git a/lisp/net/browse-url.el b/lisp/net/browse-url.el index 1275c15578f..67dc4cd231b 100644 --- a/lisp/net/browse-url.el +++ b/lisp/net/browse-url.el @@ -601,10 +601,17 @@ down (this *won't* always work)." "Calls `browse-url-man-function' with URL and ARGS." (funcall browse-url-man-function url args)) +(defun browse-url--browser (url &rest args) + "Calls `browse-url-browser-function' with URL and ARGS." + (funcall browse-url-browser-function url args)) + ;;;###autoload (defvar browse-url-default-handlers '(("\\`mailto:" . browse-url--mailto) ("\\`man:" . browse-url--man) + ;; Render file:// URLs if they are HTML pages, otherwise just find + ;; the file. + ("\\`file://.*\\.html?\\b" . browse-url--browser) ("\\`file://" . browse-url-emacs)) "Like `browse-url-handlers' but populated by Emacs and packages.