From: Ivan Shmakov Date: Sun, 7 Dec 2014 20:14:07 +0000 (+0100) Subject: Make `G' in eww record history X-Git-Tag: emacs-25.0.90~2635^2~170 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=06b5cfe498a971503dc7e223e9829d561a3883ac;p=emacs.git Make `G' in eww record history Fixes: debbugs:19253 * net/eww.el (eww-browse-url): Use generate-new-buffer (was: iterating over possible buffer names.) * net/eww.el (eww): Moved history recording here... (eww-browse-url): ... from here. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 5ee822a6d26..1769c486372 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,11 @@ +2014-12-07 Ivan Shmakov + + * net/eww.el (eww): Moved history recording here... + (eww-browse-url): ... from here (bug#19253). + + * net/eww.el (eww-browse-url): Use generate-new-buffer (was: + iterating over possible buffer names.) + 2014-12-07 Lars Magne Ingebrigtsen * net/eww.el (eww-reload): Take a prefix to work locally (bug#19086). diff --git a/lisp/net/eww.el b/lisp/net/eww.el index 1e63cafd5ea..8b7839701ec 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el @@ -253,7 +253,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)))))) - (unless (eq major-mode 'eww-mode) + (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) (eww-update-header-line-format) @@ -680,16 +683,8 @@ the like." ;;;###autoload (defun eww-browse-url (url &optional new-window) (cond (new-window - (let ((new-buffer "*eww*") - (num 0)) - (while (get-buffer new-buffer) - (setq num (1+ num) - new-buffer (format "*eww*<%d>" num))) - (switch-to-buffer new-buffer)) - (eww-mode)) - ((and (equal major-mode 'eww-mode) - (plist-get eww-data :url)) - (eww-save-history))) + (switch-to-buffer (generate-new-buffer "*eww*")) + (eww-mode))) (eww url)) (defun eww-back-url ()