From 0046f2c1580d439351fbecf2c28526a5e1c845ec Mon Sep 17 00:00:00 2001 From: Lars Magne Ingebrigtsen Date: Sat, 10 Jan 2015 16:01:43 +0100 Subject: [PATCH] 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. --- lisp/ChangeLog | 5 +++++ lisp/net/eww.el | 9 +++++---- 2 files changed, 10 insertions(+), 4 deletions(-) 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))) -- 2.39.2