From b9ad615e658803846192340d18919f3c7ac9b94e Mon Sep 17 00:00:00 2001 From: Ivan Shmakov Date: Sun, 7 Dec 2014 20:38:38 +0100 Subject: [PATCH] eww history restoration fix Fixes: debbugs:18550 * net/eww.el (eww-list-histories): Restore the history in the correct buffer. --- lisp/ChangeLog | 5 +++++ lisp/net/eww.el | 9 +++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 287352cdb0d..c9e5bd7793a 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2014-12-07 Ivan Shmakov + + * net/eww.el (eww-list-histories): Restore the history in the + correct buffer (bug#18550). + 2014-12-07 Lars Magne Ingebrigtsen * net/eww.el (eww-bookmark-prepare): Display URLs in first by diff --git a/lisp/net/eww.el b/lisp/net/eww.el index c1ba4294905..f74f0eff38b 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el @@ -1584,9 +1584,11 @@ Differences in #targets are ignored." (interactive) (when (null eww-history) (error "No eww-histories are defined")) - (let ((eww-history-trans eww-history)) + (let ((eww-history-trans eww-history) + (buffer (current-buffer))) (set-buffer (get-buffer-create "*eww history*")) (eww-history-mode) + (setq-local eww-current-buffer buffer) (let ((inhibit-read-only t) (domain-length 0) (title-length 0) @@ -1615,7 +1617,10 @@ Differences in #targets are ignored." (let ((history (get-text-property (line-beginning-position) 'eww-history))) (unless history (error "No history on the current line")) - (quit-window) + (let ((buffer eww-current-buffer)) + (quit-window) + (when buffer + (switch-to-buffer buffer))) (eww-restore-history history))) (defvar eww-history-mode-map -- 2.39.2