(gnus-namazu-kill-summary-buffers): New advice.
authortsuchiya <tsuchiya>
Thu, 14 Feb 2002 04:03:35 +0000 (04:03 +0000)
committertsuchiya <tsuchiya>
Thu, 14 Feb 2002 04:03:35 +0000 (04:03 +0000)
ChangeLog
lisp/gnus-namazu.el

index 2b1b428..96adaf1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2002-02-14  TSUCHIYA Masatoshi  <tsuchiya@namazu.org>
+
+       * lisp/gnus-namazu.el (gnus-namazu-kill-summary-buffers): New
+       advice.
+
 2002-02-12  Katsumi Yamaoka  <yamaoka@jpl.org>
 
        * lisp/mm-view.el: Require `gnus-mailcap' rather than `mailcap'.
index 01ad845..458729d 100644 (file)
@@ -598,6 +598,23 @@ and make a virtual group contains its results."
                 '<)))
       (message "No entry."))))
 
+(let (current-load-list)
+  (defadvice gnus-offer-save-summaries
+    (before gnus-namazu-kill-summary-buffers activate compile)
+    "Advised by `gnus-namazu'.
+In order to avoid annoying questions, kill summary buffers which
+generated by `gnus-namazu' itself before `gnus-offer-save-summaries'
+is called."
+    (let ((buffers (buffer-list)))
+      (while buffers
+       (when (with-current-buffer (car buffers)
+               (and (eq major-mode 'gnus-summary-mode)
+                    (gnus-ephemeral-group-p gnus-newsgroup-name)
+                    (string-match gnus-namazu/group-name-regexp
+                                  gnus-newsgroup-name)))
+         (kill-buffer (car buffers)))
+       (setq buffers (cdr buffers))))))
+
 (defun gnus-namazu-insinuate ()
   (add-hook
    'gnus-group-mode-hook