From: Lars Magne Ingebrigtsen Date: Sun, 23 Nov 2014 16:37:58 +0000 (+0100) Subject: (eww-follow-link): Make going to #targets in the page work again. X-Git-Tag: emacs-25.0.90~2635^2~360 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=b7278cdccf4651bbaebc6c58e02d0240ab0c68d6;p=emacs.git (eww-follow-link): Make going to #targets in the page work again. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index f743575b8ec..74fdd42bdfe 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -6,6 +6,7 @@ (eww-display-html): Don't pop the *eww* buffer. (eww-display-raw): Ditto. (eww-display-image): Ditto. + (eww-follow-link): Make going to #targets in the page work again. 2014-11-23 Ivan Shmakov diff --git a/lisp/net/eww.el b/lisp/net/eww.el index b4d1486340f..bad9b559384 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el @@ -359,7 +359,9 @@ See the `eww-search-prefix' variable for the search engine used." (list 'base (list (cons 'href url)) (progn - (unless (eq charset encode) + (when (or (and encode + (not (eq charset encode))) + (not (eq charset 'utf-8))) (condition-case nil (decode-coding-region (point) (point-max) (or encode charset)) @@ -1319,9 +1321,9 @@ If EXTERNAL, browse the URL using `shr-external-browser'." ;; This is a #target url in the same page as the current one. ((and (url-target (url-generic-parse-url url)) (eww-same-page-p url (plist-get eww-data :url))) - (eww-save-history) - (eww-display-html 'utf-8 url (plist-get eww-data :url) - nil (current-buffer))) + (let ((dom (plist-get eww-data :dom))) + (eww-save-history) + (eww-display-html 'utf-8 url dom nil (current-buffer)))) (t (eww-browse-url url)))))