diff options
| author | Lars Magne Ingebrigtsen | 2014-11-10 21:34:43 +0100 |
|---|---|---|
| committer | Lars Magne Ingebrigtsen | 2014-11-10 21:34:43 +0100 |
| commit | f188b667428a76a23940405b05f4ec01e64b359d (patch) | |
| tree | 96b31064db6f7d10fd343fdc94248d47d80383ab | |
| parent | 41d4f8428b65ef57b742cd91d92dcd0a3242d4bd (diff) | |
| download | emacs-f188b667428a76a23940405b05f4ec01e64b359d.tar.gz emacs-f188b667428a76a23940405b05f4ec01e64b359d.zip | |
Restore the header line after using `eww-readable'
(eww-readable): Copy over pertinent data from the parent page.
| -rw-r--r-- | lisp/ChangeLog | 1 | ||||
| -rw-r--r-- | lisp/net/eww.el | 8 |
2 files changed, 6 insertions, 3 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 3d079103128..bc31f5d14bb 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -4,6 +4,7 @@ | |||
| 4 | to a single page, used throughout the file instead of the | 4 | to a single page, used throughout the file instead of the |
| 5 | variables `eww-current-url', `eww-current-dom', | 5 | variables `eww-current-url', `eww-current-dom', |
| 6 | `eww-current-source', and `eww-current-title'. | 6 | `eww-current-source', and `eww-current-title'. |
| 7 | (eww-readable): Copy over pertinent data from the parent page. | ||
| 7 | 8 | ||
| 8 | * net/eww.el: Remove `eww-next-url', `eww-previous-url', | 9 | * net/eww.el: Remove `eww-next-url', `eww-previous-url', |
| 9 | `eww-up-url', `eww-home-url', `eww-start-url' and | 10 | `eww-up-url', `eww-home-url', `eww-start-url' and |
diff --git a/lisp/net/eww.el b/lisp/net/eww.el index 2ad3980e8d9..b697fa32f4b 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el | |||
| @@ -419,10 +419,10 @@ This command uses heuristics to find the parts of the web page that | |||
| 419 | contains the main textual portion, leaving out navigation menus and | 419 | contains the main textual portion, leaving out navigation menus and |
| 420 | the like." | 420 | the like." |
| 421 | (interactive) | 421 | (interactive) |
| 422 | (let* ((source (plist-get eww-data :source)) | 422 | (let* ((old-data eww-data) |
| 423 | (dom (shr-transform-dom | 423 | (dom (shr-transform-dom |
| 424 | (with-temp-buffer | 424 | (with-temp-buffer |
| 425 | (insert source) | 425 | (insert (plist-get old-data :source)) |
| 426 | (condition-case nil | 426 | (condition-case nil |
| 427 | (decode-coding-region (point-min) (point-max) 'utf-8) | 427 | (decode-coding-region (point-min) (point-max) 'utf-8) |
| 428 | (coding-system-error nil)) | 428 | (coding-system-error nil)) |
| @@ -432,7 +432,9 @@ the like." | |||
| 432 | (eww-display-html nil nil | 432 | (eww-display-html nil nil |
| 433 | (shr-retransform-dom | 433 | (shr-retransform-dom |
| 434 | (eww-highest-readability dom))) | 434 | (eww-highest-readability dom))) |
| 435 | (plist-put eww-data :source source))) | 435 | (dolist (elem '(:source :url :title :next :previous :up)) |
| 436 | (plist-put eww-data elem (plist-get old-data elem))) | ||
| 437 | (eww-update-header-line-format))) | ||
| 436 | 438 | ||
| 437 | (defun eww-score-readability (node) | 439 | (defun eww-score-readability (node) |
| 438 | (let ((score -1)) | 440 | (let ((score -1)) |