From: Lars Ingebrigtsen Date: Fri, 25 Dec 2015 06:56:08 +0000 (+0100) Subject: Always save eww history X-Git-Tag: emacs-26.0.90~2871 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=2a0f18d9b6ce0ccce3d9c4a4a3b5743bae71b41e;p=emacs.git Always save eww history * eww.el (eww-setup-buffer): Always save history, even when called from outside the eww buffer (bug#19638). --- diff --git a/lisp/net/eww.el b/lisp/net/eww.el index 620913fecde..091a4aeba86 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el @@ -274,17 +274,13 @@ 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)))))) - (if (eq major-mode 'eww-mode) - (when (or (plist-get eww-data :url) - (plist-get eww-data :dom)) - (eww-save-history)) - (eww-setup-buffer) - (plist-put eww-data :url url) - (plist-put eww-data :title "") - (eww-update-header-line-format) - (let ((inhibit-read-only t)) - (insert (format "Loading %s..." url)) - (goto-char (point-min)))) + (eww-setup-buffer) + (plist-put eww-data :url url) + (plist-put eww-data :title "") + (eww-update-header-line-format) + (let ((inhibit-read-only t)) + (insert (format "Loading %s..." url)) + (goto-char (point-min))) (url-retrieve url 'eww-render (list url nil (current-buffer)))) @@ -540,6 +536,9 @@ Currently this means either text/html or application/xhtml+xml." (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)) (let ((inhibit-read-only t)) (remove-overlays) (erase-buffer))