(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.
+ (shr-table-widths): Off-by-one error in width computation.
+ (shr-expand-newlines): Remove dead code.
+ (shr-insert-table): Extend background colors to the end of the column.
2015-02-10 Fabián Ezequiel Gallina <fgallina@gnu.org>
t)))
new-colors)))
-(defun shr-expand-newlines (start end color)
- (save-restriction
- ;; Skip past all white space at the start and ends.
- (goto-char start)
- (skip-chars-forward " \t\n")
- (beginning-of-line)
- (setq start (point))
- (goto-char end)
- (skip-chars-backward " \t\n")
- (forward-line 1)
- (setq end (point))
- (narrow-to-region start end)
- (let ((width (shr-buffer-width))
- column)
- (goto-char (point-min))
- (while (not (eobp))
- (end-of-line)
- (when (and (< (setq column (current-column)) width)
- (< (setq column (shr-previous-newline-padding-width column))
- width))
- (let ((overlay (make-overlay (point) (1+ (point)))))
- (overlay-put overlay 'before-string
- (concat
- (mapconcat
- (lambda (overlay)
- (let ((string (plist-get
- (overlay-properties overlay)
- 'before-string)))
- (if (not string)
- ""
- (overlay-put overlay 'before-string "")
- string)))
- (overlays-at (point))
- "")
- (propertize (make-string (- width column) ? )
- 'face (list :background color))))))
- (forward-line 1)))))
-
(defun shr-previous-newline-padding-width (width)
(let ((overlays (overlays-at (point)))
(previous-width 0))
(dolist (line lines)
(end-of-line)
(let ((start (point)))
- (insert line
- (propertize " "
- 'display `(space :align-to (,pixel-align))
- 'shr-table-indent shr-table-id)
- shr-table-vertical-line)
+ (insert
+ line
+ (propertize " "
+ 'display `(space :align-to (,pixel-align))
+ 'face (and (> (length line) 0)
+ (get-text-property
+ (1- (length line)) 'face line))
+ 'shr-table-indent shr-table-id)
+ shr-table-vertical-line)
(shr-colorize-region
start (1- (point)) (nth 5 column) (nth 6 column)))
(forward-line 1))
(setq i (1+ i)))))
(let ((extra (- (apply '+ (append suggested-widths nil))
(apply '+ (append widths nil))
- (* shr-table-separator-pixel-width (length widths))))
+ (* shr-table-separator-pixel-width (1+ (length widths)))))
(expanded-columns 0))
;; We have extra, unused space, so divide this space amongst the
;; columns.