shr: make shr-width a defcustom, use it in shr-tag-img
authorJulien Danjou <julien@danjou.info>
Wed, 13 Oct 2010 09:02:10 +0000 (11:02 +0200)
committerJulien Danjou <julien@danjou.info>
Wed, 13 Oct 2010 09:02:10 +0000 (11:02 +0200)
Signed-off-by: Julien Danjou <julien@danjou.info>
lisp/ChangeLog
lisp/shr.el

index 5b7112c..54339a8 100644 (file)
@@ -1,3 +1,9 @@
+2010-10-13  Julien Danjou  <julien@danjou.info>
+
+       * shr.el (shr-width): Make shr-width a defcustom with default to
+       fill-column.
+       (shr-tag-img): Use shr-width rather than fill-column.
+
 2010-10-13  Katsumi Yamaoka  <yamaoka@jpl.org>
 
        * dgnushack.el (byte-optimize-apply)
index 03c0ec8..8a0e814 100644 (file)
@@ -68,14 +68,16 @@ fit these criteria."
   :group 'shr
   :type 'char)
 
+(defcustom shr-width fill-column
+  "Frame width to use for rendering."
+  :type 'integer
+  :group 'shr)
+
 (defvar shr-content-function nil
   "If bound, this should be a function that will return the content.
 This is used for cid: URLs, and the function is called with the
 cid: URL as the argument.")
 
-(defvar shr-width 70
-  "Frame width to use for rendering.")
-
 ;;; Internal variables.
 
 (defvar shr-folding-mode nil)
@@ -404,7 +406,7 @@ Return a string with image data."
     (when width
       ;; Check that width is not larger than max width, otherwise ignore
       ;; align
-      (let ((max-width (* fill-column (frame-char-width)))
+      (let ((max-width (* shr-width (frame-char-width)))
             (width (string-to-number width)))
         (when (< width max-width)
           (let ((align (cdr (assq :align cont))))