gnus-sum.el (gnus-summary-toggle-header): Display header attachment buttons
[gnus] / lisp / nndraft.el
index 459778b..764314d 100644 (file)
@@ -1,6 +1,6 @@
 ;;; nndraft.el --- draft article access for Gnus
 
-;; Copyright (C) 1995-2011 Free Software Foundation, Inc.
+;; Copyright (C) 1995-2014 Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;; Keywords: news
 (require 'nnheader)
 (require 'nnmail)
 (require 'gnus-start)
+(require 'gnus-group)
 (require 'nnmh)
 (require 'nnoo)
 (require 'mm-util)
 (eval-when-compile (require 'cl))
 
+;; The nnoo-import at the end, I think.
+(declare-function nndraft-request-list "nndraft" (&rest args) t)
+
 (nnoo-declare nndraft
   nnmh)
 
@@ -170,15 +174,18 @@ are generated if and only if they are also in `message-draft-headers'.")
                                                       (list 'nndraft "")))
                           (nnmail-get-active)))
           (gnus-group-marked (copy-sequence groups))
+          ;; Don't send delayed articles.
+          (gnus-get-new-news-hook nil)
           (inhibit-read-only t))
       (gnus-group-get-new-news-this-group nil t)
-      (dolist (group groups)
-       (unless (and gnus-permanently-visible-groups
-                    (string-match gnus-permanently-visible-groups
-                                  group))
-         (gnus-group-goto-group group)
-         (when (zerop (gnus-group-group-unread))
-           (gnus-delete-line)))))))
+      (save-excursion
+       (dolist (group groups)
+         (unless (and gnus-permanently-visible-groups
+                      (string-match gnus-permanently-visible-groups
+                                    group))
+           (gnus-group-goto-group group)
+           (when (zerop (gnus-group-group-unread))
+             (gnus-delete-line))))))))
 
 (deffoo nndraft-request-associate-buffer (group)
   "Associate the current buffer with some article in the draft group."
@@ -244,11 +251,16 @@ are generated if and only if they are also in `message-draft-headers'.")
 (deffoo nndraft-request-expire-articles (articles group &optional server force)
   (nndraft-possibly-change-group group)
   (let* ((nnmh-allow-delete-final t)
-        (nnmail-expiry-target
-         (or (gnus-group-find-parameter
-              (gnus-group-prefixed-name group (list 'nndraft server))
-              'expiry-target t)
-             nnmail-expiry-target))
+        (nnmail-expiry-target 'delete)
+        ;; FIXME: If we want to move a draft message to an expiry group,
+        ;; there are things to have to improve:
+        ;; - Remove a header separator.
+        ;; - Encode it, including attachments, into a MIME message.
+        ;;(nnmail-expiry-target
+        ;; (or (gnus-group-find-parameter
+        ;;      (gnus-group-prefixed-name group (list 'nndraft server))
+        ;;      'expiry-target t)
+        ;;     nnmail-expiry-target))
         (res (nnoo-parent-function 'nndraft
                                    'nnmh-request-expire-articles
                                    (list articles group server force)))
@@ -335,8 +347,7 @@ are generated if and only if they are also in `message-draft-headers'.")
    nnmh-retrieve-headers
    nnmh-request-group
    nnmh-close-group
-   nnmh-request-list
-   nnmh-request-newsgroups))
+   nnmh-request-list))
 
 (provide 'nndraft)