* gnus-sum.el (gnus-summary-move-article): pass move-is-internal
authorTeodor Zlatanov <tzz@lifelogs.com>
Thu, 3 Mar 2005 18:00:16 +0000 (18:00 +0000)
committerTeodor Zlatanov <tzz@lifelogs.com>
Thu, 3 Mar 2005 18:00:16 +0000 (18:00 +0000)
parameter to invoked gnus-request-move-article; remove the
redundant gnus-sum-hint-move-is-internal variable; apply the marks
all at once instead of once per article
(gnus-summary-remove-process-mark): accept a list of articles as
well as a single article for processing

* gnus-int.el (gnus-request-move-article): add move-is-internal parameter

* nnml.el (nnml-request-move-article): add move-is-internal parameter

* nnmh.el (nnmh-request-move-article): add move-is-internal parameter

* nnmbox.el (nnmbox-request-move-article): add move-is-internal parameter

* nnmaildir.el (nnmaildir-request-move-article): add move-is-internal parameter

* nnimap.el (nnimap-request-move-article): add move-is-internal
parameter and remove the gnus-sum-hint-move-is-internal variable

* nnfolder.el (nnfolder-request-move-article): add move-is-internal parameter

* nndraft.el (nndraft-request-move-article): add move-is-internal parameter

* nndiary.el (nndiary-request-move-article): add move-is-internal parameter

* nndb.el (nndb-request-move-article): add move-is-internal parameter

* nnbabyl.el (nnbabyl-request-move-article): add move-is-internal parameter

* nnagent.el (nnagent-request-move-article): add move-is-internal parameter

14 files changed:
lisp/ChangeLog
lisp/gnus-int.el
lisp/gnus-sum.el
lisp/nnagent.el
lisp/nnbabyl.el
lisp/nndb.el
lisp/nndiary.el
lisp/nndraft.el
lisp/nnfolder.el
lisp/nnimap.el
lisp/nnmaildir.el
lisp/nnmbox.el
lisp/nnmh.el
lisp/nnml.el

index b4806aa..7c71c7e 100644 (file)
@@ -1,3 +1,37 @@
+2005-03-03  Teodor Zlatanov  <tzz@lifelogs.com>
+
+       * gnus-sum.el (gnus-summary-move-article): pass move-is-internal
+       parameter to invoked gnus-request-move-article; remove the
+       redundant gnus-sum-hint-move-is-internal variable; apply the marks
+       all at once instead of once per article
+       (gnus-summary-remove-process-mark): accept a list of articles as
+       well as a single article for processing
+
+       * gnus-int.el (gnus-request-move-article): add move-is-internal parameter
+
+       * nnml.el (nnml-request-move-article): add move-is-internal parameter
+
+       * nnmh.el (nnmh-request-move-article): add move-is-internal parameter
+
+       * nnmbox.el (nnmbox-request-move-article): add move-is-internal parameter
+
+       * nnmaildir.el (nnmaildir-request-move-article): add move-is-internal parameter
+
+       * nnimap.el (nnimap-request-move-article): add move-is-internal
+       parameter and remove the gnus-sum-hint-move-is-internal variable
+
+       * nnfolder.el (nnfolder-request-move-article): add move-is-internal parameter
+
+       * nndraft.el (nndraft-request-move-article): add move-is-internal parameter
+
+       * nndiary.el (nndiary-request-move-article): add move-is-internal parameter
+
+       * nndb.el (nndb-request-move-article): add move-is-internal parameter
+
+       * nnbabyl.el (nnbabyl-request-move-article): add move-is-internal parameter
+
+       * nnagent.el (nnagent-request-move-article): add move-is-internal parameter
+
 2005-03-01  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * gnus-sum.el (gnus-summary-exit): Undo last change and fix it in
index 420b1ac..8d47064 100644 (file)
@@ -562,12 +562,12 @@ If GROUP is nil, all groups on GNUS-COMMAND-METHOD are scanned."
     not-deleted))
 
 (defun gnus-request-move-article (article group server accept-function
-                                         &optional last)
+                                         &optional last move-is-internal)
   (let* ((gnus-command-method (gnus-find-method-for-group group))
         (result (funcall (gnus-get-function gnus-command-method
                                             'request-move-article)
                          article (gnus-group-real-name group)
-                         (nth 1 gnus-command-method) accept-function last)))
+                         (nth 1 gnus-command-method) accept-function last move-is-internal)))
     (when (and result gnus-agent
               (gnus-agent-method-p gnus-command-method))
       (gnus-agent-unfetch-articles group (list article)))
