* net/eww.el (eww): Add a trailing slash to domain names.

This commit is contained in:
Ivan Kanis 2013-06-24 19:38:51 +02:00 committed by Lars Magne Ingebrigtsen
parent ae36ca55cd
commit 71d4c19d3d
2 changed files with 10 additions and 2 deletions

View 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).

View 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)))))