From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/75864 Path: news.gmane.org!not-for-mail From: Richard Lawrence Newsgroups: gmane.emacs.gnus.general Subject: Automatically processing plain text attachments Date: Sun, 23 Jan 2011 19:11:41 -0800 Message-ID: <877hdvf11u.fsf@berkeley.edu> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1295883071 2906 80.91.229.12 (24 Jan 2011 15:31:11 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 24 Jan 2011 15:31:11 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M24215@lists.math.uh.edu Mon Jan 24 16:31:07 2011 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PhONl-0001O1-3e for ding-account@gmane.org; Mon, 24 Jan 2011 16:31:05 +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 1PhON9-0003zS-FG; Mon, 24 Jan 2011 09:30:27 -0600 Original-Received: from mx1.math.uh.edu ([129.7.128.32]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1PhEli-0001LV-Fb for ding@lists.math.uh.edu; Sun, 23 Jan 2011 23:15:10 -0600 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx1.math.uh.edu with esmtp (Exim 4.72) (envelope-from ) id 1PhElg-00057M-Eb for ding@lists.math.uh.edu; Sun, 23 Jan 2011 23:15:09 -0600 Original-Received: from lo.gmane.org ([80.91.229.12]) by quimby.gnus.org with esmtp (Exim 4.72) (envelope-from ) id 1PhEle-0004aP-98 for ding@gnus.org; Mon, 24 Jan 2011 06:15:06 +0100 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1PhEld-0007Qb-Of for ding@gnus.org; Mon, 24 Jan 2011 06:15:05 +0100 Original-Received: from c-67-164-33-170.hsd1.ca.comcast.net ([67.164.33.170]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 24 Jan 2011 06:15:05 +0100 Original-Received: from richard.lawrence by c-67-164-33-170.hsd1.ca.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 24 Jan 2011 06:15:05 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 58 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: c-67-164-33-170.hsd1.ca.comcast.net User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:qc6ypsel3iYC5C2m7dQr068SSrY= X-Spam-Score: -1.9 (-) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:75864 Archived-At: Hi all, [I'm new to the list, so apologies if this is a rather newb-ish question. I looked in the manual, and tried to search the archives at Gmane, but didn't come up with much, perhaps because I'm not exactly certain which terms I should be using. Pointers to documentation of all kinds would be greatly appreciated...] I'm hoping I can solicit a little advice about how to pull plain text email attachments off of a subset of incoming messages and do some batch processing on them, without seriously slowing down the rest of my mail reading. The background: I am about to begin teaching a writing-intensive course. Students will email me their papers every week. I have no desire to download, print, and read a bunch of .doc files by hand every week. So I am considering asking my students to email their papers in plain text. I would like to then apply some automated processing on my end that would: - download each student's paper - apply some (hopefully) simple transformations on the text - save the resulting document in my "teaching" directory The goal is to have these papers end up in Org mode format, so I can do further batch processing that will export them using LaTeX, add them to my to-do list, etc. Since I will have about 100 papers to read over the course of this semester, it seems like automating this is the right way to go. I currently use a very simple Gnus setup. I am running Gnus 5.13 in Emacs 23 on Debian. I read my mail over nnimap. Here's what I was thinking might work: 1) Tell my students that they must indicate in the subject line of their email that it contains a paper submission, so I can split those emails to a special group using nnimap-split-rule. 2) Somehow, further process the emails that end up in that group. For example: - the group could represent a local Maildir, and I could have a cron job process new emails found there - the group could represent an IMAP folder, and when I read articles in that group, Gnus runs a hook that extracts attachments, processes them in a temporary buffer, and saves the result to a file (or perhaps refiles in an existing Org file) Perhaps my question boils down to: what hooks are available in Gnus that would allow me batch process the full content of these paper-submission emails at the time they are split from my inbox (without having to download the full content of *every* mail, e.g., by setting nnimap-split-download-body)? Thanks so much for any advice you can offer! Best, Richard