From 71d4c19d3d50b7be97b3eb00b4d7b37715f89935 Mon Sep 17 00:00:00 2001 From: Ivan Kanis Date: Mon, 24 Jun 2013 19:38:51 +0200 Subject: [PATCH] * net/eww.el (eww): Add a trailing slash to domain names. --- lisp/ChangeLog | 4 ++++ lisp/net/eww.el | 8 ++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c55666a0cad..a1f6ceee6a5 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2013-06-24 Ivan Kanis + + * net/eww.el (eww): Add a trailing slash to domain names. + 2013-06-24 Juanma Barranquero * faces.el (face-spec-recalc): Revert part of 2013-06-23T20:29:18Z!lekktu@gmail.com (bug#14705). diff --git a/lisp/net/eww.el b/lisp/net/eww.el index 535992513a2..7b37eda185e 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el @@ -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))))) -- 2.39.2