]> git.eshelyaron.com Git - emacs.git/commitdiff
(shr-make-table-1): Add comments.
authorLars Magne Ingebrigtsen <larsi@gnus.org>
Mon, 26 Jan 2015 05:35:51 +0000 (16:35 +1100)
committerLars Magne Ingebrigtsen <larsi@gnus.org>
Mon, 26 Jan 2015 05:35:51 +0000 (16:35 +1100)
lisp/ChangeLog
lisp/net/shr.el

index 8af0ec46cadde938be88596813d4e1806b05cabe..1bb003c9205cb02b6c2a28b7edf3e23a9afdd1bc 100644 (file)
@@ -1,6 +1,7 @@
 2015-01-26  Lars Ingebrigtsen  <larsi@gnus.org>
 
        * net/shr.el (shr-make-table-1): Fix colspan typo.
+       (shr-make-table-1): Add comments.
 
        * net/eww.el (eww-add-bookmark): Fix prompt and clean up the code
        slightly.
index a0c9eba4144f5bfb665cce6f83b605bffcc1bcbd..f4c765f4d25678d0d7ac51d0bd29d3b190917599 100644 (file)
@@ -1667,11 +1667,17 @@ The preference is a float determined from `shr-prefer-media-type'."
                                   ;; remaining columns.
                                   (- (length widths) i)))
                (dotimes (j (1- colspan))
-                 (if (> (+ i 1 j) (1- (length widths)))
-                     (setq width (aref widths (1- (length widths))))
-                   (setq width (+ width
-                                  shr-table-separator-length
-                                  (aref widths (+ i 1 j))))))
+                 (setq width
+                       (if (> (+ i 1 j) (1- (length widths)))
+                           ;; If we have a colspan spec that's longer
+                           ;; than the table is wide, just use the last
+                           ;; width as the width.
+                           (aref widths (1- (length widths)))
+                         ;; Sum up the widths of the columns we're
+                         ;; spanning.
+                         (+ width
+                            shr-table-separator-length
+                            (aref widths (+ i 1 j))))))
                (setq width-column (+ width-column (1- colspan))))
              (when (or column
                        (not fill))