]> git.eshelyaron.com Git - emacs.git/commitdiff
Add new command `gnus-summary-attach-article'
authorLars Ingebrigtsen <larsi@gnus.org>
Sun, 15 Apr 2018 16:02:50 +0000 (18:02 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Sun, 15 Apr 2018 16:02:50 +0000 (18:02 +0200)
* doc/misc/gnus.texi (Summary Message Commands): Document it.

* lisp/gnus/gnus-msg.el (gnus-summary-attach-article): New command
and keystroke (bug#19788).

* lisp/gnus/gnus-sum.el (gnus-summary-make-menu-bar): Menu bar
entry for it.

doc/misc/gnus.texi
etc/NEWS
lisp/gnus/gnus-msg.el
lisp/gnus/gnus-sum.el

index efda7f20b5767e61ccd3e516bdb4cdbcccc8b1e1..77c02182b4b1e72f269f2784c1c3d718734920b8 100644 (file)
@@ -5850,6 +5850,15 @@ buffer (@code{gnus-summary-yank-message}).  This command prompts for
 what message buffer you want to yank into, and understands the
 process/prefix convention (@pxref{Process/Prefix}).
 
+@item S A
+@kindex S A @r{(Summary)}
+@findex gnus-summary-attach-article
+Attach the current article into an already existing Message
+composition buffer (@code{gnus-summary-yank-message}).  If no such
+buffer exists, a new one is created.  This command prompts for what
+message buffer you want to yank into, and understands the
+process/prefix convention (@pxref{Process/Prefix}).
+
 @end table
 
 
index 0c4daee9acf308ba7b704c12e1560b9f3b906f72..13033797265dae4b3b03496a79e459be085a0743 100644 (file)
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -210,6 +210,12 @@ concept index in the Gnus manual for the `match-list' entry.
 +++
 *** nil is no longer an allowed value for `mm-text-html-renderer'.
 
++++
+*** A new Gnus summary mode command, `S A'
+(`gnus-summary-attach-article') can be used to attach the current
+article(s) to a pre-existing Message buffer, or create a new Message
+buffer with the article(s) attached.
+
 ** erc
 
 ---
index d5610bff73910cfdab8b360ce49ee741647635b7..6505f90d3e8326de0ce94fe0358917e6403ce861 100644 (file)
@@ -393,6 +393,7 @@ Thank you for your help in stamping out bugs.
   "N" gnus-summary-followup-to-mail-with-original
   "m" gnus-summary-mail-other-window
   "u" gnus-uu-post-news
+  "A" gnus-summary-attach-article
   "\M-c" gnus-summary-mail-crosspost-complaint
   "Br" gnus-summary-reply-broken-reply-to
   "BR" gnus-summary-reply-broken-reply-to-with-original
@@ -2000,6 +2001,36 @@ this is a reply."
                         (insert "From: " (message-make-from) "\n"))))
                  nil 'local)))))
 
+(defun gnus-summary-attach-article (n)
+  "Attach the current article(s) to an outgoing Message buffer.
+If any current in-progress Message buffers exist, the articles
+can be attached to them.  If not, a new Message buffer is
+created.
+
+This command uses the process/prefix convention, so if you
+process-mark several articles, they will all be attached."
+  (interactive "P")
+  (let ((buffers (message-buffers))
+       destination)
+    ;; Set up the destination mail composition buffer.
+    (if (and buffers
+            (y-or-n-p "Attach files to existing mail composition buffer? "))
+       (setq destination
+             (if (= (length buffers) 1)
+                 (get-buffer (car buffers))
+               (gnus-completing-read "Attach to buffer"
+                                      buffers t nil nil (car buffers))))
+      (gnus-summary-mail-other-window)
+      (setq destination (current-buffer)))
+    (gnus-summary-iterate n
+      (gnus-summary-select-article)
+      (set-buffer destination)
+      ;; Attach at the end of the buffer.
+      (save-excursion
+       (goto-char (point-max))
+       (message-forward-make-body-mime gnus-original-article-buffer)))
+    (gnus-configure-windows 'message t)))
+
 (provide 'gnus-msg)
 
 ;;; gnus-msg.el ends here
index aed5aaf01eb78f030b646247747231b5fdfaa449..165d8f96490be25f31a77016ff906d0f4f47499c 100644 (file)
@@ -2629,6 +2629,7 @@ gnus-summary-show-article-from-menu-as-charset-%s" cs))))
        ["Resend message edit" gnus-summary-resend-message-edit t]
        ["Send bounced mail" gnus-summary-resend-bounced-mail t]
        ["Send a mail" gnus-summary-mail-other-window t]
+       ["Attach article to a message" gnus-summary-attach-article t]
        ["Create a local message" gnus-summary-news-other-window t]
        ["Uuencode and post" gnus-uu-post-news
         :help "Post a uuencoded article"]