aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Magne Ingebrigtsen2013-06-13 14:31:52 +0000
committerKatsumi Yamaoka2013-06-13 14:31:52 +0000
commit94fa6ec7b306b47c251f7b8b67662598027a7ff3 (patch)
treee5547a8021e0971ac6413f6e8a5d6415d055d3bf
parent01024b7f20600ab9c43eda3e46d4943c5820c04e (diff)
downloademacs-94fa6ec7b306b47c251f7b8b67662598027a7ff3.tar.gz
emacs-94fa6ec7b306b47c251f7b8b67662598027a7ff3.zip
lisp/gnus/shr.el (shr-expand-url): Expansion should chop off the bits after the last slash
lisp/gnus/eww.el (eww-tag-select): Use the first value as the default value
-rw-r--r--lisp/gnus/ChangeLog7
-rw-r--r--lisp/gnus/eww.el12
-rw-r--r--lisp/gnus/shr.el5
3 files changed, 20 insertions, 4 deletions
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index ff086ebffda..83831264f58 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,10 @@
12013-06-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
2
3 * shr.el (shr-expand-url): Expansion should chop off the bits after the
4 last slash.
5
6 * eww.el (eww-tag-select): Use the first value as the default value.
7
12013-06-13 RĂ¼diger Sonderfeld <ruediger@c-plusplus.de> 82013-06-13 RĂ¼diger Sonderfeld <ruediger@c-plusplus.de>
2 9
3 * eww.el (eww): Prepend urls with http:// if scheme is missing. 10 * eww.el (eww): Prepend urls with http:// if scheme is missing.
diff --git a/lisp/gnus/eww.el b/lisp/gnus/eww.el
index 3f0399ed258..d4dd178fb70 100644
--- a/lisp/gnus/eww.el
+++ b/lisp/gnus/eww.el
@@ -154,9 +154,12 @@
154 (set (make-local-variable 'browse-url-browser-function) 'eww-browse-url)) 154 (set (make-local-variable 'browse-url-browser-function) 'eww-browse-url))
155 155
156(defun eww-browse-url (url &optional new-window) 156(defun eww-browse-url (url &optional new-window)
157 (push (list eww-current-url (point)) 157 (let ((url-request-extra-headers
158 eww-history) 158 (append '(("User-Agent" . "eww/1.0"))
159 (eww url)) 159 url-request-extra-headers)))
160 (push (list eww-current-url (point))
161 eww-history)
162 (eww url)))
160 163
161(defun eww-quit () 164(defun eww-quit ()
162 "Exit the Emacs Web Wowser." 165 "Exit the Emacs Web Wowser."
@@ -254,6 +257,9 @@
254 :value (cdr (assq :value (cdr elem))) 257 :value (cdr (assq :value (cdr elem)))
255 :tag (cdr (assq 'text (cdr elem)))) 258 :tag (cdr (assq 'text (cdr elem))))
256 options))) 259 options)))
260 ;; If we have no selected values, default to the first value.
261 (unless (plist-get (cdr menu) :value)
262 (nconc menu (list :value (nth 2 (car options)))))
257 (nconc menu options) 263 (nconc menu options)
258 (apply 'widget-create menu) 264 (apply 'widget-create menu)
259 (put-text-property start (point) 'eww-widget menu) 265 (put-text-property start (point) 'eww-widget menu)
diff --git a/lisp/gnus/shr.el b/lisp/gnus/shr.el
index 0a2c698a106..8cb16634e2b 100644
--- a/lisp/gnus/shr.el
+++ b/lisp/gnus/shr.el
@@ -492,7 +492,10 @@ size, and full-buffer size."
492 url 492 url
493 (let ((base shr-base)) 493 (let ((base shr-base))
494 ;; Chop off query string. 494 ;; Chop off query string.
495 (when (string-match "^\\([^?]+\\)[?]" base) 495 (when (string-match "\\`\\([^?]+\\)[?]" base)
496 (setq base (match-string 1 base)))
497 ;; Chop off the bit after the last slash.
498 (when (string-match "\\`\\(.*\\)[/][^/]+" base)
496 (setq base (match-string 1 base))) 499 (setq base (match-string 1 base)))
497 (cond 500 (cond
498 ((and (string-match "\\`//" url) 501 ((and (string-match "\\`//" url)