2010-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
+ * gnus-html.el (gnus-html-put-image): Allow images to be removed.
+ (gnus-html-wash-tags): Add a new `i' command to insert images.
+ (gnus-html-insert-image): New command and keystroke.
+
+ * gnus-agent.el (gnus-agent-auto-agentize-methods): Change the default
+ so that nnimap methods aren't agentized by default. There's apparently
+ many problems related to agent/imap behaviour.
+
* gnus-art.el (gnus-article-copy-string): New command and key binding.
* gnus-html.el: Doc fix.
'gnus-button-push from)
(gnus-put-text-property
start end
- 'gnus-data (buffer-substring-no-properties
- start end))))))))))
+ 'gnus-string (buffer-substring-no-properties
+ start end))))))))))
(defun gnus-article-extend-url-button (beg start end)
"Extend url button if url is folded into two or more lines.
"Copy the string in the button to the kill ring."
(interactive)
(gnus-article-check-buffer)
- (let ((data (get-text-property (point) 'gnus-data)))
+ (let ((data (get-text-property (point) 'gnus-string)))
(when data
(with-temp-buffer
(insert data)
:group 'gnus-art
:type 'float)
+(defvar gnus-html-image-map
+ (let ((map (make-sparse-keymap)))
+ (define-key map "u" 'gnus-article-copy-string)
+ (define-key map "i" 'gnus-html-insert-image)
+ map))
+
;;;###autoload
(defun gnus-article-html (handle)
(let ((article-buffer (current-buffer)))
(delete-region start end)
(gnus-put-image image (gnus-string-or string "*")))))
;; Normal, external URL.
- (unless (gnus-html-image-url-blocked-p
- url
- (if (buffer-live-p gnus-summary-buffer)
- (with-current-buffer gnus-summary-buffer
- gnus-blocked-images)
- gnus-blocked-images))
+ (if (gnus-html-image-url-blocked-p
+ url
+ (if (buffer-live-p gnus-summary-buffer)
+ (with-current-buffer gnus-summary-buffer
+ gnus-blocked-images)
+ gnus-blocked-images))
+ (progn
+ (widget-convert-button
+ 'link start end
+ :action 'gnus-html-insert-image
+ :help-echo url
+ :keymap gnus-html-image-map
+ :button-keymap gnus-html-image-map)
+ (gnus-put-text-property
+ start end
+ 'gnus-image (list url
+ (set-marker (make-marker) start)
+ (set-marker (make-marker) end))))
(let ((file (gnus-html-image-id url))
width height)
(when (string-match "height=\"?\\([0-9]+\\)" parameters)
(let ((overlay (gnus-make-overlay start end)))
(gnus-overlay-put overlay 'evaporate t)
(gnus-overlay-put overlay 'gnus-button-url url)
+ (gnus-put-text-property start end 'gnus-string url)
(when gnus-article-mouse-face
(gnus-overlay-put overlay 'mouse-face gnus-article-mouse-face)))))
;; The upper-case IMG_ALT is apparently just an artifact that
(when images
(gnus-html-schedule-image-fetching (current-buffer) (nreverse images)))))
+(defun gnus-html-insert-image ()
+ "Fetch and insert the image under point."
+ (interactive)
+ (gnus-html-schedule-image-fetching
+ (current-buffer) (list (get-text-property (point) 'gnus-image))))
+
(defun gnus-html-schedule-image-fetching (buffer images)
(gnus-message 8 "gnus-html-schedule-image-fetching: buffer %s, images %s"
buffer images)
(= (cdr size) 30))))
(progn
(gnus-put-image (gnus-html-rescale-image image file size)
- (gnus-string-or string "*"))
+ (gnus-string-or string "*")
+ 'external)
+ (gnus-add-image 'external image)
t)
(insert string)
(when (fboundp 'find-image)