]> code.delx.au - gnu-emacs/commitdiff
Remove code left over from when overlays were used for padding
authorLars Magne Ingebrigtsen <larsi@gnus.org>
Sun, 20 Mar 2016 11:54:24 +0000 (12:54 +0100)
committerLars Magne Ingebrigtsen <larsi@gnus.org>
Sun, 20 Mar 2016 11:54:24 +0000 (12:54 +0100)
* lisp/net/shr.el (shr-previous-newline-padding-width): Remove.
(shr-remove-trailing-whitespace): Ditto.
(shr-insert-document): Don't call them.

lisp/net/shr.el

index 6bb6898188d54c187a77480b16a39700934afbad..0a7ea14b2527842c9700904772840f011c11b283 100644 (file)
@@ -275,7 +275,6 @@ DOM should be a parse tree as generated by
     (shr-descend dom)
     (shr-fill-lines start (point))
     (shr--remove-blank-lines-at-the-end start (point))
-    (shr-remove-trailing-whitespace start (point))
     (when shr-warning
       (message "%s" shr-warning))))
 
@@ -292,19 +291,6 @@ DOM should be a parse tree as generated by
         (unless (bolp)
           (insert "\n"))))))
 
-(defun shr-remove-trailing-whitespace (start end)
-  (let ((width (window-width)))
-    (save-restriction
-      (narrow-to-region start end)
-      (goto-char start)
-      (while (not (eobp))
-       (end-of-line)
-       (when (> (shr-previous-newline-padding-width (current-column)) width)
-         (dolist (overlay (overlays-at (point)))
-           (when (overlay-get overlay 'before-string)
-             (overlay-put overlay 'before-string nil))))
-       (forward-line 1)))))
-
 (defun shr-copy-url (&optional image-url)
   "Copy the URL under point to the kill ring.
 If IMAGE-URL (the prefix) is non-nil, or there is no link under
@@ -1172,18 +1158,6 @@ ones, in case fg and bg are nil."
                                  t)))
       new-colors)))
 
-(defun shr-previous-newline-padding-width (width)
-  (let ((overlays (overlays-at (point)))
-       (previous-width 0))
-    (if (null overlays)
-       width
-      (dolist (overlay overlays)
-       (setq previous-width
-             (+ previous-width
-                (length (plist-get (overlay-properties overlay)
-                                   'before-string)))))
-      (+ width previous-width))))
-
 ;;; Tag-specific rendering rules.
 
 (defun shr-tag-html (dom)