1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-02-06 07:31:13 -08:00

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.
This commit is contained in:
Lars Magne Ingebrigtsen 2015-01-10 16:01:43 +01:00
parent 485763c0dc
commit 0046f2c158
2 changed files with 10 additions and 4 deletions

View file

@ -1,3 +1,8 @@
2015-01-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
* 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 <dancol@dancol.org>
* vc/vc-hooks.el (vc-prefix-map): Bind vc-delete-file to C-x v x,

View file

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