From: Lars Magne Ingebrigtsen Date: Sat, 10 Jan 2015 15:01:43 +0000 (+0100) Subject: Tweak eww DWIM URL recognition X-Git-Tag: emacs-25.0.90~2605^2~12 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=0046f2c1580d439351fbecf2c28526a5e1c845ec;p=emacs.git Tweak eww DWIM URL recognition Fixes: debbugs:19556 * net/eww.el (eww): Always interpret URLs that start with https?: as plain URLs, even if they have spaces in them. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index fc7f5e57cbd..808be4b6957 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2015-01-10 Lars Magne Ingebrigtsen + + * net/eww.el (eww): Always interpret URLs that start with https?: + as plain URLs, even if they have spaces in them (bug#19556). + 2015-01-10 Daniel Colascione * vc/vc-hooks.el (vc-prefix-map): Bind vc-delete-file to C-x v x, diff --git a/lisp/net/eww.el b/lisp/net/eww.el index 2ce95d97ff8..52c1501fbe1 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el @@ -255,10 +255,11 @@ word(s) will be searched for via `eww-search-prefix'." ((string-match-p "\\`ftp://" url) (user-error "FTP is not supported.")) (t - (if (and (= (length (split-string url)) 1) - (or (and (not (string-match-p "\\`[\"\'].*[\"\']\\'" url)) - (> (length (split-string url "[.:]")) 1)) - (string-match eww-local-regex url))) + (if (or (string-match "\\`https?:" url) + (and (= (length (split-string url)) 1) + (or (and (not (string-match-p "\\`[\"\'].*[\"\']\\'" url)) + (> (length (split-string url "[.:]")) 1)) + (string-match eww-local-regex url)))) (progn (unless (string-match-p "\\`[a-zA-Z][-a-zA-Z0-9+.]*://" url) (setq url (concat "http://" url)))