Remove <a name...> tags, which confuses the rest of the function.
[gnus] / lisp / gnus-async.el
index 329a7ac..1e9c1df 100644 (file)
@@ -1,27 +1,25 @@
 ;;; gnus-async.el --- asynchronous support for Gnus
 
 ;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-;;   2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+;;   2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;; Keywords: news
 
 ;; This file is part of GNU Emacs.
 
-;; GNU Emacs is free software; you can redistribute it and/or modify
+;; GNU Emacs is free software: you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 3, or (at your option)
-;; any later version.
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
 
 ;; GNU Emacs is distributed in the hope that it will be useful,
 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.         See the
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 ;; GNU General Public License for more details.
 
 ;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
+;; along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
 
 ;;; Commentary:
 
@@ -73,6 +71,13 @@ It should return non-nil if the article is to be prefetched."
   :group 'gnus-asynchronous
   :type 'function)
 
+(defcustom gnus-async-post-fetch-function nil
+  "Function called after an article has been prefetched.
+The function will be called narrowed to the region of the article
+that was fetched."
+  :group 'gnus-asynchronous
+  :type 'function)
+
 ;;; Internal variables.
 
 (defvar gnus-async-prefetch-article-buffer " *Async Prefetch Article*")
@@ -229,6 +234,11 @@ It should return non-nil if the article is to be prefetched."
     (setq gnus-async-current-prefetch-article nil)
     (when arg
       (gnus-async-set-buffer)
+      (when gnus-async-post-fetch-function
+       (save-excursion
+         (save-restriction
+           (narrow-to-region mark (point-max))
+           (funcall gnus-async-post-fetch-function summary))))
       (gnus-async-with-semaphore
        (setq
         gnus-async-article-alist
@@ -374,5 +384,4 @@ It should return non-nil if the article is to be prefetched."
 
 (provide 'gnus-async)
 
-;;; arch-tag: fee61de5-3ea2-4de6-8578-2f90ce89391d
 ;;; gnus-async.el ends here