* eww.el (eww): Prepend urls with http:// if scheme is missing.
authorRüdiger Sonderfeld <ruediger@c-plusplus.de>
Thu, 13 Jun 2013 05:39:34 +0000 (07:39 +0200)
committerLars Magne Ingebrigtsen <larsi@gnus.org>
Thu, 13 Jun 2013 05:39:34 +0000 (07:39 +0200)
lisp/ChangeLog
lisp/eww.el

index f41d86d..2b703cf 100644 (file)
@@ -1,3 +1,7 @@
+2013-06-13  Rüdiger Sonderfeld  <ruediger@c-plusplus.de>
+
+       * eww.el (eww): Prepend urls with http:// if scheme is missing.
+
 2013-06-13  Katsumi Yamaoka  <yamaoka@jpl.org>
 
        * eww.el (eww-detect-charset): Detect charset from the <meta> tag.
index 8f8dbec..e0997c2 100644 (file)
@@ -36,6 +36,8 @@
 (defun eww (url)
   "Fetch URL and render the page."
   (interactive "sUrl: ")
+  (unless (string-match-p "\\`[a-zA-Z][-a-zA-Z0-9+.]*://" url)
+    (setq url (concat "http://" url)))
   (url-retrieve url 'eww-render (list url)))
 
 (defun eww-detect-charset (html-p)