Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
* Re: Little help sorting please...
       [not found] <m3bs3mifun.fsf@west_mm.org>
@ 2002-12-16 10:06 ` Kai Großjohann
  2002-12-17  2:46   ` Mike Dixon
  0 siblings, 1 reply; 7+ messages in thread
From: Kai Großjohann @ 2002-12-16 10:06 UTC (permalink / raw)


Mike Dixon <in_my.t@gline.org> writes:

> Here's (a portion of) what I've been using satisfactorily for quite
> awhile:
>
>     gnus-message-archive-group '(
> 	(if (not (message-news-p))  "Mail/mail_cc")
> 	    ("^comp.emacs" "nnfolder+saved:sent-to-emacs")
> 	    ("^gnu.emacs.help" "nnfolder+saved:sent-to-emacs")
>             .
>             .
>             .
> 	    (".*" "nnfolder+saved:sent-to-others")))

(defun mike-gnus-message-archive-group (group)
  (if group
      (format "nnfolder:%s.archive" group)
    "nnfolder:other.archive"))
(setq gnus-message-archive-group '(mike-gnus-message-archive-group))

I'm not sure if it works like this.  Hm.  It does say it could be a
list of functions, and the above is a list of functions, but I've
never tried it this way.

The function mike-gnus-message-archive-group looks if it is called
with a group name.  If so, then it constructs an archive group name
from the group name passed -- %s gets replaced with the group name.
If there is no group name, then it returns a default group.
-- 
~/.signature is: umop ap!sdn    (Frank Nobis)


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

* Re: Little help sorting please...
  2002-12-16 10:06 ` Little help sorting please Kai Großjohann
@ 2002-12-17  2:46   ` Mike Dixon
  2002-12-17  9:38     ` Kai Großjohann
  0 siblings, 1 reply; 7+ messages in thread
From: Mike Dixon @ 2002-12-17  2:46 UTC (permalink / raw)



> Mike Dixon <in_my.t@gline.org> writes:
> 
> > Here's (a portion of) what I've been using satisfactorily for quite
> > awhile:
> >
> >     gnus-message-archive-group '(
> > 	(if (not (message-news-p))  "Mail/mail_cc")
> > 	    ("^comp.emacs" "nnfolder+saved:sent-to-emacs")
> > 	    ("^gnu.emacs.help" "nnfolder+saved:sent-to-emacs")
> >             .
> >             .
> >             .
> > 	    (".*" "nnfolder+saved:sent-to-others")))
> 
> (defun mike-gnus-message-archive-group (group)
>   (if group
>       (format "nnfolder:%s.archive" group)
>     "nnfolder:other.archive"))
> (setq gnus-message-archive-group '(mike-gnus-message-archive-group))
> 
> I'm not sure if it works like this.  Hm.  It does say it could be a
> list of functions, and the above is a list of functions, but I've
> never tried it this way.
> 

Thanks for the help Kai.

I commented my old *archive*, added yours, restarted Emacs and when I
tried to add a post, reply to a post, or fwd a post I get this (from
*Messages*):

    run-hooks: Wrong type argument: listp, mike-gnus-message-archive-group
    Wrong type argument: listp, mike-gnus-message-archive-group

The header pops up w/point on the first line of the header (and the error
msg in m-buffer).  This is the entire header that's generated (I indented
it):

    Newsgroups: alt.test
    Subject:
    User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1
    X-Newsreader: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1
    X-Mailer: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1
    --text follows this line--


I checked that there's only one *archive* (don't know if that matters).
Beyond that I'm sorry - I don't know what else to check/test....

Mike
-- 


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

* Re: Little help sorting please...
  2002-12-17  2:46   ` Mike Dixon
@ 2002-12-17  9:38     ` Kai Großjohann
       [not found]       ` <m3adj3y9rn.fsf@west_mm.org>
  0 siblings, 1 reply; 7+ messages in thread
From: Kai Großjohann @ 2002-12-17  9:38 UTC (permalink / raw)


Mike Dixon <in_my.t@gline.org> writes:

> I commented my old *archive*, added yours, restarted Emacs and when I
> tried to add a post, reply to a post, or fwd a post I get this (from
> *Messages*):
>
>     run-hooks: Wrong type argument: listp, mike-gnus-message-archive-group
>     Wrong type argument: listp, mike-gnus-message-archive-group

Okay, so how about

(setq gnus-message-archive-group '((mike-gnus-message-archive-group)))

with an additional pair of parens around
mike-gnus-message-archive-group?  Does that work?

Note that I'm stabbing in the dark, here.
-- 
~/.signature is: umop ap!sdn    (Frank Nobis)


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

* Re: Little help sorting please...
       [not found]         ` <84fzsvmeg8.fsf@lucy.cs.uni-dortmund.de>
@ 2002-12-21  8:57           ` Mike Dixon
       [not found]             ` <84vg1nbjht.fsf@lucy.cs.uni-dortmund.de>
  0 siblings, 1 reply; 7+ messages in thread
From: Mike Dixon @ 2002-12-21  8:57 UTC (permalink / raw)



> Mike Dixon <in_my.t@gline.org> writes:
> 
> > Thanks Kai.  Got a different error:
> 
> Gah :-(
> 
> > Wrong number of arguments: (lambda (group) (if group (format "nnfolder:%s.archive" group) "nnfolder:other.archive")), 0
> >
> > I'll play around with it some and see if I can determine what's causing
> > the error...
> 
> I've peeked at the source, and maybe
> 
> (setq gnus-message-archive-group 'mike-gnus-message-archive-group)
> 
> is the simplest value that will do.  But the one with the double pair
> of parens should also work, if...
> 
> (defun mike-gnus-message-archive-group (group)
> 
> you write (&optional group) instead of (group) in the defun line.
> 
>   (if group
>       (format "nnfolder:%s.archive" group)
>     "nnfolder:other.archive"))
> 
> Tell about your findings...
> 
> But maybe the group name isn't passed as often as it should be.  Hm.
> Well, we will see.
> -- 

Hi Kai - 

:-> The archive file my post is saved to using the above is at the end of
a nested set of dirs.  For instance, if the group name is gnu.emacs.gnus
and I post to that group, and my archive file is therefore named
gnu.emacs.gnus.archive, using the code above I end up with
~/*/gnu/emacs/gnus/archive which is where the copy of my post is stored.  I 
was hoping for a filename such as ~/*/gnu.emacs.gnus.archive (which it
looked like I was going to get with "nnfolder:%s.archive"). 

I found "format" in my LISP Info file but the specifiers didn't indicate
behavior like that for %s.  I located nnfolder.el and there's a
function/dir "file-name-as-directory" that I wonder if that's the root
cause of this (converted what I wanted as a filename into a dir path)?  Is
this the default behavior of nnfolder used as it is here to convert "."
into directories?  Do you know if there's some way I can use
"file-name-as-directory" in nnfolder.el such that my posts are stored in
filenames where it doesn't convert the "." in the group name into
directories (or is there a better way to accomplish this)?  Incidentally,
when I save a thread (T #, O-f <name>) it creates one directory such as
"comp.protocols.tcp-ip" and saves the thread in there but does not convert
the "." in comp.protocols.tcp-ip into a nested series of directories
(i.e., comp/protocols/tcp-ip/).

I looked at "nnfolder" from the index of Info:gnus but unless I missed
something it doesn't seem to mention this dir-creating behavior.  I hope
my question isn't too convoluted so to restate, what I'm after is an
archive file where the "." of the Usenet group name isn't converted to
directories - a filename like gnu.emacs.gnus.archive.

Mike


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

* Re: Little help sorting please...
       [not found]             ` <84vg1nbjht.fsf@lucy.cs.uni-dortmund.de>
@ 2002-12-22  2:36               ` Mike Dixon
  2002-12-22 14:07                 ` Kai Großjohann
  0 siblings, 1 reply; 7+ messages in thread
From: Mike Dixon @ 2002-12-22  2:36 UTC (permalink / raw)




> Mike Dixon <in_my.t@gline.org> writes:
> 
> > :-> The archive file my post is saved to using the above is at the end of
> > a nested set of dirs.  For instance, if the group name is gnu.emacs.gnus
> > and I post to that group, and my archive file is therefore named
> > gnu.emacs.gnus.archive, using the code above I end up with
> > ~/*/gnu/emacs/gnus/archive which is where the copy of my post is stored.  I 
> > was hoping for a filename such as ~/*/gnu.emacs.gnus.archive (which it
> > looked like I was going to get with "nnfolder:%s.archive"). 
> 
> Why is the filename important if you can access the stuff via the
> group nnfolder+archive:gnu.emacs.gnus.archive?  It should not be

Because I don't know how to :->  

I don't comprehend the whole Gnus virtual server/backend stuff (not for
lack of trying).  So like many I stick with what one is able to get
working satisfactorily, not wanting to disturb what's arrived at, which
for me was putting posts into files such as "sent-to-gnus.emacs.gnus."  I
use Gnus to read Usenet - not to become a Gnus-jock and most of the
subtleties of Gnus are therefore lost on me.

> That said, investigate the variables gnus-use-long-file-name and
> nnmail-use-long-file-names.  (Only Lars knows why one is singular and
> the other is plural.  Don't ask...)

Thanks Kai - I'll look into them (or take another stab at trying to
understand the whole backend thing).

Thanks for your help and patience.

Mike


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

* Re: Little help sorting please...
  2002-12-22  2:36               ` Mike Dixon
@ 2002-12-22 14:07                 ` Kai Großjohann
       [not found]                   ` <m3isxdfcar.fsf@west_mm.org>
  0 siblings, 1 reply; 7+ messages in thread
From: Kai Großjohann @ 2002-12-22 14:07 UTC (permalink / raw)


Mike Dixon <in_my.t@gline.org> writes:

>> Why is the filename important if you can access the stuff via the
>> group nnfolder+archive:gnu.emacs.gnus.archive?  It should not be
>
> Because I don't know how to :->  

I see.  I suggest that you hit `^' in the *Group* buffer.  This will
give you a list of servers.  On the nnfolder:archive server, hit
RET.  Now use `u' to subscribe to the groups you want (eg,
gnu.emacs.gnus.archive).  When you are done, hit `q' to exit the
group list, then `q' again to exit the server list.

Now the groups should be listed amongst all the other groups and can
be entered with RET or SPC or the middle mouse button.

(Maybe you have to hit `g' before the newly subscribed groups are
listed -- I'm not sure.)

Does this help?
-- 
~/.signature is: umop ap!sdn    (Frank Nobis)


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

* Re: Little help sorting please...
       [not found]                   ` <m3isxdfcar.fsf@west_mm.org>
@ 2002-12-29  8:42                     ` Mark Dixon
  0 siblings, 0 replies; 7+ messages in thread
From: Mark Dixon @ 2002-12-29  8:42 UTC (permalink / raw)



> > Mike Dixon <in_my.t@gline.org> writes:
> > 
> > >> Why is the filename important if you can access the stuff via the
> > >> group nnfolder+archive:gnu.emacs.gnus.archive?  It should not be
> > >
> > > Because I don't know how to :->  
> > 
> > I see.  I suggest that you hit `^' in the *Group* buffer.  This will
> > give you a list of servers.  On the nnfolder:archive server, hit
> > RET.  Now use `u' to subscribe to the groups you want (eg,
> > gnu.emacs.gnus.archive).  When you are done, hit `q' to exit the
> > group list, then `q' again to exit the server list.
> > 
> > Now the groups should be listed amongst all the other groups and can
> > be entered with RET or SPC or the middle mouse button.
> > 
> > (Maybe you have to hit `g' before the newly subscribed groups are
> > listed -- I'm not sure.)
> > 
> > Does this help?
> > -- 
> > ~/.signature is: umop ap!sdn    (Frank Nobis)
> 
> I was fiddling around with this but am having some trouble:
> 
> (defun gcc-outgoing-post (group)
>     (if group (format "nnfolder:%s.posts" group)
>      "nnfolder:Mail/mail_cc"))
> (setq gnus-message-archive-group 'gcc-outgoing-post)
> 
> The problem seems to be that for either posting to Usenet or fwd'ing mail
> "group" is always set to current group.  Therefore Gcc is always set to a
> Usenet group name but never to my mail file.
> 
> So I set debug-on-entry.  When your function is called there's a slew of
> other functions called and I was trying to use one that's called for news
> but not for mail (or vice versa) as a test for the "if" (such as
> "message-forward" which is apparently not called if it's news).
> 
> (defun gcc-outgoing-post (group)
>     (if (message-forward(nil)) 
> 	"nnfolder:Mail/mail_cc"
>     (format "nnfolder:%s.posts" group)))
> (setq gnus-message-archive-group 'gcc-outgoing-post)
> 
> The problem is that (no matter the iteration) I keep getting errors like
> "Symbol's function definition is void" or "Symbol's value as variable...",
> etc.  I was hoping just its presence (of lack of) would be evaluated to
> decide the if/else.  Apparently it doesn't work like that.  Do you know
> something I can use in its place to test whether it's news or mail?  How
> did you find the group variable (it isn't in Info:lisp)?
> 

Never mind :-> "message-news-p"  What is this?  I found it in my ~/.gnus.el
(my old gnus-message-archive* list), put it in the "if" test and the thing
works fine now.

Mike


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

end of thread, other threads:[~2002-12-29  8:42 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <m3bs3mifun.fsf@west_mm.org>
2002-12-16 10:06 ` Little help sorting please Kai Großjohann
2002-12-17  2:46   ` Mike Dixon
2002-12-17  9:38     ` Kai Großjohann
     [not found]       ` <m3adj3y9rn.fsf@west_mm.org>
     [not found]         ` <84fzsvmeg8.fsf@lucy.cs.uni-dortmund.de>
2002-12-21  8:57           ` Mike Dixon
     [not found]             ` <84vg1nbjht.fsf@lucy.cs.uni-dortmund.de>
2002-12-22  2:36               ` Mike Dixon
2002-12-22 14:07                 ` Kai Großjohann
     [not found]                   ` <m3isxdfcar.fsf@west_mm.org>
2002-12-29  8:42                     ` Mark Dixon

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