]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/net/shr.el (shr-tag-li): Speed up rendering pages with lots of <ul>
authorLars Magne Ingebrigtsen <larsi@gnus.org>
Fri, 13 Feb 2015 04:51:23 +0000 (15:51 +1100)
committerLars Magne Ingebrigtsen <larsi@gnus.org>
Fri, 13 Feb 2015 04:51:23 +0000 (15:51 +1100)
lisp/ChangeLog
lisp/net/shr.el

index ff2755df630e7d190b93e6c0dc6d2c597787507b..8393009c061e939f287f196ad5e91be2252e3eb6 100644 (file)
@@ -1,3 +1,8 @@
+2015-02-13  Lars Ingebrigtsen  <larsi@gnus.org>
+
+       * net/shr.el (shr-tag-li): Speed up rendering pages with lots of
+       <ul>.
+
 2015-02-12  Oleh Krehel  <ohwoeowho@gmail.com>
 
        * progmodes/gdb-mi.el (gdb-display-io-nopopup): New defcustom.
index cf35a1287d64c1a994342a470ac707f8ca32f093..f6a390e4d0adb4b6737dd670e2f124ef3e1d56b3 100644 (file)
@@ -157,6 +157,7 @@ cid: URL as the argument.")
 (defvar shr-table-separator-pixel-width 0)
 (defvar shr-table-id nil)
 (defvar shr-current-font nil)
+(defvar shr-internal-bullet nil)
 
 (defvar shr-map
   (let ((map (make-sparse-keymap)))
@@ -216,6 +217,8 @@ DOM should be a parse tree as generated by
        (shr-table-id 0)
        (shr-warning nil)
        (shr-table-separator-pixel-width (shr-string-pixel-width "-"))
+       (shr-internal-bullet (cons shr-bullet
+                                  (shr-string-pixel-width shr-bullet)))
        (shr-internal-width (or (and shr-width
                                     (if (not shr-use-fonts)
                                         shr-width
@@ -1408,11 +1411,13 @@ The preference is a float determined from `shr-prefer-media-type'."
                (prog1
                    (format "%d " shr-list-mode)
                  (setq shr-list-mode (1+ shr-list-mode)))
-             shr-bullet)))
+             (car shr-internal-bullet)))
+          (width (if (numberp shr-list-mode)
+                     (shr-string-pixel-width bullet)
+                   (cdr shr-internal-bullet))))
       (insert bullet)
       (shr-mark-fill start)
-      (let ((shr-indentation (+ shr-indentation
-                               (shr-string-pixel-width bullet))))
+      (let ((shr-indentation (+ shr-indentation width)))
        (put-text-property start (1+ start)
                           'shr-continuation-indentation shr-indentation)
        (put-text-property start (1+ start) 'shr-prefix-length (length bullet))