Restore the header line after using `eww-readable'

(eww-readable): Copy over pertinent data from the parent page.
This commit is contained in:
Lars Magne Ingebrigtsen 2014-11-10 21:34:43 +01:00
parent 41d4f8428b
commit f188b66742
2 changed files with 6 additions and 3 deletions

View file

@ -4,6 +4,7 @@
to a single page, used throughout the file instead of the
variables `eww-current-url', `eww-current-dom',
`eww-current-source', and `eww-current-title'.
(eww-readable): Copy over pertinent data from the parent page.
* net/eww.el: Remove `eww-next-url', `eww-previous-url',
`eww-up-url', `eww-home-url', `eww-start-url' and

View file

@ -419,10 +419,10 @@ This command uses heuristics to find the parts of the web page that
contains the main textual portion, leaving out navigation menus and
the like."
(interactive)
(let* ((source (plist-get eww-data :source))
(let* ((old-data eww-data)
(dom (shr-transform-dom
(with-temp-buffer
(insert source)
(insert (plist-get old-data :source))
(condition-case nil
(decode-coding-region (point-min) (point-max) 'utf-8)
(coding-system-error nil))
@ -432,7 +432,9 @@ the like."
(eww-display-html nil nil
(shr-retransform-dom
(eww-highest-readability dom)))
(plist-put eww-data :source source)))
(dolist (elem '(:source :url :title :next :previous :up))
(plist-put eww-data elem (plist-get old-data elem)))
(eww-update-header-line-format)))
(defun eww-score-readability (node)
(let ((score -1))