index 42613bb..6480c51 100644 (file)
@@ -9067,7 +9067,7 @@ ACTION can be either `move' (the default), `crosspost' or `copy'."
                 (crosspost "Crosspost" "Crossposting")))
        (copy-buf (save-excursion
                    (nnheader-set-temp-buffer " *copy article*")))
-       art-group to-method new-xref article to-groups)
+       art-group to-method new-xref article to-groups articles-to-update-marks)
     (unless (assq action names)
       (error "Unknown action %s" action))
     ;; Read the newsgroup name.
@@ -9116,7 +9116,7 @@ ACTION can be either `move' (the default), `crosspost' or `copy'."
                              gnus-newsgroup-name))
                (to-method (gnus-find-method-for-group
                            to-newsgroup))
-               (gnus-sum-hint-move-is-internal (gnus-method-equal from-method to-method)))
+               (move-is-internal (gnus-method-equal from-method to-method)))
         (gnus-request-move-article
          article                       ; Article to move
          gnus-newsgroup-name           ; From newsgroup
@@ -9125,7 +9125,8 @@ ACTION can be either `move' (the default), `crosspost' or `copy'."
          (list 'gnus-request-accept-article
                to-newsgroup (list 'quote select-method)
                (not articles) t)       ; Accept form
-         (not articles))))             ; Only save nov last time
+         (not articles)                ; Only save nov last time
+         move-is-internal)))           ; is this move internal?
        ;; Copy the article.
        ((eq action 'copy)
         (save-excursion
@@ -9275,17 +9276,19 @@ ACTION can be either `move' (the default), `crosspost' or `copy'."
 
        ;;;!!!Why is this necessary?
        (set-buffer gnus-summary-buffer)
-
+       
        (gnus-summary-goto-subject article)
        (when (eq action 'move)
          (gnus-summary-mark-article article gnus-canceled-mark))))
-      (gnus-summary-remove-process-mark article))
+      (push article articles-to-update-marks))
+
+    (apply 'gnus-summary-remove-process-mark articles-to-update-marks)
     ;; Re-activate all groups that have been moved to.
     (save-excursion
       (set-buffer gnus-group-buffer)
       (let ((gnus-group-marked to-groups))
        (gnus-group-get-new-news-this-group nil t)))
-
+    
     (gnus-kill-buffer copy-buf)
     (gnus-summary-position-point)
     (gnus-set-mode-line 'summary)))
@@ -9975,13 +9978,14 @@ the actual number of articles marked is returned."
     (gnus-summary-goto-subject article)
     (gnus-summary-update-secondary-mark article)))
 
-(defun gnus-summary-remove-process-mark (article)
-  "Remove the process mark from ARTICLE and update the summary line."
-  (setq gnus-newsgroup-processable (delq article gnus-newsgroup-processable))
-  (when (gnus-summary-goto-subject article)
-    (gnus-summary-show-thread)
-    (gnus-summary-goto-subject article)
-    (gnus-summary-update-secondary-mark article)))
+(defun gnus-summary-remove-process-mark (&rest articles)
+  "Remove the process mark from ARTICLES and update the summary line."
+  (dolist (article articles)
+    (setq gnus-newsgroup-processable (delq article gnus-newsgroup-processable))
+    (when (gnus-summary-goto-subject article)
+      (gnus-summary-show-thread)
+      (gnus-summary-goto-subject article)
+      (gnus-summary-update-secondary-mark article))))
 
 (defun gnus-summary-set-saved-mark (article)
   "Set the process mark on ARTICLE and update the summary line."
index a17e92c..5d5cd2a 100644 (file)
                        (list (nnagent-server server))))
 
 (deffoo nnagent-request-move-article
-    (article group server accept-form &optional last)
+    (article group server accept-form &optional last move-is-internal)
   (nnoo-parent-function 'nnagent 'nnml-request-move-article
                        (list article group (nnagent-server server)
-                             accept-form last)))
+                             accept-form last move-is-internal)))
 
 (deffoo nnagent-request-rename-group (group new-name &optional server)
   (nnoo-parent-function 'nnagent 'nnml-request-rename-group
index 1281ad9..076f451 100644 (file)
       (nconc rest articles))))
 
 (deffoo nnbabyl-request-move-article
-    (article group server accept-form &optional last)
+    (article group server accept-form &optional last move-is-internal)
   (let ((buf (get-buffer-create " *nnbabyl move*"))
        result)
     (and
index bd8523f..082f169 100644 (file)
@@ -246,7 +246,7 @@ expiry mechanism."
     (nndb-request-expire-articles-local articles group server force)))
 
 (deffoo nndb-request-move-article
-    (article group server accept-form &optional last)
+    (article group server accept-form &optional last move-is-internal)
   "Move ARTICLE (a number) from GROUP on SERVER.
 Evals ACCEPT-FORM in current buffer, where the article is.
 Optional LAST is ignored."
index 3a35379..2aeb55f 100644 (file)
@@ -724,7 +724,7 @@ all.  This may very well take some time.")
     (nconc rest articles)))
 
 (deffoo nndiary-request-move-article
-    (article group server accept-form &optional last)
+    (article group server accept-form &optional last move-is-internal)
   (let ((buf (get-buffer-create " *nndiary move*"))
        result)
     (nndiary-possibly-change-directory group server)
index 9235bf7..95ff037 100644 (file)
                        'nnmh-request-group
                        (list group server dont-check)))
 
