emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 86fef6a: Restore HTML rendering behavior of browse-url-of-buffer/


From: Tassilo Horn
Subject: master 86fef6a: Restore HTML rendering behavior of browse-url-of-buffer/file.
Date: Wed, 6 May 2020 16:25:17 -0400 (EDT)

branch: master
commit 86fef6ab89ee54c6f78bc2064e55c5439e929827
Author: Tassilo Horn <address@hidden>
Commit: Tassilo Horn <address@hidden>

    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.
---
 lisp/net/browse-url.el | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/lisp/net/browse-url.el b/lisp/net/browse-url.el
index 1275c15..67dc4cd 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.
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]