From: Lars Magne Ingebrigtsen Date: Tue, 10 Feb 2015 05:54:13 +0000 (+1100) Subject: (shr-tag-hr): Compute the right length when using fonts. X-Git-Tag: emacs-25.0.90~2008^2~37 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=50f64a3653f4b55b2ef39970120a9445dcafabed;p=emacs.git (shr-tag-hr): Compute the right length when using fonts. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c4c329ef5ce..035cdd9e809 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -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 diff --git a/lisp/net/shr.el b/lisp/net/shr.el index e929f48b5fd..aa4c2227def 100644 --- a/lisp/net/shr.el +++ b/lisp/net/shr.el @@ -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))