[gnus git] branch master updated: n0-13-55-gd715add =1= Fix gravatar insertion in dead article buffers

Julien Danjou <[email protected]>
Newsgroups gmane.emacs.gnus.cvs
Message-ID <[email protected]>
       via  d715adda2809176649227153d9e97564e755efb6 (commit)
      from  b5fa82f9d758d5e39bf7c8908189c44759cb90b4 (commit)


- Log -----------------------------------------------------------------
commit d715adda2809176649227153d9e97564e755efb6
Author: Julien Danjou <[email protected]>
Date:   Fri Feb 25 16:48:27 2011 +0100

    Fix gravatar insertion in dead article buffers
    
    Signed-off-by: Julien Danjou <[email protected]>

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 26db118..1632895 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -42,6 +42,13 @@
 	* gnus-demon.el (gnus-demon-init): run-with-timer should be called with
 	numerical parameters.
 
+2011-02-25  Julien Danjou  <[email protected]>
+
+	* gnus-gravatar.el: Use gnus-with-article-buffer.
+
+	* gnus-art.el (gnus-with-article-buffer): Check that the
+	gnus-article-buffer is alive.
+
 2011-02-24  Teodor Zlatanov  <[email protected]>
 
 	* auth-source.el (auth-source-creation-prompts): New variable to manage
diff --git a/lisp/gnus-art.el b/lisp/gnus-art.el
index 5b3489a..250ebaf 100644
--- a/lisp/gnus-art.el
+++ b/lisp/gnus-art.el
@@ -1725,9 +1725,10 @@ Initialized from `text-mode-syntax-table.")
 (put 'gnus-with-article-headers 'edebug-form-spec '(body))
 
 (defmacro gnus-with-article-buffer (&rest forms)
-  `(with-current-buffer gnus-article-buffer
+  `(when (buffer-live-p gnus-article-buffer)
+     (with-current-buffer gnus-article-buffer
      (let ((inhibit-read-only t))
-       ,@forms)))
+         ,@forms))))
 
 (put 'gnus-with-article-buffer 'lisp-indent-function 0)
 (put 'gnus-with-article-buffer 'edebug-form-spec '(body))
diff --git a/lisp/gnus-gravatar.el b/lisp/gnus-gravatar.el
index 7208889..98b1f3b 100644
--- a/lisp/gnus-gravatar.el
+++ b/lisp/gnus-gravatar.el
@@ -80,9 +80,8 @@ If nil, default to `gravatar-size'."
   "Insert GRAVATAR for ADDRESS in HEADER in current article buffer.
 Set image category to CATEGORY."
   (unless (eq gravatar 'error)
-    (with-current-buffer gnus-article-buffer
+    (gnus-with-article-buffer
       (let ((mark (point-marker))
-	    (inhibit-read-only t)
 	    (inhibit-point-motion-hooks t)
 	    (case-fold-search t))
 	(save-restriction

-----------------------------------------------------------------------
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we listed those
revisions in full, above.

Summary of changes:
 lisp/ChangeLog        |    7 +++++++
 lisp/gnus-art.el      |    7 ++++---
 lisp/gnus-gravatar.el |    3 +--
 3 files changed, 12 insertions(+), 5 deletions(-)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Gnus Project".

The branch, master has been updated


hooks/post-receive
-- 
Gnus Project
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.