-(deffoo nndraft-request-move-article (article group server
-                                             accept-form &optional last)
+(deffoo nndraft-request-move-article (article group server accept-form 
+                                     &optional last move-is-internal)
   (nndraft-possibly-change-group group)
   (let ((buf (get-buffer-create " *nndraft move*"))
        result)
index 054e074..9b25ea1 100644 (file)
@@ -467,8 +467,8 @@ the group.  Then the marks file will be regenerated properly by Gnus.")
       (nnfolder-save-active nnfolder-group-alist nnfolder-active-file)
       (gnus-sorted-difference articles (nreverse deleted-articles)))))
 
-(deffoo nnfolder-request-move-article (article group server
-                                              accept-form &optional last)
+(deffoo nnfolder-request-move-article (article group server accept-form 
+                                              &optional last move-is-internal)
   (save-excursion
     (let ((buf (get-buffer-create " *nnfolder move*"))
          result)
index 5ffa541..b6c93f2 100644 (file)
@@ -1504,8 +1504,8 @@ function is generally only called when Gnus is shutting down."
   ;; return articles not deleted
   articles)
 
-(deffoo nnimap-request-move-article (article group server
-                                            accept-form &optional last)
+(deffoo nnimap-request-move-article (article group server accept-form 
+                                            &optional last move-is-internal)
   (when (nnimap-possibly-change-server server)
     (save-excursion
       (let ((buf (get-buffer-create " *nnimap move*"))
@@ -1513,12 +1513,12 @@ function is generally only called when Gnus is shutting down."
            (nnimap-current-move-group group)
            (nnimap-current-move-server nnimap-current-server)
            result)
-       (gnus-message 9 "nnimap-request-move-article: this is an %s move"
-                     (if gnus-sum-hint-move-is-internal
+       (gnus-message 10 "nnimap-request-move-article: this is an %s move"
+                     (if move-is-internal
                          "internal"
                        "external"))
        ;; request the article only when the move is NOT internal
-       (and (or gnus-sum-hint-move-is-internal
+       (and (or move-is-internal
                 (nnimap-request-article article group server))
             (save-excursion
               (set-buffer buf)
index c1abf28..7b3fffd 100644 (file)
@@ -1305,7 +1305,7 @@ by nnmaildir-request-article.")
       t)))
 
 (defun nnmaildir-request-move-article (article gname server accept-form
-                                              &optional last)
+                                              &optional last move-is-internal)
   (let ((group (nnmaildir--prepare server gname))
        pgname suffix result nnmaildir--file deactivate-mark)
     (catch 'return
index a1957fa..93172b7 100644 (file)
       (nconc rest articles))))
 
 (deffoo nnmbox-request-move-article
-    (article group server accept-form &optional last)
+    (article group server accept-form &optional last move-is-internal)
   (let ((buf (get-buffer-create " *nnmbox move*"))
        result)
     (and
index 22d89df..7bc5221 100644 (file)
@@ -288,8 +288,8 @@ as unread by Gnus.")
 (deffoo nnmh-close-group (group &optional server)
   t)
 
-(deffoo nnmh-request-move-article (article group server
-                                          accept-form &optional last)
+(deffoo nnmh-request-move-article (article group server accept-form 
+                                          &optional last move-is-internal)
   (let ((buf (get-buffer-create " *nnmh move*"))
        result)
     (and
index bb7d51d..b99f47b 100644 (file)
@@ -335,7 +335,7 @@ marks file will be regenerated properly by Gnus.")
     (nconc rest articles)))
 
 (deffoo nnml-request-move-article
-    (article group server accept-form &optional last)
+    (article group server accept-form &optional last move-is-internal)
   (let ((buf (get-buffer-create " *nnml move*"))
        result)
     (nnml-possibly-change-directory group server)