Commit 94fa6ec7 authored by Lars Magne Ingebrigtsen's avatar Lars Magne Ingebrigtsen Committed by Katsumi Yamaoka
Browse files

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
parent 01024b7f
2013-06-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
* shr.el (shr-expand-url): Expansion should chop off the bits after the
last slash.
* eww.el (eww-tag-select): Use the first value as the default value.
2013-06-13 Rüdiger Sonderfeld <ruediger@c-plusplus.de>
 
* eww.el (eww): Prepend urls with http:// if scheme is missing.
......
......@@ -154,9 +154,12 @@
(set (make-local-variable 'browse-url-browser-function) 'eww-browse-url))
(defun eww-browse-url (url &optional new-window)
(push (list eww-current-url (point))
eww-history)
(eww url))
(let ((url-request-extra-headers
(append '(("User-Agent" . "eww/1.0"))
url-request-extra-headers)))
(push (list eww-current-url (point))
eww-history)
(eww url)))
(defun eww-quit ()
"Exit the Emacs Web Wowser."
......@@ -254,6 +257,9 @@
:value (cdr (assq :value (cdr elem)))
:tag (cdr (assq 'text (cdr elem))))
options)))
;; If we have no selected values, default to the first value.
(unless (plist-get (cdr menu) :value)
(nconc menu (list :value (nth 2 (car options)))))
(nconc menu options)
(apply 'widget-create menu)
(put-text-property start (point) 'eww-widget menu)
......
......@@ -492,7 +492,10 @@ size, and full-buffer size."
url
(let ((base shr-base))
;; Chop off query string.
(when (string-match "^\\([^?]+\\)[?]" base)
(when (string-match "\\`\\([^?]+\\)[?]" base)
(setq base (match-string 1 base)))
;; Chop off the bit after the last slash.
(when (string-match "\\`\\(.*\\)[/][^/]+" base)
(setq base (match-string 1 base)))
(cond
((and (string-match "\\`//" url)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment