emacs-diffs
[Top][All Lists]
Advanced

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

master 44d2368: Make xwidget-webkit-browse-url slightly more DWIM


From: Lars Ingebrigtsen
Subject: master 44d2368: Make xwidget-webkit-browse-url slightly more DWIM
Date: Mon, 20 Jul 2020 06:21:53 -0400 (EDT)

branch: master
commit 44d2368ca12b4de8ee67a92cb20a115fe955d819
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Make xwidget-webkit-browse-url slightly more DWIM
    
    * lisp/xwidget.el (xwidget-webkit-browse-url): Prepend "https" to
    URLs that don't have a protocol (bug#31369).
---
 lisp/xwidget.el | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lisp/xwidget.el b/lisp/xwidget.el
index 775dddf..aed6c09 100644
--- a/lisp/xwidget.el
+++ b/lisp/xwidget.el
@@ -92,6 +92,9 @@ Interactively, URL defaults to the string looking like a url 
around point."
   (or (featurep 'xwidget-internal)
       (user-error "Your Emacs was not compiled with xwidgets support"))
   (when (stringp url)
+    ;; If it's a "naked url", just try adding https: to it.
+    (unless (string-match "\\`[A-Za-z]+:" url)
+      (setq url (concat "https://"; url)))
     (if new-session
         (xwidget-webkit-new-session url)
       (xwidget-webkit-goto-url url))))



reply via email to

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