Gnus development mailing list
 help / color / mirror / Atom feed
* Externally feeding the drafts folder -- git format-patch integration
@ 2014-02-22  9:20 Elias Oltmanns
  2014-02-27 14:32 ` Ted Zlatanov
  0 siblings, 1 reply; 4+ messages in thread
From: Elias Oltmanns @ 2014-02-22  9:20 UTC (permalink / raw)
  To: ding

Hi there,

my question is how best to sneak externally drafted e-mails into the
gnus ecosystem in order to be able to post edit them, have them on file
after sending them off, have the registry know all about it for
splitting by parent etc. For example, I would like to smooth the way for
patch reviewal and discussion. Ideally, the work flow would look similar
to this:
1. Do some development in local git repository (using magit).
2. Generate a patch series from the local commits with a command like
   $ git format-patch --thread --cover-letter --to developer@example.org \
   --cc devel@list.example.org --stdout > ~/Mail/git.spool
3. Fire up gnus and have the patch series stored in ~/Mail/git.spool
   magically appear in the drafts group so I can edit the cover letter
   and possibly annotate some of the other messages too before sending
   the off.
4. Replies to those e-mails should go to the corresponding devel folder
   by means of gnus-registry-split-fancy-with-parent.

As you may have guessed, my setup is failing at step 3. My lain attempt
was to put the following into my .gnus.el:
(setq mail-sources
      '((file :plugged t)
	(file :path "~/Mail/git.spool" :plugged t)))
...
(setq nnmail-split-fancy
  '(| ("x-gnus-mail-source" "git.spool" "nndraft:drafts")
      ...
      (: gnus-registry-split-fancy-with-parent)
      ...
      "INBOX"))

Unfortunately, the contents git.spool ends up in a newly created (and
masked) nnml directory nndraft:drafts under ~/Mail instead of the
special drafts group. Do you have any suggestions how to achieve this or
something similar?

Thanks in advance for all hints,

Elias




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

* Re: Externally feeding the drafts folder -- git format-patch integration
  2014-02-22  9:20 Externally feeding the drafts folder -- git format-patch integration Elias Oltmanns
@ 2014-02-27 14:32 ` Ted Zlatanov
  2014-03-04 10:40   ` lee
  0 siblings, 1 reply; 4+ messages in thread
From: Ted Zlatanov @ 2014-02-27 14:32 UTC (permalink / raw)
  To: ding

On Sat, 22 Feb 2014 10:20:42 +0100 Elias Oltmanns <eo@nebensachen.de> wrote: 

...
EO> 2. Generate a patch series from the local commits with a command like
EO>    $ git format-patch --thread --cover-letter --to developer@example.org \
EO>    --cc devel@list.example.org --stdout > ~/Mail/git.spool
EO> 3. Fire up gnus and have the patch series stored in ~/Mail/git.spool
EO>    magically appear in the drafts group so I can edit the cover letter
EO>    and possibly annotate some of the other messages too before sending
EO>    the off.

I don't know that piece, sorry.  But it can probably be automated with
some effort.  I know the drafts group is special.  "Lars" special.

You could maybe start an gnus-slave session with a new buffer in
message-mode, insert the message, and save it as a draft?

EO> 4. Replies to those e-mails should go to the corresponding devel folder
EO>    by means of gnus-registry-split-fancy-with-parent.

That's pretty easy.  You can force-feed the gnus-registry data about a
specific message ID.  So if you can get the message's message ID, no
worries.  And if you go through the gnus-slave session or something
similarly "Gnus-ish" the gnus-registry should notice anyhow.

Ted




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

* Re: Externally feeding the drafts folder -- git format-patch integration
  2014-02-27 14:32 ` Ted Zlatanov
@ 2014-03-04 10:40   ` lee
  2014-03-04 16:25     ` Elias Oltmanns
  0 siblings, 1 reply; 4+ messages in thread
From: lee @ 2014-03-04 10:40 UTC (permalink / raw)
  To: ding

Ted Zlatanov <tzz@lifelogs.com> writes:

> On Sat, 22 Feb 2014 10:20:42 +0100 Elias Oltmanns <eo@nebensachen.de> wrote: 
>
> ...
> EO> 2. Generate a patch series from the local commits with a command like
> EO>    $ git format-patch --thread --cover-letter --to developer@example.org \
> EO>    --cc devel@list.example.org --stdout > ~/Mail/git.spool
> EO> 3. Fire up gnus and have the patch series stored in ~/Mail/git.spool
> EO>    magically appear in the drafts group so I can edit the cover letter
> EO>    and possibly annotate some of the other messages too before sending
> EO>    the off.
>
> I don't know that piece, sorry.  But it can probably be automated with
> some effort.  I know the drafts group is special.  "Lars" special.
>
> You could maybe start an gnus-slave session with a new buffer in
> message-mode, insert the message, and save it as a draft?

