diff options
| author | Lars Magne Ingebrigtsen | 2015-02-11 15:34:07 +1100 |
|---|---|---|
| committer | Lars Magne Ingebrigtsen | 2015-02-11 15:34:07 +1100 |
| commit | e6929b0b8a3c4a10023f700c6121f9e0b182aa8a (patch) | |
| tree | a8ee23ae56fa178192b5143ae084b6b48182ffb4 | |
| parent | cbb6f138e661b11e03885f00041e6442ed12a6a5 (diff) | |
| download | emacs-e6929b0b8a3c4a10023f700c6121f9e0b182aa8a.tar.gz emacs-e6929b0b8a3c4a10023f700c6121f9e0b182aa8a.zip | |
(shr-fill-line): Preserve background colours when indenting/folding.
| -rw-r--r-- | lisp/ChangeLog | 1 | ||||
| -rw-r--r-- | lisp/net/shr.el | 16 |
2 files changed, 14 insertions, 3 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 7274c9da8f2..7ec017c94ec 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -2,6 +2,7 @@ | |||
| 2 | 2 | ||
| 3 | * net/shr.el (shr-insert): Make sure the space inserted has the | 3 | * net/shr.el (shr-insert): Make sure the space inserted has the |
| 4 | right font (for width). | 4 | right font (for width). |
| 5 | (shr-fill-line): Preserve background colours when indenting/folding. | ||
| 5 | 6 | ||
| 6 | 2015-02-10 Lars Ingebrigtsen <larsi@gnus.org> | 7 | 2015-02-10 Lars Ingebrigtsen <larsi@gnus.org> |
| 7 | 8 | ||
diff --git a/lisp/net/shr.el b/lisp/net/shr.el index a4320853fd1..7a93c3a043c 100644 --- a/lisp/net/shr.el +++ b/lisp/net/shr.el | |||
| @@ -550,7 +550,12 @@ size, and full-buffer size." | |||
| 550 | (point) 'shr-continuation-indentation)) | 550 | (point) 'shr-continuation-indentation)) |
| 551 | start) | 551 | start) |
| 552 | (put-text-property (point) (1+ (point)) 'shr-indentation nil) | 552 | (put-text-property (point) (1+ (point)) 'shr-indentation nil) |
| 553 | (shr-indent) | 553 | (let ((face (get-text-property (point) 'face)) |
| 554 | (background-start (point))) | ||
| 555 | (shr-indent) | ||
| 556 | (when face | ||
| 557 | (put-text-property background-start (point) 'face | ||
| 558 | `,(shr-face-background face)))) | ||
| 554 | (setq start (point)) | 559 | (setq start (point)) |
| 555 | (setq shr-indentation (or continuation shr-indentation)) | 560 | (setq shr-indentation (or continuation shr-indentation)) |
| 556 | (shr-vertical-motion shr-internal-width) | 561 | (shr-vertical-motion shr-internal-width) |
| @@ -570,8 +575,13 @@ size, and full-buffer size." | |||
| 570 | ;; Success; continue. | 575 | ;; Success; continue. |
| 571 | (when (= (preceding-char) ?\s) | 576 | (when (= (preceding-char) ?\s) |
| 572 | (delete-char -1)) | 577 | (delete-char -1)) |
| 573 | (insert "\n") | 578 | (let ((face (get-text-property (point) 'face)) |
| 574 | (shr-indent) | 579 | (background-start (point))) |
| 580 | (insert "\n") | ||
| 581 | (shr-indent) | ||
| 582 | (when face | ||
| 583 | (put-text-property background-start (point) 'face | ||
| 584 | `,(shr-face-background face)))) | ||
| 575 | (setq start (point)) | 585 | (setq start (point)) |
| 576 | (shr-vertical-motion shr-internal-width) | 586 | (shr-vertical-motion shr-internal-width) |
| 577 | (when (looking-at " $") | 587 | (when (looking-at " $") |