Merge changes made in Gnus trunk.

shr.el: Rename the tag functions a bit, and add some new ones.
gnus-sum.el (gnus-summary-select-article-buffer): If the article buffer isn't shown, then select the current article first instead of bugging out.
gnus-sum.el (gnus-summary-select-article-buffer): Show both the article and summary buffers again.
shr.el (shr-tag-blockquote): Convert name.
shr.el (shr-rescale-image): Use the right image-size variant.
shr.el (shr-tag-p): Don't insert newlines at the start of the buffer.
shr.el: Implement indentation in blockquotes.
gnus-sum.el (gnus-summary-select-article-buffer): Really select the article buffer again.
shr.el (shr-ensure-paragraph): Don't insert newlines on empty tags at the beginning of the buffer.
gnus-ems.el, gnus-util.el, mm-decode.el, mm-view.el: Add resize for large images in mm.
gnus-html.el (gnus-html-put-image): Use gnus-rescale-image.
shr.el (shr-tag-p): Don't insert newlines on empty tags at the beginning of the buffer.
gnus-ems.el, gnus-html.el, gnus-util.el, mm-decode.el, mm-view.el: Support image resizing.
shr.el: Add headings.
shr.el (shr-ensure-paragraph): Actually work.
shr.el (shr-tag-li): Make <ul> prettier.
shr.el (shr-insert): Get white space at the beginning/end of elements right.
shr.el (shr-tag-li): Tweak <li> rendering.
shr.el (shr-tag-p): Collapse subsequent <p>s.
shr.el (shr-ensure-paragraph): Don't insert double line feeds after blank lines.
shr.el (shr-tag-h6): Add.
shr.el (shr-insert): \t is also space.
This commit is contained in:
Gnus developers 2010-10-04 00:17:16 +00:00 committed by Katsumi Yamaoka
parent 728a982db4
commit a41c2e6d33
10 changed files with 250 additions and 69 deletions

View file

@ -32,6 +32,7 @@
(require 'smime)
(autoload 'gnus-completing-read "gnus-util")
(autoload 'gnus-window-inside-pixel-edges "gnus-ems")
(autoload 'gnus-article-prepare-display "gnus-art")
(autoload 'vcard-parse-string "vcard")
(autoload 'vcard-format-string "vcard")
@ -76,6 +77,13 @@
:version "22.1"
:group 'mime-display)
(defcustom mm-inline-large-images-proportion 0.9
"Maximum proportion of large image resized when
`mm-inline-large-images' is set to resize."
:type 'float
:version "24.1"
:group 'mime-display)
;;; Internal variables.
;;;
@ -85,7 +93,18 @@
(defun mm-inline-image-emacs (handle)
(let ((b (point-marker))
(inhibit-read-only t))
(put-image (mm-get-image handle) b)
(put-image
(let ((image (mm-get-image handle)))
(if (eq mm-inline-large-images 'resize)
(gnus-rescale-image image
(let ((edges (gnus-window-inside-pixel-edges
(get-buffer-window (current-buffer)))))
(cons (truncate (* mm-inline-large-images-proportion
(- (nth 2 edges) (nth 0 edges))))
(truncate (* mm-inline-large-images-proportion
(- (nth 3 edges) (nth 1 edges)))))))
image))
b)
(insert "\n\n")
(mm-handle-set-undisplayer
handle