Gnus development mailing list
 help / color / mirror / Atom feed
* attaching a file in dired mode
@ 2009-02-20 13:15 Eythan Weg
  2009-02-23  7:12 ` Katsumi Yamaoka
  0 siblings, 1 reply; 8+ messages in thread
From: Eythan Weg @ 2009-02-20 13:15 UTC (permalink / raw)
  To: ding



Hi,

When I use  gnus-dired-attach while the cursor is on a
file in dired buffer it results in 
 
       Invalid function:   gnus-setup-message

Attaching a file works  correctly when a mail
buffer  exists.

What should be expected?

I use gnus in a recent cvs emacs

Thanks, Eythan





^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: attaching a file in dired mode
  2009-02-20 13:15 attaching a file in dired mode Eythan Weg
@ 2009-02-23  7:12 ` Katsumi Yamaoka
  2009-02-23 19:17   ` Glenn Morris
  2009-02-24 14:48   ` Eythan Weg
  0 siblings, 2 replies; 8+ messages in thread
From: Katsumi Yamaoka @ 2009-02-23  7:12 UTC (permalink / raw)
  To: Eythan Weg; +Cc: ding, emacs-devel

>>>>> Eythan Weg wrote:
> Hi,

> When I use  gnus-dired-attach while the cursor is on a
> file in dired buffer it results in

>        Invalid function:   gnus-setup-message

> Attaching a file works  correctly when a mail
> buffer  exists.

> What should be expected?

> I use gnus in a recent cvs emacs

> Thanks, Eythan

This happens with Gnus bundled with Emacs.  `gnus-setup-message'
is a macro that should be provided when compiling gnus-dired.el,
however I realized it is not loaded when compiling gnus-dired.el
along with Emacs (no problem when performing `make' on No Gnus).
I've fixed it in the Emacs trunk as follows:

