[gnus git] branch no-gnus updated: m0-1-37-g19c0ca5 =1= Only strip whitespace from too-wide lines in shr

Lars Ingebrigtsen <[email protected]>
Newsgroups gmane.emacs.gnus.cvs
Message-ID <[email protected]>
       via  19c0ca5c8830e654fb9c54cff122fb684e2358f4 (commit)
      from  817dc76866b3a4331fe86ab7914553eac0b618cd (commit)


- Log -----------------------------------------------------------------
commit 19c0ca5c8830e654fb9c54cff122fb684e2358f4
Author: Lars Ingebrigtsen <[email protected]>
Date:   Tue Feb 7 21:14:31 2012 +0100

    Only strip whitespace from too-wide lines in shr
    
    * shr.el (shr-remove-trailing-whitespace): Don't strip whitespace from
    lines that are narrower than the window width.  Otherwise background
    "blocks" will look less readable.

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index dc84593..217fde6 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
+2012-02-07  Lars Ingebrigtsen  <[email protected]>
+
+	* shr.el (shr-remove-trailing-whitespace): Don't strip whitespace from
+	lines that are narrower than the window width.  Otherwise background
+	"blocks" will look less readable.
+
 2012-02-07  Katsumi Yamaoka  <[email protected]>
 
 	* gnus-sum.el (gnus-summary-show-thread): Revert last two changes.
diff --git a/lisp/shr.el b/lisp/shr.el
index deaef1d..7af8e31 100644
--- a/lisp/shr.el
+++ b/lisp/shr.el
@@ -153,16 +153,17 @@ DOM should be a parse tree as generated by
     (shr-remove-trailing-whitespace start (point))))
 
 (defun shr-remove-trailing-whitespace (start end)
+  (let ((width (window-width)))
   (save-restriction
     (narrow-to-region start end)
-    (delete-trailing-whitespace)
     (goto-char start)
     (while (not (eobp))
       (end-of-line)
+	(when (> (current-column) width)
       (dolist (overlay (overlays-at (point)))
 	(when (overlay-get overlay 'before-string)
-	  (overlay-put overlay 'before-string nil)))
-      (forward-line 1))))
+	      (overlay-put overlay 'before-string nil))))
+	(forward-line 1)))))
 
 (defun shr-copy-url ()
   "Copy the URL under point to the kill ring.

-----------------------------------------------------------------------
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 |    6 ++++++
 lisp/shr.el    |   21 +++++++++++----------
 2 files changed, 17 insertions(+), 10 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, no-gnus 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.