]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix shr table rendering infloop
authorLars Magne Ingebrigtsen <larsi@gnus.org>
Sun, 30 Jun 2013 13:11:41 +0000 (15:11 +0200)
committerLars Magne Ingebrigtsen <larsi@gnus.org>
Sun, 30 Jun 2013 13:11:41 +0000 (15:11 +0200)
* net/shr.el (shr-make-table-1): Add a sanity check that allows
progression on degenerate tables.
(shr-rescale-image): ImageMagick animated images currently doesn't
work.

lisp/ChangeLog
lisp/net/shr.el

index 4100efc4d6dc885dbed526b57ab008b77f84ade1..4aa4f37a323de80f795f409f8db8f1d4da0b6d98 100644 (file)
@@ -1,3 +1,10 @@
+2013-06-30  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+
+       * net/shr.el (shr-make-table-1): Add a sanity check that allows
+       progression on degenerate tables.
+       (shr-rescale-image): ImageMagick animated images currently doesn't
+       work.
+
 2013-06-30  Juanma Barranquero  <lekktu@gmail.com>
 
        Some fixes and improvements for desktop frame restoration.
index 490bea40afd45e990dbbe9f21a4c5bc11dcfb30b..bdc30bc92920d9ebc69eae1a2d1dfd200af72db4 100644 (file)
@@ -762,6 +762,7 @@ If EXTERNAL, browse the URL using `shr-external-browser'."
   "Rescale DATA, if too big, to fit the current buffer.
 If FORCE, rescale the image anyway."
   (if (or (not (fboundp 'imagemagick-types))
+         (eq (image-type-from-data data) 'gif)
          (not (get-buffer-window (current-buffer))))
       (create-image data nil t :ascent 100)
     (let ((edges (window-inside-pixel-edges
@@ -1473,7 +1474,10 @@ ones, in case fg and bg are nil."
              (setq width
                    (if column
                        (aref widths width-column)
-                     0))
+                     10))
+             ;; Sanity check for degenerate tables.
+             (when (zerop width)
+               (setq width 10))
              (when (and fill
                         (setq colspan (cdr (assq :colspan (cdr column)))))
                (setq colspan (string-to-number colspan))