Commit ee0fbd85 authored by Lars Ingebrigtsen's avatar Lars Ingebrigtsen

Make eww-browse-url with new-window parameter work again

* eww.el (eww-browse-url): Stay in the same buffer if we're
already in a eww mode buffer so that eww-browse-url with a
new-window parameter works (bug#22244).
parent 9c3142dc
......@@ -274,6 +274,10 @@ word(s) will be searched for via `eww-search-prefix'."
(setq url (concat url "/"))))
(setq url (concat eww-search-prefix
(replace-regexp-in-string " " "+" url))))))
(switch-to-buffer
(if (eq major-mode 'eww-mode)
(current-buffer)
(get-buffer-create "*eww*")))
(eww-setup-buffer)
(plist-put eww-data :url url)
(plist-put eww-data :title "")
......@@ -556,7 +560,6 @@ Currently this means either text/html or application/xhtml+xml."
(goto-char (point-min)))
(defun eww-setup-buffer ()
(switch-to-buffer (get-buffer-create "*eww*"))
(when (or (plist-get eww-data :url)
(plist-get eww-data :dom))
(eww-save-history))
......
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