unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Katsumi Yamaoka <yamaoka@jpl.org>
To: Glenn Morris <rgm@gnu.org>
Cc: Eythan Weg <eythanweg@gmail.com>, ding@gnus.org, emacs-devel@gnu.org
Subject: Re: attaching a file in dired mode
Date: Wed, 25 Feb 2009 11:26:12 +0900	[thread overview]
Message-ID: <b4mskm3s14r.fsf@jpl.org> (raw)
In-Reply-To: 02skm3vgmi.fsf@fencepost.gnu.org

[-- Attachment #1: Type: text/plain, Size: 1347 bytes --]

>>>>> Glenn Morris wrote:
> That's probably fine, if the message says something like:
> "You must run Gnus, or customize `gnus-dired-mail-mode', first"

> Or, how about something like changing the default value of
> gnus-dired-mail-mode to something like:

> (if (featurep 'gnus) 'gnus-user-agent
>   'mail-user-agent)

At last I discovered what causes the Gnus logo screen.  That is
the following snippet that has been put in gnus.el:

(eval-when (load)
  (let ((command (format "%s" this-command)))
    (when (string-match "gnus" command)
      (if (string-match "gnus-other-frame" command)
	  (gnus-get-buffer-create gnus-group-buffer)
	(gnus-splash)))))

It is evaluated when gnus.elc is being autoloaded.  Note that
what causes that autoloading then is `gnus-dired-attach', of
which the name matches "gnus".  So, how about faking the value
of `this-command'?  The patch is below.  Could you try it?

> emacs -Q
> C-x d
> M-x turn-on-gnus-dired-mode
> mark file
> C-c C-m C-a

This works well for me.  I don't know why I don't observe bug
1060, i.e. ``void-variable gnus-article-reply'', though.  Do you
still get that error?

In addition, `gnus-dired-attach' seems to have been written
before I improved Gnus' `compose-mail' handling.  Now it should
work with `gnus-user-agent' and the `gnus-setup-message' macro
is not necessary.

Regards,


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 1301 bytes --]

--- gnus-dired.el~	2009-02-23 10:54:53 +0000
+++ gnus-dired.el	2009-02-25 02:23:18 +0000
@@ -53,7 +53,6 @@
 ;; Autoloads to avoid byte-compiler warnings.  These are used only if the user
 ;; customizes `gnus-dired-mail-mode' to use Message and/or Gnus.
 (autoload 'message-buffers "message")
-(autoload 'gnus-setup-message "gnus-msg" nil nil 'macro)
 (autoload 'gnus-print-buffer "gnus-sum")
 
 (defvar gnus-dired-mode nil
@@ -162,9 +161,17 @@
 				    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)))
 

  reply	other threads:[~2009-02-25  2:26 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <87tz6p1c85.fsf@gmail.com>
2009-02-23  7:12 ` attaching a file in dired mode Katsumi Yamaoka
2009-02-23 19:17   ` Glenn Morris
2009-02-23 23:41     ` Katsumi Yamaoka
2009-02-24 18:23       ` Glenn Morris
2009-02-25  2:26         ` Katsumi Yamaoka [this message]
2009-02-25  3:59           ` Glenn Morris
2009-02-24 14:48   ` Eythan Weg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b4mskm3s14r.fsf@jpl.org \
    --to=yamaoka@jpl.org \
    --cc=ding@gnus.org \
    --cc=emacs-devel@gnu.org \
    --cc=eythanweg@gmail.com \
    --cc=rgm@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).