aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulien Danjou2010-10-13 11:55:48 +0000
committerKatsumi Yamaoka2010-10-13 11:55:48 +0000
commitd0e0de31a6628cd38c69f555aebab0a49ff64418 (patch)
treedc3f958558dcd63da687334aac870af0568702c7
parent68d9bf4b702c6cb2616b1061b34e2d50d4ffe9a3 (diff)
downloademacs-d0e0de31a6628cd38c69f555aebab0a49ff64418.tar.gz
emacs-d0e0de31a6628cd38c69f555aebab0a49ff64418.zip
shr: make shr-width a defcustom, use it in shr-tag-img.
-rw-r--r--lisp/gnus/ChangeLog6
-rw-r--r--lisp/gnus/shr.el10
2 files changed, 12 insertions, 4 deletions
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index c90dc7c77c2..a568a530927 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,9 @@
12010-10-13 Julien Danjou <julien@danjou.info>
2
3 * shr.el (shr-width): Make shr-width a defcustom with default to
4 fill-column.
5 (shr-tag-img): Use shr-width rather than fill-column.
6
12010-10-13 Katsumi Yamaoka <yamaoka@jpl.org> 72010-10-13 Katsumi Yamaoka <yamaoka@jpl.org>
2 8
3 * gnus-dired.el (gnus-dired-attach): Silence XEmacs 21.5 when compiling. 9 * gnus-dired.el (gnus-dired-attach): Silence XEmacs 21.5 when compiling.
diff --git a/lisp/gnus/shr.el b/lisp/gnus/shr.el
index 03c0ec84d5d..8a0e814bca3 100644
--- a/lisp/gnus/shr.el
+++ b/lisp/gnus/shr.el
@@ -68,14 +68,16 @@ fit these criteria."
68 :group 'shr 68 :group 'shr
69 :type 'char) 69 :type 'char)
70 70
71(defcustom shr-width fill-column
72 "Frame width to use for rendering."
73 :type 'integer
74 :group 'shr)
75
71(defvar shr-content-function nil 76(defvar shr-content-function nil
72 "If bound, this should be a function that will return the content. 77 "If bound, this should be a function that will return the content.
73This is used for cid: URLs, and the function is called with the 78This is used for cid: URLs, and the function is called with the
74cid: URL as the argument.") 79cid: URL as the argument.")
75 80
76(defvar shr-width 70
77 "Frame width to use for rendering.")
78
79;;; Internal variables. 81;;; Internal variables.
80 82
81(defvar shr-folding-mode nil) 83(defvar shr-folding-mode nil)
@@ -404,7 +406,7 @@ Return a string with image data."
404 (when width 406 (when width
405 ;; Check that width is not larger than max width, otherwise ignore 407 ;; Check that width is not larger than max width, otherwise ignore
406 ;; align 408 ;; align
407 (let ((max-width (* fill-column (frame-char-width))) 409 (let ((max-width (* shr-width (frame-char-width)))
408 (width (string-to-number width))) 410 (width (string-to-number width)))
409 (when (< width max-width) 411 (when (< width max-width)
410 (let ((align (cdr (assq :align cont)))) 412 (let ((align (cdr (assq :align cont))))