Subject: bug#35445: 26.2; eww-follow-link breaks on the second invocation

From: Xu Chunyang <[email-masked]>
Date: Sat, 27 Apr 2019 15:38:30 +0800

I'm visiting https://docs.python.org/3/library/functions.html, I click
the #abs link with RET (`eww-follow-link`), it works as expected, i.e.,
don't request the same page again but simply jump to #abs. However, when
I click the same link again with RET, it will requests the page AGAIN,
then jump to #abs.

According to my observation, the eww-data's :url is missing after the
first eww-follow-link invocation. eww-follow-link contains these two lines of code

    (eww-save-history)
    (eww-display-html 'utf-8 url dom nil (current-buffer))

the first line clears eww-data via (setq eww-data (list :title "")), but
the second line forgets to (plist-put eww-data :url url).

The following patch fixes the issue for me:

diff -u --label /Users/xcy/src/emacs-mac/lisp/net/eww.el --label \#\<buffer\ eww.el\> /Users/xcy/src/emacs-mac/lisp/net/eww.el /var/folders/7f/s191h4q97p90374yw15ssrs00000gn/T/buffer-content-hznRFC
--- /Users/xcy/src/emacs-mac/lisp/net/eww.el
+++ #<buffer eww.el>
@@ -1495,6 +1495,7 @@
 	   (eww-same-page-p url (plist-get eww-data :url)))
       (let ((dom (plist-get eww-data :dom)))
 	(eww-save-history)
+	(plist-put eww-data :url url)
 	(eww-display-html 'utf-8 url dom nil (current-buffer))))
      (t
       (eww-browse-url url external)))))

Diff finished.  Sat Apr 27 15:37:19 2019