*** empty log message ***
[gnus] / lisp / gnus-msg.el
index cc122e1..4bd55a6 100644 (file)
@@ -100,7 +100,7 @@ the second with the current group name.")
 (defvar gnus-posting-styles nil
   "*Alist of styles to use when posting.")
 
-(defcustom gnus-group-posting-charset-alist 
+(defcustom gnus-group-posting-charset-alist
   '(("^no\\." iso-8859-1)
     (message-this-is-mail nil)
     ("^de\\." nil)
@@ -161,6 +161,7 @@ Thank you for your help in stamping out bugs.
   "c" gnus-summary-cancel-article
   "s" gnus-summary-supersede-article
   "r" gnus-summary-reply
+  "y" gnus-summary-yank-message
   "R" gnus-summary-reply-with-original
   "w" gnus-summary-wide-reply
   "W" gnus-summary-wide-reply-with-original
@@ -860,6 +861,19 @@ If YANK is non-nil, include the original article."
   (when (get-buffer "*Gnus Help Bug*")
     (kill-buffer "*Gnus Help Bug*")))
 
+(defun gnus-summary-yank-message (buffer n)
+  "Yank the current article into a composed message."
+  (interactive
+   (list (completing-read "Buffer: " (mapcar 'list (message-buffers)) nil t)
+        current-prefix-arg))
+  (gnus-summary-iterate n
+    (let ((gnus-display-mime-function nil)
+         (gnus-inhibit-treatment t))
+      (gnus-summary-select-article))
+    (save-excursion
+      (set-buffer buffer)
+      (message-yank-buffer gnus-article-buffer))))
+
 (defun gnus-debug ()
   "Attempts to go through the Gnus source file and report what variables have been changed.
 The source file has to be in the Emacs load path."
@@ -1159,7 +1173,7 @@ this is a reply."
              (setq element 'signature
                    filep t))
            ;; Get the contents of file elems.
-           (when filep
+           (when (and filep v)
              (setq v (with-temp-buffer
                        (insert-file-contents v)
                        (buffer-string))))
@@ -1187,7 +1201,8 @@ this is a reply."
                      `(lambda ()
                         (save-excursion
                           (let ((message-signature ,(cdr result)))
-                            (message-insert-signature)))))
+                            (when message-signature
+                              (message-insert-signature))))))
                     (t
                      (let ((header
                             (if (symbolp (car result))