[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] /srv/bzr/emacs/trunk r102404: Allow gnus-html to register
From: |
Katsumi Yamaoka |
Subject: |
[Emacs-diffs] /srv/bzr/emacs/trunk r102404: Allow gnus-html to register image displayer callbacks. |
Date: |
Tue, 16 Nov 2010 00:04:25 +0000 |
User-agent: |
Bazaar (2.0.3) |
------------------------------------------------------------
revno: 102404
author: Lars Magne Ingebrigtsen <address@hidden>
committer: Katsumi Yamaoka <address@hidden>
branch nick: trunk
timestamp: Tue 2010-11-16 00:04:25 +0000
message:
Allow gnus-html to register image displayer callbacks.
gnus-html.el (gnus-html-wash-images): Register a displayer.
gnus-util.el (gnus-find-text-property-region): Return markers.
modified:
lisp/gnus/ChangeLog
lisp/gnus/gnus-html.el
lisp/gnus/gnus-util.el
=== modified file 'lisp/gnus/ChangeLog'
--- a/lisp/gnus/ChangeLog 2010-11-15 23:45:55 +0000
+++ b/lisp/gnus/ChangeLog 2010-11-16 00:04:25 +0000
@@ -1,5 +1,9 @@
2010-11-15 Lars Magne Ingebrigtsen <address@hidden>
+ * gnus-html.el (gnus-html-wash-images): Register a displayer.
+
+ * gnus-util.el (gnus-find-text-property-region): Return markers.
+
* shr.el (shr-tag-img): Put a displayer in the text property.
* gnus-util.el (gnus-find-text-property-region): New utility function.
=== modified file 'lisp/gnus/gnus-html.el'
--- a/lisp/gnus/gnus-html.el 2010-11-15 23:45:55 +0000
+++ b/lisp/gnus/gnus-html.el 2010-11-16 00:04:25 +0000
@@ -189,19 +189,26 @@
(let* ((handle (mm-get-content-id
(setq url (match-string 1 url))))
(image (when handle
- (gnus-create-image (mm-with-part handle
(buffer-string))
- nil t))))
+ (gnus-create-image
+ (mm-with-part handle (buffer-string))
+ nil t))))
(when image
(let ((string (buffer-substring start end)))
(delete-region start end)
- (gnus-put-image (gnus-rescale-image image
(gnus-html-maximum-image-size))
+ (gnus-put-image (gnus-rescale-image
+ image (gnus-html-maximum-image-size))
(gnus-string-or string "*") 'cid)
(gnus-add-image 'cid image))))
;; Normal, external URL.
- (let ((alt-text (when (string-match
"\\(alt\\|title\\)=\"\\([^\"]+\\)"
- parameters)
- (xml-substitute-special (match-string 2
parameters)))))
+ (let ((alt-text
+ (when (string-match "\\(alt\\|title\\)=\"\\([^\"]+\\)"
+ parameters)
+ (xml-substitute-special (match-string 2 parameters)))))
(gnus-put-text-property start end 'image-url url)
+ (gnus-put-text-property
+ start end 'image-displayer
+ (lambda (url start end)
+ (gnus-html-display-image url start end)))
(if (gnus-html-image-url-blocked-p
url
(if (buffer-live-p gnus-summary-buffer)
=== modified file 'lisp/gnus/gnus-util.el'
--- a/lisp/gnus/gnus-util.el 2010-11-15 23:45:55 +0000
+++ b/lisp/gnus/gnus-util.el 2010-11-16 00:04:25 +0000
@@ -288,7 +288,10 @@
(if (not end)
(setq start nil)
(when value
- (push (list start end value) regions))
+ (push (list (set-marker (make-marker) start)
+ (set-marker (make-marker) end)
+ value)
+ regions))
(setq start (next-single-property-change start prop))))
(nreverse regions)))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] /srv/bzr/emacs/trunk r102404: Allow gnus-html to register image displayer callbacks.,
Katsumi Yamaoka <=