[gnus git] branch master updated: =1= Proof of concept implemantation of boxy backgrounds.

Lars Magne Ingebrigtsen <[email protected]>
Newsgroups gmane.emacs.gnus.cvs
Message-ID <[email protected]>
       via  99604ca3152531d850d81dd5caa24122f2948e62 (commit)
      from  0a440eb39cc7010824d33abcaf73b79e57b02746 (commit)


- Log -----------------------------------------------------------------
commit 99604ca3152531d850d81dd5caa24122f2948e62
Author: Lars Magne Ingebrigtsen <[email protected]>
Date:   Mon Jan 24 15:11:41 2011 -0800

    Proof of concept implemantation of boxy backgrounds.

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index ce65cdd..cd5e4f6 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
+2011-01-24  Lars Ingebrigtsen  <[email protected]>
+
+	* shr.el (shr-expand-newlines): Proof of concept implemantation of boxy
+	backgrounds.
+
 2011-01-24  Teodor Zlatanov  <[email protected]>
 
 	* mml-smime.el (mml-smime-use): Make it a defcustom and default to 'epg
diff --git a/lisp/shr.el b/lisp/shr.el
index 174b1ff..be87ec6 100644
--- a/lisp/shr.el
+++ b/lisp/shr.el
@@ -642,7 +642,26 @@ ones, in case fg and bg are nil."
 	(shr-put-color-1 (point) (min (line-end-position) end) type color))
       (if (< (line-end-position) end)
 	  (forward-line 1)
-	(goto-char end)))))
+	(goto-char end)))
+    (when (eq type :background)
+      (shr-expand-newlines start end color))))
+
+(defun shr-expand-newlines (start end color)
+  (save-restriction
+    (narrow-to-region start end)
+    (let ((width (shr-natural-width))
+	  column)
+      (goto-char (point-min))
+      (while (not (eobp))
+	(end-of-line)
+	(when (and (< (setq current-column (current-column)) width)
+		   (not (get-text-property (point) 'display)))
+	  (put-text-property
+	   (point) (1+ (point)) 'display
+	   (concat (propertize (make-string (- width current-column) ? )
+			       'face (list :background color))
+		   "\n")))
+	(forward-line 1)))))
 
 (defun shr-put-color-1 (start end type color)
   (let* ((old-props (get-text-property start 'face))

-----------------------------------------------------------------------
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we listed those
revisions in full, above.

Summary of changes:
 lisp/ChangeLog |    5 +++++
 lisp/shr.el    |   21 ++++++++++++++++++++-
 2 files changed, 25 insertions(+), 1 deletions(-)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Gnus Project".

The branch, master has been updated


hooks/post-receive
-- 
Gnus Project
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.