(shr-expand-newlines): Switch to using overlays to enable kill'n'yank in a more sensi...
authorLars Magne Ingebrigtsen <larsi@gnus.org>
Mon, 24 Jan 2011 23:24:18 +0000 (15:24 -0800)
committerLars Magne Ingebrigtsen <larsi@gnus.org>
Mon, 24 Jan 2011 23:24:18 +0000 (15:24 -0800)
lisp/ChangeLog
lisp/shr.el

index cd5e4f6..3778616 100644 (file)
@@ -2,6 +2,8 @@
 
        * shr.el (shr-expand-newlines): Proof of concept implemantation of boxy
        backgrounds.
+       (shr-expand-newlines): Switch to using overlays to enable kill'n'yank
+       in a more sensible manner.
 
 2011-01-24  Teodor Zlatanov  <tzz@lifelogs.com>
 
index be87ec6..e2c51bb 100644 (file)
@@ -655,12 +655,11 @@ ones, in case fg and bg are nil."
       (while (not (eobp))
        (end-of-line)
        (when (and (< (setq current-column (current-column)) width)
-                  (not (get-text-property (point) 'display)))
-         (put-text-property
-          (point) (1+ (point)) 'display
-          (concat (propertize (make-string (- width current-column) ? )
-                              'face (list :background color))
-                  "\n")))
+                  (not (overlays-at (point))))
+         (let ((overlay (make-overlay (point) (1+ (point)))))
+           (overlay-put overlay 'before-string
+                        (propertize (make-string (- width current-column) ? )
+                                    'face (list :background color)))))
        (forward-line 1)))))
 
 (defun shr-put-color-1 (start end type color)