You can use (setq gnus-agent-queue-mail 'always) to queue all outgoing
messages in the draft folder.  Insert messages into gnus with the
following function (which you can put into ~/.emacs"):


(defun my-gnus-group-mail (arg)
  "Start composing a mail.
Use the group given in ARG to find a posting style."
  (interactive "P")
  ;; We can't `let' gnus-newsgroup-name here, since that leads
  ;; to local variables leaking.
  (let ((group gnus-newsgroup-name)
	;; make sure last viewed article doesn't affect posting styles:
	(gnus-article-copy)
	(buffer (current-buffer)))
    (unwind-protect
	(progn
	  (setq gnus-newsgroup-name arg)
	  ;; #### see comment in gnus-setup-message -- drv
	  (gnus-setup-message 'message (message-mail)))
      (with-current-buffer buffer
	(setq gnus-newsgroup-name group)))))


Then call emacsclient like:


emacsclient -e '(my-gnus-group-mail "example.group")'


Gnus should be running before you call above function.

When you use a posting style for "example.group" that involves something
like (body :file "~/example-group-template.txt"), you can create an
email from the command line or from a script to pull in your patch as an
attachment.  You get a buffer to edit the mail, so you don´t need to
queue up all outgoing mail.  Of course, you could also point to the
patch file rather than a template that includes it as an attachment to
have the patch directly in the message.

For varying recipients and subjects, I´m using something like ("To"
:file "~/email-template-header-to.txt") and ("Subject" :file
"~/email-template-header-subject.txt") in the posting style.

These files are generated by a perl script.  I suppose you could write
one that draws in your patches and sends them off with gnus.


This works fine, though gnus should have some way to automatically send
messages from a script/command line, optionally allowing you to edit the
message before sending it out.  The way I´m doing it is going to some
lengths to get there.  We shouldn´t need to use mutt or the like to
generate messages which we Cc: or Bcc: to ourselves to get them into
gnus, especially not when we use emacs to edit them before sending them
anyway ...


-- 
Debugger entered--Lisp error: (error "No error here")
  signal(error ("No error here"))
  error("No %s here" "error")



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

* Re: Externally feeding the drafts folder -- git format-patch integration
  2014-03-04 10:40   ` lee
@ 2014-03-04 16:25     ` Elias Oltmanns
  0 siblings, 0 replies; 4+ messages in thread
From: Elias Oltmanns @ 2014-03-04 16:25 UTC (permalink / raw)
  To: ding

(2014-03-04) lee <lee@yun.yagibdah.de> wrote:
> Ted Zlatanov <tzz@lifelogs.com> writes:
>> On Sat, 22 Feb 2014 10:20:42 +0100 Elias Oltmanns <eo@nebensachen.de> wrote: 
>> 
>> ...
EO> 2. Generate a patch series from the local commits with a command like
EO>    $ git format-patch --thread --cover-letter --to developer@example.org \
EO>    --cc devel@list.example.org --stdout > ~/Mail/git.spool
EO> 3. Fire up gnus and have the patch series stored in ~/Mail/git.spool
EO>    magically appear in the drafts group so I can edit the cover letter
EO>    and possibly annotate some of the other messages too before sending
EO>    the off.
[...]
> You can use (setq gnus-agent-queue-mail 'always) to queue all outgoing
> messages in the draft folder.  Insert messages into gnus with the
> following function (which you can put into ~/.emacs"):
[...]
> Then call emacsclient like:
> 
> 
> emacsclient -e '(my-gnus-group-mail "example.group")'
> 
> 
> Gnus should be running before you call above function.
> 
> When you use a posting style for "example.group" that involves something
> like (body :file "~/example-group-template.txt"), you can create an
> email from the command line or from a script to pull in your patch as an
> attachment.  You get a buffer to edit the mail, so you don´t need to
> queue up all outgoing mail.  Of course, you could also point to the
> patch file rather than a template that includes it as an attachment to
> have the patch directly in the message.

Thank you ever so much for this starter. It certainly looks very
promising and I'll see how far I get once I've taken the time to wrap my
head around things.

[...]
> This works fine, though gnus should have some way to automatically send
> messages from a script/command line, optionally allowing you to edit the
> message before sending it out.  The way I´m doing it is going to some
> lengths to get there.  We shouldn´t need to use mutt or the like to
> generate messages which we Cc: or Bcc: to ourselves to get them into
> gnus, especially not when we use emacs to edit them before sending them
> anyway ...

My thoughts, precisely!

Thanks again,

Elias




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

end of thread, other threads:[~2014-03-04 16:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-22  9:20 Externally feeding the drafts folder -- git format-patch integration Elias Oltmanns
2014-02-27 14:32 ` Ted Zlatanov
2014-03-04 10:40   ` lee
2014-03-04 16:25     ` Elias Oltmanns

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