]> git.eshelyaron.com Git - emacs.git/commitdiff
(shr-tag-hr): Compute the right length when using fonts.
authorLars Magne Ingebrigtsen <larsi@gnus.org>
Tue, 10 Feb 2015 05:54:13 +0000 (16:54 +1100)
committerLars Magne Ingebrigtsen <larsi@gnus.org>
Tue, 10 Feb 2015 05:54:13 +0000 (16:54 +1100)
lisp/ChangeLog
lisp/net/shr.el

index c4c329ef5cee8beeefc3d42941e3d5b7ac4acfd6..035cdd9e809993787841d8ba074279a08c521515 100644 (file)
@@ -34,6 +34,7 @@
        (shr-dom-max-natural-width): New function.
        (shr-tag-h1): Don't use variable-pitch fonts on fontless rendering.
        (shr-tag-tt): New function.
+       (shr-tag-hr): Compute the right length when using fonts.
 
 2015-02-10  Fabián Ezequiel Gallina  <fgallina@gnu.org>
 
index e929f48b5fd521489c58f195744c682f08aa5002..aa4c2227def93fdf3cb98ad1b66b9c606075ba31 100644 (file)
@@ -1476,8 +1476,12 @@ The preference is a float determined from `shr-prefer-media-type'."
 
 (defun shr-tag-hr (_dom)
   (shr-ensure-newline)
-  ;; FIXME: Should try to make a line of the required pixel size.
-  (insert (make-string (window-width) shr-hr-line) "\n"))
+  (insert (make-string (if (not shr-use-fonts)
+                          shr-internal-width
+                        (1+ (/ shr-internal-width
+                               shr-table-separator-pixel-width)))
+                      shr-hr-line)
+         "\n"))
 
 (defun shr-tag-title (dom)
   (shr-heading dom 'bold 'underline))