aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Ingebrigtsen2011-01-24 04:10:19 +0000
committerKatsumi Yamaoka2011-01-24 04:10:19 +0000
commitcb51ba085d2250e2487fbdc30edcb1f049d040d7 (patch)
tree4190b92176f75313f1b62ddfe1e3bcdc2747d2b6
parentb711096ad269e09e750449db68ded5e6729c17c1 (diff)
downloademacs-cb51ba085d2250e2487fbdc30edcb1f049d040d7.tar.gz
emacs-cb51ba085d2250e2487fbdc30edcb1f049d040d7.zip
gnus-html.el (gnus-html-image-fetched): Don't kill the temporary buffer after being called. It's apparently being killed by url.el, and killing it made point move to end-of-buffer in a random buffer.
shr.el (shr-image-fetched): Ditto. shr.el (shr-image-fetched): Avoid having point move in the article buffer. gnus-html.el (gnus-html-image-fetched): Kill the buffer anyway, and fix the bug in url-http.el instead. shr.el (shr-image-fetched): Ditto. gravatar.el (gravatar-retrieve): Be silent when retrieving. gnus-gravatar.el (gnus-gravatar-insert): Don't move point around in the article buffer. (gnus-gravatar-insert): Use blank space from the current buffer to avoid breaking text properties. This makes X-Sent updating work again. gnus-art.el (gnus-article-read-summary-keys): Don't call disabled commands.
-rw-r--r--lisp/gnus/ChangeLog28
-rw-r--r--lisp/gnus/gnus-art.el9
-rw-r--r--lisp/gnus/gnus-gravatar.el69
-rw-r--r--lisp/gnus/gravatar.el12
-rw-r--r--lisp/gnus/shr.el11
5 files changed, 88 insertions, 41 deletions
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index 8bd8732ade4..9780b6f4c07 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,31 @@
12011-01-24 Lars Ingebrigtsen <larsi@gnus.org>
2
3 * gnus-art.el (gnus-article-read-summary-keys): Don't call disabled
4 commands.
5
6 * gnus-gravatar.el (gnus-gravatar-insert): Don't move point around
7 in the article buffer.
8 (gnus-gravatar-insert): Use blank space from the current buffer to
9 avoid breaking text properties. This makes X-Sent updating work again.
10
11 * gravatar.el (gravatar-retrieve): Be silent when retrieving.
12
132011-01-23 Lars Ingebrigtsen <larsi@gnus.org>
14
15 * gnus-html.el (gnus-html-image-fetched): Kill the buffer anyway, and
16 fix the bug in url-http.el instead.
17
18 * shr.el (shr-image-fetched): Ditto.
19
20 * shr.el (shr-image-fetched): Avoid having point move in the article
21 buffer.
22
23 * gnus-html.el (gnus-html-image-fetched): Don't kill the temporary
24 buffer after being called. It's apparently being killed by url.el, and
25 killing it made point move to end-of-buffer in a random buffer.
26
27 * shr.el (shr-image-fetched): Ditto.
28
12011-01-23 Julien Danjou <julien@danjou.info> 292011-01-23 Julien Danjou <julien@danjou.info>
2 30
3 * mm-decode.el (mm-inline-media-tests): Change text/org to text/x-org. 31 * mm-decode.el (mm-inline-media-tests): Change text/org to text/x-org.
diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el
index 430590d9abb..06817e941a0 100644
--- a/lisp/gnus/gnus-art.el
+++ b/lisp/gnus/gnus-art.el
@@ -6432,6 +6432,8 @@ not have a face in `gnus-article-boring-faces'."
6432 (ding) 6432 (ding)
6433 (unless (member keys nosave-in-article) 6433 (unless (member keys nosave-in-article)
6434 (set-buffer gnus-article-current-summary)) 6434 (set-buffer gnus-article-current-summary))
6435 (when (get func 'disabled)
6436 (error "Function %s disabled" func))
6435 (call-interactively func) 6437 (call-interactively func)
6436 (setq new-sum-point (point))) 6438 (setq new-sum-point (point)))
6437 (when (member keys nosave-but-article) 6439 (when (member keys nosave-but-article)
@@ -6460,8 +6462,11 @@ not have a face in `gnus-article-boring-faces'."
6460 (select-window win)))) 6462 (select-window win))))
6461 (setq in-buffer (current-buffer)) 6463 (setq in-buffer (current-buffer))
6462 ;; We disable the pick minor mode commands. 6464 ;; We disable the pick minor mode commands.
6463 (if (and (setq func (let (gnus-pick-mode) 6465 (setq func (let (gnus-pick-mode)
6464 (key-binding keys t))) 6466 (key-binding keys t)))
6467 (when (get func 'disabled)
6468 (error "Function %s disabled" func))
6469 (if (and func
6465 (functionp func) 6470 (functionp func)
6466 (condition-case code 6471 (condition-case code
6467 (progn 6472 (progn
diff --git a/lisp/gnus/gnus-gravatar.el b/lisp/gnus/gnus-gravatar.el
index 53d1310a094..ae17d5b5abd 100644
--- a/lisp/gnus/gnus-gravatar.el
+++ b/lisp/gnus/gnus-gravatar.el
@@ -80,37 +80,44 @@ If nil, default to `gravatar-size'."
80 "Insert GRAVATAR for ADDRESS in HEADER in current article buffer. 80 "Insert GRAVATAR for ADDRESS in HEADER in current article buffer.
81Set image category to CATEGORY." 81Set image category to CATEGORY."
82 (unless (eq gravatar 'error) 82 (unless (eq gravatar 'error)
83 (gnus-with-article-headers 83 (with-current-buffer gnus-article-buffer
84 ;; The buffer can be gone at this time 84 (let ((mark (point-marker))
85 (when (buffer-live-p (current-buffer)) 85 (inhibit-read-only t)
86 (gnus-article-goto-header header) 86 (inhibit-point-motion-hooks t)
87 (mail-header-narrow-to-field) 87 (case-fold-search t))
88 (let ((real-name (car address)) 88 (save-restriction
89 (mail-address (cadr address))) 89 (article-narrow-to-head)
90 (when (if real-name 90 ;; The buffer can be gone at this time
91 (re-search-forward 91 (when (buffer-live-p (current-buffer))
92 (concat (gnus-replace-in-string 92 (gnus-article-goto-header header)
93 (regexp-quote real-name) "[\t ]+" "[\t\n ]+") 93 (mail-header-narrow-to-field)
94 "\\|" 94 (let ((real-name (car address))
95 (regexp-quote mail-address)) 95 (mail-address (cadr address)))
96 nil t) 96 (when (if real-name
97 (search-forward mail-address nil t)) 97 (re-search-forward
98 (goto-char (1- (match-beginning 0))) 98 (concat (gnus-replace-in-string
99 ;; If we're on the " quoting the name, go backward 99 (regexp-quote real-name) "[\t ]+" "[\t\n ]+")
100 (when (looking-at "[\"<]") 100 "\\|"
101 (goto-char (1- (point)))) 101 (regexp-quote mail-address))
102 ;; Do not do anything if there's already a gravatar. This can 102 nil t)
103 ;; happens if the buffer has been regenerated in the mean time, for 103 (search-forward mail-address nil t))
104 ;; example we were fetching someaddress, and then we change to 104 (goto-char (1- (match-beginning 0)))
105 ;; another mail with the same someaddress. 105 ;; If we're on the " quoting the name, go backward
106 (unless (memq 'gnus-gravatar (text-properties-at (point))) 106 (when (looking-at "[\"<]")
107 (let ((point (point))) 107 (goto-char (1- (point))))
108 (unless (featurep 'xemacs) 108 ;; Do not do anything if there's already a gravatar. This can
109 (setq gravatar (append gravatar gnus-gravatar-properties))) 109 ;; happens if the buffer has been regenerated in the mean time, for
110 (gnus-put-image gravatar nil category) 110 ;; example we were fetching someaddress, and then we change to
111 (put-text-property point (point) 'gnus-gravatar address) 111 ;; another mail with the same someaddress.
112 (gnus-add-wash-type category) 112 (unless (memq 'gnus-gravatar (text-properties-at (point)))
113 (gnus-add-image category gravatar))))))))) 113 (let ((point (point)))
114 (unless (featurep 'xemacs)
115 (setq gravatar (append gravatar gnus-gravatar-properties)))
116 (gnus-put-image gravatar (buffer-substring (point) (1+ point)) category)
117 (put-text-property point (point) 'gnus-gravatar address)
118 (gnus-add-wash-type category)
119 (gnus-add-image category gravatar)))))))
120 (goto-char (marker-position mark))))))
114 121
115;;;###autoload 122;;;###autoload
116(defun gnus-treat-from-gravatar (&optional force) 123(defun gnus-treat-from-gravatar (&optional force)
diff --git a/lisp/gnus/gravatar.el b/lisp/gnus/gravatar.el
index 158347fb004..cb857fca89b 100644
--- a/lisp/gnus/gravatar.el
+++ b/lisp/gnus/gravatar.el
@@ -108,9 +108,15 @@ If no image available, return 'error."
108You can provide a list of argument to pass to CB in CBARGS." 108You can provide a list of argument to pass to CB in CBARGS."
109 (let ((url (gravatar-build-url mail-address))) 109 (let ((url (gravatar-build-url mail-address)))
110 (if (gravatar-cache-expired url) 110 (if (gravatar-cache-expired url)
111 (url-retrieve url 111 (let ((args (list url
112 'gravatar-retrieved 112 'gravatar-retrieved
113 (list cb (when cbargs cbargs))) 113 (list cb (when cbargs cbargs)))))
114 (when (> (length (if (featurep 'xemacs)
115 (cdr (split-string (function-arglist 'url-retrieve)))
116 (help-function-arglist 'url-retrieve)))
117 4)
118 (setq args (nconc args (list t))))
119 (apply #'url-retrieve args))
114 (apply cb 120 (apply cb
115 (with-temp-buffer 121 (with-temp-buffer
116 (mm-disable-multibyte) 122 (mm-disable-multibyte)
diff --git a/lisp/gnus/shr.el b/lisp/gnus/shr.el
index 6e681d67365..75929b29e05 100644
--- a/lisp/gnus/shr.el
+++ b/lisp/gnus/shr.el
@@ -462,11 +462,12 @@ redirects somewhere else."
462 (search-forward "\r\n\r\n" nil t)) 462 (search-forward "\r\n\r\n" nil t))
463 (let ((data (buffer-substring (point) (point-max)))) 463 (let ((data (buffer-substring (point) (point-max))))
464 (with-current-buffer buffer 464 (with-current-buffer buffer
465 (let ((alt (buffer-substring start end)) 465 (save-excursion
466 (inhibit-read-only t)) 466 (let ((alt (buffer-substring start end))
467 (delete-region start end) 467 (inhibit-read-only t))
468 (goto-char start) 468 (delete-region start end)
469 (shr-put-image data alt)))))) 469 (goto-char start)
470 (shr-put-image data alt)))))))
470 (kill-buffer (current-buffer))) 471 (kill-buffer (current-buffer)))
471 472
472(defun shr-put-image (data alt) 473(defun shr-put-image (data alt)