[gnus git] branch master updated: m0-5-272-gdddd886 =1= * shr.el: Make all the overlays set the `evaporate' property so that they're removed properly.
Lars Magne Ingebrigtsen <[email protected]>
| Newsgroups | gmane.emacs.gnus.cvs |
|---|---|
| Message-ID | <[email protected]> |
via dddd8865d4a0fd079a0977182793b8db05029f81 (commit)
from 8f34815d386264b0b7b6e79a99dd8848a076faa9 (commit)
- Log -----------------------------------------------------------------
commit dddd8865d4a0fd079a0977182793b8db05029f81
Author: Ted Phelps <[email protected]>
Date: Sun Mar 3 14:10:03 2013 +0100
* shr.el: Make all the overlays set the `evaporate' property so that
they're removed properly.
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 93b1492..b2784f3 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
+2013-03-03 Ted Phelps <[email protected]>
+
+ * shr.el: Make all the overlays set the `evaporate' property so that
+ they're removed properly.
+
2013-02-25 Adam Sjøgren <[email protected]> (tiny change)
* mml2015-el (mml2015-epg-key-image): wrap epg-gpg-program in
diff --git a/lisp/shr.el b/lisp/shr.el
index 886f4da..9bf14ee 100644
--- a/lisp/shr.el
+++ b/lisp/shr.el
@@ -520,6 +520,11 @@ size, and full-buffer size."
(dolist (type types)
(shr-add-font (or shr-start (point)) (point) type))))
+(defun shr-make-overlay (beg end &optional buffer front-advance rear-advance)
+ (let ((overlay (make-overlay beg end buffer front-advance rear-advance)))
+ (overlay-put overlay 'evaporate t)
+ overlay))
+
;; Add an overlay in the region, but avoid putting the font properties
;; on blank text at the start of the line, and the newline at the end,
;; to avoid ugliness.
@@ -529,7 +534,7 @@ size, and full-buffer size."
(while (< (point) end)
(when (bolp)
(skip-chars-forward " "))
- (let ((overlay (make-overlay (point) (min (line-end-position) end))))
+ (let ((overlay (shr-make-overlay (point) (min (line-end-position) end))))
(overlay-put overlay 'face type))
(if (< (line-end-position) end)
(forward-line 1)
@@ -790,7 +795,7 @@ ones, in case fg and bg are nil."
(when (and (< (setq column (current-column)) width)
(< (setq column (shr-previous-newline-padding-width column))
width))
- (let ((overlay (make-overlay (point) (1+ (point)))))
+ (let ((overlay (shr-make-overlay (point) (1+ (point)))))
(overlay-put overlay 'before-string
(concat
(mapconcat
@@ -1238,7 +1243,7 @@ ones, in case fg and bg are nil."
(end-of-line)
(insert line shr-table-vertical-line)
(dolist (overlay overlay-line)
- (let ((o (make-overlay (- (point) (nth 0 overlay) 1)
+ (let ((o (shr-make-overlay (- (point) (nth 0 overlay) 1)
(- (point) (nth 1 overlay) 1)))
(properties (nth 2 overlay)))
(while properties
@@ -1340,7 +1345,7 @@ ones, in case fg and bg are nil."
(let ((end (length (car cache))))
(dolist (overlay (cadr cache))
(let ((new-overlay
- (make-overlay (1+ (- end (nth 0 overlay)))
+ (shr-make-overlay (1+ (- end (nth 0 overlay)))
(1+ (- end (nth 1 overlay)))))
(properties (nth 2 overlay)))
(while properties
-----------------------------------------------------------------------
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we listed those
revisions in full, above.
Summary of changes:
lisp/ChangeLog | 5 +++++
lisp/shr.el | 17 +++++++++++------
2 files changed, 16 insertions(+), 6 deletions(-)
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Gnus Project".
The branch, master has been updated
hooks/post-receive
--
Gnus Project