* net/eww.el (eww): Add a trailing slash to domain names.
authorIvan Kanis <ivan@kanis.fr>
Mon, 24 Jun 2013 17:38:51 +0000 (19:38 +0200)
committerLars Magne Ingebrigtsen <larsi@gnus.org>
Mon, 24 Jun 2013 17:38:51 +0000 (19:38 +0200)
lisp/ChangeLog
lisp/net/eww.el

index c55666a..a1f6cee 100644 (file)
@@ -1,3 +1,7 @@
+2013-06-24  Ivan Kanis  <ivan@kanis.fr>
+
+       * net/eww.el (eww): Add a trailing slash to domain names.
+
 2013-06-24  Juanma Barranquero  <lekktu@gmail.com>
 
        * faces.el (face-spec-recalc): Revert part of 2013-06-23T20:29:18Z!lekktu@gmail.com (bug#14705).
index 5359925..7b37eda 100644 (file)
@@ -102,8 +102,12 @@ word(s) will be searched for via `eww-search-prefix'."
   (interactive "sEnter URL or keywords: ")
   (if (and (= (length (split-string url)) 1)
            (> (length (split-string url "\\.")) 1))
-      (unless (string-match-p "\\`[a-zA-Z][-a-zA-Z0-9+.]*://" url)
-        (setq url (concat "http://" url)))
+      (progn
+        (unless (string-match-p "\\`[a-zA-Z][-a-zA-Z0-9+.]*://" url)
+          (setq url (concat "http://" url)))
+        ;; some site don't redirect final /
+        (when (string= (url-filename (url-generic-parse-url url)) "")
+          (setq url (concat url "/"))))
     (unless (string-match-p "^file:" url)
       (setq url (concat eww-search-prefix
                         (replace-regexp-in-string " " "+" url)))))