emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r103063: shr.el (shr-render-td): Only


From: Katsumi Yamaoka
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r103063: shr.el (shr-render-td): Only do colours at the final rendering. Should be slightly faster.
Date: Tue, 01 Feb 2011 03:54:46 +0000
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 103063
author: Lars Ingebrigtsen <address@hidden>
committer: Katsumi Yamaoka <address@hidden>
branch nick: trunk
timestamp: Tue 2011-02-01 03:54:46 +0000
message:
  shr.el (shr-render-td): Only do colours at the final rendering. Should be 
slightly faster.
   (shr-insert-table): Fix up TD background colours when doing the vertical 
padding.
  gnus-art.el (article-update-date-lapsed): Don't use current-column to find 
the horizontal position.  It's fragile in the presence of \003 characters.
modified:
  lisp/gnus/ChangeLog
  lisp/gnus/gnus-art.el
  lisp/gnus/shr.el
=== modified file 'lisp/gnus/ChangeLog'
--- a/lisp/gnus/ChangeLog       2011-02-01 02:23:24 +0000
+++ b/lisp/gnus/ChangeLog       2011-02-01 03:54:46 +0000
@@ -1,7 +1,14 @@
 2011-02-01  Lars Ingebrigtsen  <address@hidden>
 
+       * shr.el (shr-render-td): Only do colours at the final rendering.
+       Should be slightly faster.
+       (shr-insert-table): Fix up TD background colours when doing the
+       vertical padding.
+
        * gnus-art.el (article-date-ut): Protect against articles with no Date
        header.
+       (article-update-date-lapsed): Don't use current-column to find the
+       horizontal position.  It's fragile in the presence of \003 characters.
 
        * gnus-start.el (gnus-read-active-file-1): Remove dead parameter infos.
 

=== modified file 'lisp/gnus/gnus-art.el'
--- a/lisp/gnus/gnus-art.el     2011-02-01 02:23:24 +0000
+++ b/lisp/gnus/gnus-art.el     2011-02-01 03:54:46 +0000
@@ -3645,7 +3645,7 @@
           (set-buffer (window-buffer w))
           (when (eq major-mode 'gnus-article-mode)
             (let ((old-line (count-lines (point-min) (point)))
-                  (old-column (current-column)))
+                  (old-column (- (point) (line-beginning-position))))
               (goto-char (point-min))
               (while (re-search-forward "^Date:" nil t)
                 (let ((type (get-text-property (match-beginning 0) 
'gnus-date-type)))

=== modified file 'lisp/gnus/shr.el'
--- a/lisp/gnus/shr.el  2011-01-27 13:20:55 +0000
+++ b/lisp/gnus/shr.el  2011-02-01 03:54:46 +0000
@@ -1055,8 +1055,11 @@
          ;; possibly.
          (dotimes (i (- height (length lines)))
            (end-of-line)
-           (insert (make-string (string-width (car lines)) ? )
-                   shr-table-vertical-line)
+           (let ((start (point)))
+             (insert (make-string (string-width (car lines)) ? )
+                     shr-table-vertical-line)
+             (when (nth 4 column)
+               (shr-put-color start (1- (point)) :background (nth 4 column))))
            (forward-line 1)))))
     (shr-insert-table-ruler widths)))
 
@@ -1173,17 +1176,18 @@
              (end-of-line)
              (when (> (- width (current-column)) 0)
                (insert (make-string (- width (current-column)) ? )))
-             (forward-line 1))))
-       (when style
-         (shr-colorize-region
-          (point-min) (point-max)
-          (cdr (assq 'color shr-stylesheet))
-          (cdr (assq 'background-color shr-stylesheet))))
+             (forward-line 1)))
+         (when style
+           (shr-colorize-region
+            (point-min) (point-max)
+            (cdr (assq 'color shr-stylesheet))
+            (cdr (assq 'background-color shr-stylesheet)))))
        (if fill
            (list max
                  (count-lines (point-min) (point-max))
                  (split-string (buffer-string) "\n")
-                 (shr-collect-overlays))
+                 (shr-collect-overlays)
+                 (cdr (assq 'background-color shr-stylesheet)))
          (list max
                (shr-natural-width)))))))
 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]