projects
/
gnus
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Update copyright year to 2016
[gnus]
/
lisp
/
gnus-html.el
diff --git
a/lisp/gnus-html.el
b/lisp/gnus-html.el
index
bdf03a1
..
884b40e
100644
(file)
--- a/
lisp/gnus-html.el
+++ b/
lisp/gnus-html.el
@@
-1,6
+1,6
@@
;;; gnus-html.el --- Render HTML in a buffer.
;;; gnus-html.el --- Render HTML in a buffer.
-;; Copyright (C) 2010-201
3
Free Software Foundation, Inc.
+;; Copyright (C) 2010-201
6
Free Software Foundation, Inc.
;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
;; Keywords: html, web
;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
;; Keywords: html, web
@@
-45,7
+45,10
@@
"Time used to determine if we should use images from the cache."
:version "24.1"
:group 'gnus-art
"Time used to determine if we should use images from the cache."
:version "24.1"
:group 'gnus-art
- :type 'integer)
+ ;; FIXME hardly the friendliest type. The allowed value is actually
+ ;; any time value, but we are assuming no-one cares about USEC and
+ ;; PSEC here. It would be better to eg make it a number of minutes.
+ :type '(list integer integer))
(defcustom gnus-html-image-automatic-caching t
"Whether automatically cache retrieve images."
(defcustom gnus-html-image-automatic-caching t
"Whether automatically cache retrieve images."
@@
-136,7
+139,8
@@
CHARS is a regexp-like character alternative (e.g., \"[)$]\")."
(charset (mail-content-type-get (mm-handle-type handle)
'charset)))
(when (and charset
(charset (mail-content-type-get (mm-handle-type handle)
'charset)))
(when (and charset
- (setq charset (mm-charset-to-coding-system charset))
+ (setq charset (mm-charset-to-coding-system
+ charset nil t))
(not (eq charset 'ascii)))
(insert (prog1
(mm-decode-coding-string (buffer-string) charset)
(not (eq charset 'ascii)))
(insert (prog1
(mm-decode-coding-string (buffer-string) charset)
@@
-303,12
+307,12
@@
Use ALT-TEXT for the image string."
(gnus-article-add-button start end
'browse-url (mm-url-decode-entities-string url)
url)
(gnus-article-add-button start end
'browse-url (mm-url-decode-entities-string url)
url)
- (let ((overlay (
gnus-
make-overlay start end)))
- (
gnus-
overlay-put overlay 'evaporate t)
- (
gnus-
overlay-put overlay 'gnus-button-url url)
+ (let ((overlay (make-overlay start end)))
+ (overlay-put overlay 'evaporate t)
+ (overlay-put overlay 'gnus-button-url url)
(gnus-put-text-property start end 'gnus-string url)
(when gnus-article-mouse-face
(gnus-put-text-property start end 'gnus-string url)
(when gnus-article-mouse-face
- (
gnus-
overlay-put overlay 'mouse-face gnus-article-mouse-face)))))
+ (overlay-put overlay 'mouse-face gnus-article-mouse-face)))))
;; The upper-case IMG_ALT is apparently just an artifact that
;; should be deleted.
((equal tag "IMG_ALT")
;; The upper-case IMG_ALT is apparently just an artifact that
;; should be deleted.
((equal tag "IMG_ALT")
@@
-316,19
+320,19
@@
Use ALT-TEXT for the image string."
;; w3m does not normalize the case
((or (equal tag "b")
(equal tag "B"))
;; w3m does not normalize the case
((or (equal tag "b")
(equal tag "B"))
- (
gnus-overlay-put (gnus-
make-overlay start end) 'face 'gnus-emphasis-bold))
+ (
overlay-put (
make-overlay start end) 'face 'gnus-emphasis-bold))
((or (equal tag "u")
(equal tag "U"))
((or (equal tag "u")
(equal tag "U"))
- (
gnus-overlay-put (gnus-
make-overlay start end) 'face 'gnus-emphasis-underline))
+ (
overlay-put (
make-overlay start end) 'face 'gnus-emphasis-underline))
((or (equal tag "i")
(equal tag "I"))
((or (equal tag "i")
(equal tag "I"))
- (
gnus-overlay-put (gnus-
make-overlay start end) 'face 'gnus-emphasis-italic))
+ (
overlay-put (
make-overlay start end) 'face 'gnus-emphasis-italic))
((or (equal tag "s")
(equal tag "S"))
((or (equal tag "s")
(equal tag "S"))
- (
gnus-overlay-put (gnus-
make-overlay start end) 'face 'gnus-emphasis-strikethru))
+ (
overlay-put (
make-overlay start end) 'face 'gnus-emphasis-strikethru))
((or (equal tag "ins")
(equal tag "INS"))
((or (equal tag "ins")
(equal tag "INS"))
- (
gnus-overlay-put (gnus-
make-overlay start end) 'face 'gnus-emphasis-underline))
+ (
overlay-put (
make-overlay start end) 'face 'gnus-emphasis-underline))
;; Handle different UL types
((equal tag "_SYMBOL")
(when (string-match "TYPE=\\(.+\\)" parameters)
;; Handle different UL types
((equal tag "_SYMBOL")
(when (string-match "TYPE=\\(.+\\)" parameters)
@@
-435,6
+439,9
@@
Return a string with image data."
(truncate (* gnus-max-image-proportion
(- (nth 3 edges) (nth 1 edges)))))))
(truncate (* gnus-max-image-proportion
(- (nth 3 edges) (nth 1 edges)))))))
+;; Behind display-graphic-p test.
+(declare-function image-size "image.c" (spec &optional pixels frame))
+
(defun gnus-html-put-image (data url &optional alt-text)
"Put an image with DATA from URL and optional ALT-TEXT."
(when (gnus-graphic-display-p)
(defun gnus-html-put-image (data url &optional alt-text)
"Put an image with DATA from URL and optional ALT-TEXT."
(when (gnus-graphic-display-p)