[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master 790ca72: Further eww DWIM URL interpretation fixups
From: |
Lars Ingebrigtsen |
Subject: |
[Emacs-diffs] master 790ca72: Further eww DWIM URL interpretation fixups |
Date: |
Sat, 10 Jan 2015 15:20:59 +0000 |
branch: master
commit 790ca72b3e5790bd8af6f76831ac0c3dde01288e
Author: Lars Magne Ingebrigtsen <address@hidden>
Commit: Lars Magne Ingebrigtsen <address@hidden>
Further eww DWIM URL interpretation fixups
(eww): Also interpret things like "en.wikipedia.org/wiki/Free
software" as an URL.
---
lisp/ChangeLog | 2 ++
lisp/net/eww.el | 5 ++++-
2 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 808be4b..9bfcd50 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -2,6 +2,8 @@
* net/eww.el (eww): Always interpret URLs that start with https?:
as plain URLs, even if they have spaces in them (bug#19556).
+ (eww): Also interpret things like "en.wikipedia.org/wiki/Free
+ software" as an URL.
2015-01-10 Daniel Colascione <address@hidden>
diff --git a/lisp/net/eww.el b/lisp/net/eww.el
index 52c1501..8278e3c 100644
--- a/lisp/net/eww.el
+++ b/lisp/net/eww.el
@@ -256,6 +256,9 @@ word(s) will be searched for via `eww-search-prefix'."
(user-error "FTP is not supported."))
(t
(if (or (string-match "\\`https?:" url)
+ ;; Also try to match "naked" URLs like
+ ;; en.wikipedia.org/wiki/Free software
+ (string-match "\\`[a-z._]+/" url)
(and (= (length (split-string url)) 1)
(or (and (not (string-match-p "\\`[\"\'].*[\"\']\\'" url))
(> (length (split-string url "[.:]")) 1))
@@ -263,7 +266,7 @@ word(s) will be searched for via `eww-search-prefix'."
(progn
(unless (string-match-p "\\`[a-zA-Z][-a-zA-Z0-9+.]*://" url)
(setq url (concat "http://"; url)))
- ;; some site don't redirect final /
+ ;; Some sites do not redirect final /
(when (string= (url-filename (url-generic-parse-url url)) "")
(setq url (concat url "/"))))
(setq url (concat eww-search-prefix
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] master 790ca72: Further eww DWIM URL interpretation fixups,
Lars Ingebrigtsen <=