]> git.eshelyaron.com Git - emacs.git/commitdiff
Restore the header line after using `eww-readable'
authorLars Magne Ingebrigtsen <larsi@gnus.org>
Mon, 10 Nov 2014 20:34:43 +0000 (21:34 +0100)
committerLars Magne Ingebrigtsen <larsi@gnus.org>
Mon, 10 Nov 2014 20:34:43 +0000 (21:34 +0100)
(eww-readable): Copy over pertinent data from the parent page.

lisp/ChangeLog
lisp/net/eww.el

index 3d079103128a855c9580fb45d28d828c778b0b3a..bc31f5d14bb95a097c34fa3884960b81015397f5 100644 (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
index 2ad3980e8d932a90ddc67f8a89b7149ba7d1e78f..b697fa32f4b32244513c827f1e40858bb59fbac7 100644 (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))