]> git.eshelyaron.com Git - emacs.git/commitdiff
shr table rendering touch-ups
authorLars Magne Ingebrigtsen <larsi@gnus.org>
Tue, 6 Aug 2013 21:28:38 +0000 (23:28 +0200)
committerLars Magne Ingebrigtsen <larsi@gnus.org>
Tue, 6 Aug 2013 21:28:38 +0000 (23:28 +0200)
* net/shr.el (shr-render-td): Remove debugging.
(shr-render-td): Make width computation consistent by defaulting
all zero-width columns to 10 characters.  This may not be optimal,
but it's at least consistent.

lisp/ChangeLog
lisp/net/shr.el

index 5f243b82e04693a226768ea4e8b6170f3c879326..381ded5e6975df07a66fb5ecc9cb200e85061b1c 100644 (file)
@@ -1,3 +1,10 @@
+2013-08-06  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+
+       * net/shr.el (shr-render-td): Remove debugging.
+       (shr-render-td): Make width computation consistent by defaulting
+       all zero-width columns to 10 characters.  This may not be optimal,
+       but it's at least consistent.
+
 2013-08-06  Dmitry Antipov  <dmantipov@yandex.ru>
 
        * files.el (cache-long-line-scans): Make
index 89791511e093d91d96aefa39a54cb302bcbac6f8..281ad3630a423bf9fad5f59ae96c18cbf868b34e 100644 (file)
@@ -1496,11 +1496,11 @@ ones, in case fg and bg are nil."
                                   shr-table-separator-length
                                   (aref widths (+ i 1 j))))))
                (setq width-column (+ width-column (1- colspan))))
+             ;; Sanity check for degenerate tables.
+             (when (zerop width)
+               (setq width 10))
              (when (or column
                        (not fill))
-               ;; Sanity check for degenerate tables.
-               (when (zerop width)
-                 (setq width 10))
                (push (shr-render-td (cdr column) width fill)
                      tds))
              (setq i (1+ i)
@@ -1509,7 +1509,6 @@ ones, in case fg and bg are nil."
     (nreverse trs)))
 
 (defun shr-render-td (cont width fill)
-  (when (= width 0) (debug))
   (with-temp-buffer
     (let ((bgcolor (cdr (assq :bgcolor cont)))
          (fgcolor (cdr (assq :fgcolor cont)))
@@ -1577,7 +1576,7 @@ ones, in case fg and bg are nil."
                  (split-string (buffer-string) "\n")
                  nil
                  (car actual-colors))
-         max)))))
+         (max max 10))))))
 
 (defun shr-buffer-width ()
   (goto-char (point-min))