--8<---------------cut here---------------start------------->8---
*** gnus-dired.el~	Mon Jan  5 03:21:57 2009
--- gnus-dired.el	Mon Feb 23 06:58:34 2009
***************
*** 53,61 ****
  ;; 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")
  (autoload 'gnus-print-buffer "gnus-sum")
  
  (defvar gnus-dired-mode nil
    "Minor mode for intersections of MIME mail composition and dired.")
  
--- 53,63 ----
  ;; 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-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.")
  
--8<---------------cut here---------------end--------------->8---

Note: using `eval-when-compile' generates useless warnings.

Regards,




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: attaching a file in dired mode
  2009-02-23  7:12 ` Katsumi Yamaoka
@ 2009-02-23 19:17   ` Glenn Morris
  2009-02-23 23:41     ` Katsumi Yamaoka
  2009-02-24 14:48   ` Eythan Weg
  1 sibling, 1 reply; 8+ messages in thread
From: Glenn Morris @ 2009-02-23 19:17 UTC (permalink / raw)
  To: Katsumi Yamaoka; +Cc: Eythan Weg, ding, emacs-devel

Katsumi Yamaoka wrote:

>> When I use  gnus-dired-attach while the cursor is on a
>> file in dired buffer it results in
>
>>        Invalid function:   gnus-setup-message

This is bug 1060.

http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=1060

> + ;; Load the `gnus-setup-message' macro that `gnus-dired-attach' uses.
> + (require 'gnus-msg)

For me, this has the problem described in bug #1060:

emacs -Q
C-x d
M-x turn-on-gnus-dired-mode

just sits there showing the Gnus logo (though it does seem to work if
one just kills the logo buffer).


Oh, but I see you installed a different change. This has the other
problem described in bug 1060:

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

void-variable gnus-article-reply



Note one of the goals of FOR-RELEASE is to "minimize Gnus dependencies
in gnus-dired.el" (see also the comments in gnus-dired: "These are
used only if the user customizes `gnus-dired-mail-mode' to use Message
and/or Gnus"). So it would be nice if gnus-dired did not
unconditionally require other Gnus features.




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: attaching a file in dired mode
  2009-02-23 19:17   ` Glenn Morris
@ 2009-02-23 23:41     ` Katsumi Yamaoka
  2009-02-24 18:23       ` Glenn Morris
  0 siblings, 1 reply; 8+ messages in thread
From: Katsumi Yamaoka @ 2009-02-23 23:41 UTC (permalink / raw)
  To: Glenn Morris; +Cc: Eythan Weg, ding, emacs-devel

>>>>> Glenn Morris wrote:
> Katsumi Yamaoka wrote:

>>> When I use  gnus-dired-attach while the cursor is on a
>>> file in dired buffer it results in
>>
>>>        Invalid function:   gnus-setup-message

> This is bug 1060.

> http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=1060

>> + ;; Load the `gnus-setup-message' macro that `gnus-dired-attach' uses.
>> + (require 'gnus-msg)

> For me, this has the problem described in bug #1060:

> emacs -Q
> C-x d
> M-x turn-on-gnus-dired-mode

> just sits there showing the Gnus logo (though it does seem to work if
> one just kills the logo buffer).

> Oh, but I see you installed a different change. This has the other
> problem described in bug 1060:

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

> void-variable gnus-article-reply

> Note one of the goals of FOR-RELEASE is to "minimize Gnus dependencies
> in gnus-dired.el" (see also the comments in gnus-dired: "These are
> used only if the user customizes `gnus-dired-mail-mode' to use Message
> and/or Gnus"). So it would be nice if gnus-dired did not
> unconditionally require other Gnus features.

Oops.  So, what I did was only having fixed the byte code that
was made so as to funcall a macro symbol.  I didn't think that
gnus-dired.el is used without launching Gnus.  But I may not be
wrong at least in `C-c C-m C-a' (gnus-dired-attach).  Why one
wishes to use `C-c C-m C-a' is that one wants to use one's Gnus
configuration for message sending, message archiving, etc.  So,
it is not unreasonable requirement that one has to run Gnus in
advance, is it?  How about making it stop with a warning like
"You must run Gnus first"?

OTOH, `report-emacs-bug', if `mail-user-agent' is set to
`gnus-user-agent', loads many Gnus modules, but doesn't necessarily
require running Gnus.  If `gnus-dired-attach' has to be improved
to get to be like it, it will take time.  I don't feel like doing
it very much, though.

For the other gnus-dired features, `gnus-dired-find-file-mailcap'
and `gnus-dired-print', they have no inevitability to be prefixed
with `gnus-', I think.

Regards,




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: attaching a file in dired mode
  2009-02-23  7:12 ` Katsumi Yamaoka
  2009-02-23 19:17   ` Glenn Morris
@ 2009-02-24 14:48   ` Eythan Weg
  1 sibling, 0 replies; 8+ messages in thread
From: Eythan Weg @ 2009-02-24 14:48 UTC (permalink / raw)
  To: ding; +Cc: emacs-devel


Katsumi Yamaoka <yamaoka@jpl.org>
Mon, 23 Feb 2009 16:12:33 +0900

   >>>>> Eythan Weg wrote:
   > Hi,
   
   > When I use  gnus-dired-attach while the cursor is on a
   > file in dired buffer it results in
   
   >        Invalid function:   gnus-setup-message
   
   > Attaching a file works  correctly when a mail
   > buffer  exists.
   
   > What should be expected?
   
   > I use gnus in a recent cvs emacs
   
   > Thanks, Eythan
   
   This happens with Gnus bundled with Emacs.  `gnus-setup-message'
   is a macro that should be provided when compiling gnus-dired.el,
   however I realized it is not loaded when compiling gnus-dired.el
   along with Emacs (no problem when performing `make' on No Gnus).
   I've fixed it in the Emacs trunk as follows:
   

Works well.  Thanks.  Eythan 





^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: attaching a file in dired mode
  2009-02-23 23:41     ` Katsumi Yamaoka
@ 2009-02-24 18:23       ` Glenn Morris
  2009-02-25  2:26         ` Katsumi Yamaoka
  0 siblings, 1 reply; 8+ messages in thread
From: Glenn Morris @ 2009-02-24 18:23 UTC (permalink / raw)
  To: Katsumi Yamaoka; +Cc: Eythan Weg, ding, emacs-devel

Katsumi Yamaoka wrote:

> I didn't think that gnus-dired.el is used without launching Gnus.

I didn't follow the discussion, but I think rms wants gnus-dired to be
capable of (optionally) working without the rest of Gnus.

> But I may not be wrong at least in `C-c C-m C-a'
> (gnus-dired-attach). Why one wishes to use `C-c C-m C-a' is that one
> wants to use one's Gnus configuration for message sending, message
> archiving, etc. So, it is not unreasonable requirement that one has
> to run Gnus in advance, is it? How about making it stop with a
> warning like "You must run Gnus first"?

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)

(It's possible none of this makes sense, I'm not familiar with how
this works...)




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: attaching a file in dired mode
  2009-02-24 18:23       ` Glenn Morris
@ 2009-02-25  2:26         ` Katsumi Yamaoka
  2009-02-25  3:59           ` Glenn Morris
  0 siblings, 1 reply; 8+ messages in thread
From: Katsumi Yamaoka @ 2009-02-25  2:26 UTC (permalink / raw)
  To: Glenn Morris; +Cc: Eythan Weg, ding, emacs-devel

[-- 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)))
 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: attaching a file in dired mode
  2009-02-25  2:26         ` Katsumi Yamaoka
@ 2009-02-25  3:59           ` Glenn Morris
  0 siblings, 0 replies; 8+ messages in thread
From: Glenn Morris @ 2009-02-25  3:59 UTC (permalink / raw)
  To: Katsumi Yamaoka; +Cc: Eythan Weg, ding, emacs-devel

Katsumi Yamaoka wrote:

> The patch is below.  Could you try it?

It works just fine for me, thanks!




^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2009-02-25  3:59 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-02-20 13:15 attaching a file in dired mode Eythan Weg
2009-02-23  7:12 ` 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
2009-02-25  3:59           ` Glenn Morris
2009-02-24 14:48   ` Eythan Weg

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 NNTP newsgroup(s).