aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/gnus/ChangeLog5
-rw-r--r--lisp/gnus/gnus-html.el23
-rw-r--r--lisp/gnus/message.el3
3 files changed, 20 insertions, 11 deletions
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index 18c5d55afe0..00c723444fe 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,6 +1,11 @@
12010-09-02 Lars Magne Ingebrigtsen <larsi@gnus.org> 12010-09-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
2 2
3 * message.el (message-generate-hashcash): Change default to
4 'opportunistic if hashcash is installed.
5
3 * gnus-html.el (gnus-html-rescale-image): Fix up typo in rescaling. 6 * gnus-html.el (gnus-html-rescale-image): Fix up typo in rescaling.
7 (gnus-html-put-image): Only call image-size once, since it's somewhat
8 time-consuming on remote X servers.
4 9
52010-09-02 Katsumi Yamaoka <yamaoka@jpl.org> 102010-09-02 Katsumi Yamaoka <yamaoka@jpl.org>
6 11
diff --git a/lisp/gnus/gnus-html.el b/lisp/gnus/gnus-html.el
index a503859aa21..711cd3810d4 100644
--- a/lisp/gnus/gnus-html.el
+++ b/lisp/gnus/gnus-html.el
@@ -243,8 +243,10 @@ fit these criteria."
243 243
244(defun gnus-html-put-image (file point string) 244(defun gnus-html-put-image (file point string)
245 (when (display-graphic-p) 245 (when (display-graphic-p)
246 (let ((image (ignore-errors 246 (let* ((image (ignore-errors
247 (gnus-create-image file)))) 247 (gnus-create-image file)))
248 (size (and image
249 (image-size image t))))
248 (save-excursion 250 (save-excursion
249 (goto-char point) 251 (goto-char point)
250 (if (and image 252 (if (and image
@@ -252,10 +254,10 @@ fit these criteria."
252 ;; seems to be a signal of a broken image. 254 ;; seems to be a signal of a broken image.
253 (not (and (listp image) 255 (not (and (listp image)
254 (eq (plist-get (cdr image) :type) 'gif) 256 (eq (plist-get (cdr image) :type) 'gif)
255 (= (car (image-size image t)) 30) 257 (= (car size) 30)
256 (= (cdr (image-size image t)) 30)))) 258 (= (cdr size) 30))))
257 (progn 259 (progn
258 (gnus-put-image (gnus-html-rescale-image image file) 260 (gnus-put-image (gnus-html-rescale-image image file size)
259 (gnus-string-or string "*")) 261 (gnus-string-or string "*"))
260 t) 262 t)
261 (insert string) 263 (insert string)
@@ -265,12 +267,12 @@ fit these criteria."
265 (gnus-string-or string "*"))) 267 (gnus-string-or string "*")))
266 nil))))) 268 nil)))))
267 269
268(defun gnus-html-rescale-image (image file) 270(defun gnus-html-rescale-image (image file size)
269 (if (or (not (fboundp 'imagemagick-types)) 271 (if (or (not (fboundp 'imagemagick-types))
270 (not (get-buffer-window (current-buffer)))) 272 (not (get-buffer-window (current-buffer))))
271 image 273 image
272 (let* ((width (car (image-size image t))) 274 (let* ((width (car size))
273 (height (cdr (image-size image t))) 275 (height (cdr size))
274 (edges (window-pixel-edges (get-buffer-window (current-buffer)))) 276 (edges (window-pixel-edges (get-buffer-window (current-buffer))))
275 (window-width (truncate (* gnus-max-image-proportion 277 (window-width (truncate (* gnus-max-image-proportion
276 (- (nth 2 edges) (nth 0 edges))))) 278 (- (nth 2 edges) (nth 0 edges)))))
@@ -280,8 +282,9 @@ fit these criteria."
280 (when (> height window-height) 282 (when (> height window-height)
281 (setq image (or (create-image file 'imagemagick nil 283 (setq image (or (create-image file 'imagemagick nil
282 :height window-height) 284 :height window-height)
283 image))) 285 image))
284 (when (> (car (image-size image t)) window-width) 286 (setq size (image-size image t)))
287 (when (> (car size) window-width)
285 (setq image (or 288 (setq image (or
286 (create-image file 'imagemagick nil 289 (create-image file 'imagemagick nil
287 :width window-width) 290 :width window-width)
diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el
index 96fa7c574d5..13706ae55f8 100644
--- a/lisp/gnus/message.el
+++ b/lisp/gnus/message.el
@@ -1726,13 +1726,14 @@ functionality to work."
1726 (const :tag "Never" nil) 1726 (const :tag "Never" nil)
1727 (const :tag "Always" t))) 1727 (const :tag "Always" t)))
1728 1728
1729(defcustom message-generate-hashcash (if (executable-find "hashcash") t) 1729(defcustom message-generate-hashcash (if (executable-find "hashcash") 'opportunistic)
1730 "*Whether to generate X-Hashcash: headers. 1730 "*Whether to generate X-Hashcash: headers.
1731If t, always generate hashcash headers. If `opportunistic', 1731If t, always generate hashcash headers. If `opportunistic',
1732only generate hashcash headers if it can be done without the user 1732only generate hashcash headers if it can be done without the user
1733waiting (i.e., only asynchronously). 1733waiting (i.e., only asynchronously).
1734 1734
1735You must have the \"hashcash\" binary installed, see `hashcash-path'." 1735You must have the \"hashcash\" binary installed, see `hashcash-path'."
1736 :version "24.1"
1736 :group 'message-headers 1737 :group 'message-headers
1737 :link '(custom-manual "(message)Mail Headers") 1738 :link '(custom-manual "(message)Mail Headers")
1738 :type '(choice (const :tag "Always" t) 1739 :type '(choice (const :tag "Always" t)