From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/84256 Path: news.gmane.org!not-for-mail From: lee Newsgroups: gmane.emacs.gnus.general Subject: Re: Externally feeding the drafts folder -- git format-patch integration Date: Tue, 04 Mar 2014 11:40:07 +0100 Organization: my virtual residence Message-ID: <87k3cas0vs.fsf@yun.yagibdah.de> References: <87eh2v5wr9.fsf@denkblock.local> <87a9dceidf.fsf@lifelogs.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1393929664 27415 80.91.229.3 (4 Mar 2014 10:41:04 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 4 Mar 2014 10:41:04 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M32504@lists.math.uh.edu Tue Mar 04 11:41:11 2014 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1WKmmc-0006pl-UH for ding-account@gmane.org; Tue, 04 Mar 2014 11:41:11 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by util0.math.uh.edu with smtp (Exim 4.63) (envelope-from ) id 1WKmlt-0004rf-31; Tue, 04 Mar 2014 04:40:25 -0600 Original-Received: from mx2.math.uh.edu ([129.7.128.33]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1WKmlp-0004rQ-QL for ding@lists.math.uh.edu; Tue, 04 Mar 2014 04:40:21 -0600 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx2.math.uh.edu with esmtps (TLSv1:AES128-SHA:128) (Exim 4.76) (envelope-from ) id 1WKmln-0000mK-MQ for ding@lists.math.uh.edu; Tue, 04 Mar 2014 04:40:20 -0600 Original-Received: from client-194-42-186-216.muenet.net ([194.42.186.216] helo=yun.yagibdah.de) by quimby.gnus.org with esmtp (Exim 4.80) (envelope-from ) id 1WKmll-0006mU-QB for ding@gnus.org; Tue, 04 Mar 2014 11:40:17 +0100 Original-Received: from lee by yun.yagibdah.de with local (Exim 4.80.1) (envelope-from ) id 1WKmlh-0005Nm-V5 for ding@gnus.org; Tue, 04 Mar 2014 11:40:13 +0100 In-Reply-To: <87a9dceidf.fsf@lifelogs.com> (Ted Zlatanov's message of "Thu, 27 Feb 2014 09:32:28 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) Mail-Followup-To: ding@gnus.org X-Spam-Score: -0.9 (/) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:84256 Archived-At: Ted Zlatanov writes: > On Sat, 22 Feb 2014 10:20:42 +0100 Elias Oltmanns wro= te:=20 > > ... > 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=C2=B4t 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=C2=B4m 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=C2=B4m doing it is going to some lengths to get there. We shouldn=C2=B4t 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 ... --=20 Debugger entered--Lisp error: (error "No error here") signal(error ("No error here")) error("No %s here" "error")