1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-02-03 20:24:29 +00:00

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).
This commit is contained in:
Lars Ingebrigtsen 2016-02-02 15:53:39 +11:00
parent 9c3142dcc0
commit ee0fbd854f

View File

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