From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/68333 Path: news.gmane.org!not-for-mail From: Katsumi Yamaoka Newsgroups: gmane.emacs.devel,gmane.emacs.gnus.general Subject: Re: attaching a file in dired mode Date: Wed, 25 Feb 2009 11:26:12 +0900 Organization: Emacsen advocacy group Message-ID: References: <87tz6p1c85.fsf@gmail.com> <9beixphsju.fsf@fencepost.gnu.org> <02skm3vgmi.fsf@fencepost.gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1235528812 32280 80.91.229.12 (25 Feb 2009 02:26:52 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 25 Feb 2009 02:26:52 +0000 (UTC) Cc: Eythan Weg , ding@gnus.org, emacs-devel@gnu.org To: Glenn Morris Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Feb 25 03:28:08 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Lc9VH-00060u-P8 for ged-emacs-devel@m.gmane.org; Wed, 25 Feb 2009 03:28:08 +0100 Original-Received: from localhost ([127.0.0.1]:47473 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Lc9Tw-0003Wn-Nb for ged-emacs-devel@m.gmane.org; Tue, 24 Feb 2009 21:26:44 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Lc9Tq-0003WT-N5 for emacs-devel@gnu.org; Tue, 24 Feb 2009 21:26:38 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Lc9To-0003Vy-Bm for emacs-devel@gnu.org; Tue, 24 Feb 2009 21:26:37 -0500 Original-Received: from [199.232.76.173] (port=59693 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Lc9To-0003Vs-8X for emacs-devel@gnu.org; Tue, 24 Feb 2009 21:26:36 -0500 Original-Received: from orlando.hostforweb.net ([216.246.45.90]:57329) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Lc9Tl-000184-LS; Tue, 24 Feb 2009 21:26:33 -0500 Original-Received: from localhost ([127.0.0.1]:33337) by orlando.hostforweb.net with esmtpa (Exim 4.69) (envelope-from ) id 1Lc9Tc-00053K-7M; Tue, 24 Feb 2009 20:26:24 -0600 X-Hashcash: 1:20:090225:rgm@gnu.org::BtcvftS8YV7kyBIm:0000005WmI X-Hashcash: 1:20:090225:eythanweg@gmail.com::pPt45VVgDRTqla6i:0000000000000000000000000000000000000000000xUY X-Hashcash: 1:20:090225:ding@gnus.org::tok1ZQNd4xeHmWzJ:000099NQ X-Hashcash: 1:20:090225:emacs-devel@gnu.org::5wQvU8UorWVzaJoC:0000000000000000000000000000000000000000002JAo X-Face: #kKnN,xUnmKia.'[pp`; Omh}odZK)?7wQSl"4o04=EixTF+V[""w~iNbM9ZL+.b*_CxUmFk B#Fu[*?MZZH@IkN:!"\w%I_zt>[$nm7nQosZ<3eu; B:$Q_:p!',P.c0-_Cy[dz4oIpw0ESA^D*1Lw= L&i*6&( User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.0.90 (gnu/linux) Cancel-Lock: sha1:YBUWgbp3OmSkRaZoLXfzajdFk9A= X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - orlando.hostforweb.net X-AntiAbuse: Original Domain - gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - jpl.org X-Source: X-Source-Args: X-Source-Dir: X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:109326 gmane.emacs.gnus.general:68333 Archived-At: --=-=-= >>>>> 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, --=-=-= Content-Type: text/x-patch Content-Disposition: inline --- 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))) --=-=-=--