]> code.delx.au - gnu-emacs/blobdiff - lisp/gnus/gnus-dired.el
Change a custom default to ease the mail->message transition.
[gnu-emacs] / lisp / gnus / gnus-dired.el
index c6639a285ace621596f05a4b0d18f5450404cb20..595a9fe4ffda625ec107fd8840245db815da6cfb 100644 (file)
@@ -1,7 +1,7 @@
 ;;; gnus-dired.el --- utility functions where gnus and dired meet
 
 ;; Copyright (C) 1996, 1997, 1998, 1999, 2001, 2002, 2003, 2004,
-;;   2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+;;   2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
 
 ;; Authors: Benjamin Rutt <brutt@bloomington.in.us>,
 ;;          Shenghuo Zhu <zsh@cs.rochester.edu>
@@ -55,9 +55,6 @@
 (autoload 'message-buffers "message")
 (autoload 'gnus-print-buffer "gnus-sum")
 
-;; Load the `gnus-setup-message' macro that `gnus-dired-attach' uses.
-(require 'gnus-msg)
-
 (defvar gnus-dired-mode nil
   "Minor mode for intersections of MIME mail composition and dired.")
 
@@ -164,9 +161,17 @@ filenames."
                                    bufs)
                                   nil t)))
        ;; setup a new mail composition buffer
-       (if (eq gnus-dired-mail-mode 'gnus-user-agent)
-           (gnus-setup-message 'message (message-mail))
-         ;; FIXME: Is this the right thing?
+       (let ((mail-user-agent gnus-dired-mail-mode)
+             ;; A workaround to prevent Gnus from displaying the Gnus
+             ;; logo when invoking this command without loading Gnus.
+             ;; Gnus demonstrates it when gnus.elc is being loaded if
+             ;; a command of which the name is prefixed with "gnus"
+             ;; causes that autoloading.  See the code in question,
+             ;; that is the one first found in gnus.el by performing
+             ;; `C-s this-command'.
+             (this-command (if (eq gnus-dired-mail-mode 'gnus-user-agent)
+                               'gnoose-dired-attach
+                             this-command)))
          (compose-mail))
        (setq destination (current-buffer)))