emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 50f64a3: (shr-tag-hr): Compute the right length whe


From: Lars Ingebrigtsen
Subject: [Emacs-diffs] master 50f64a3: (shr-tag-hr): Compute the right length when using fonts.
Date: Tue, 10 Feb 2015 05:54:20 +0000

branch: master
commit 50f64a3653f4b55b2ef39970120a9445dcafabed
Author: Lars Magne Ingebrigtsen <address@hidden>
Commit: Lars Magne Ingebrigtsen <address@hidden>

    (shr-tag-hr): Compute the right length when using fonts.
---
 lisp/ChangeLog  |    1 +
 lisp/net/shr.el |    8 ++++++--
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index c4c329e..035cdd9 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  <address@hidden>
 
diff --git a/lisp/net/shr.el b/lisp/net/shr.el
index e929f48..aa4c222 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))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]