Re: [Orgmode] [OT] Importing plain text attachments into Org

2011-01-24 Thread Jeff Horn
 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.

I don't have direct answers to your other questions, but have a look
at catdoc and antiword (I prefer the latter) for reading docs on the
command line. I spotted an interesting article on how to use emacs to
open doc files using antiword, but haven't tried it yet.

http://www.emacswiki.org/emacs/AntiWord

-- 
Jeffrey Horn
http://www.failuretorefrain.com/jeff/

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] [OT] Importing plain text attachments into Org

2011-01-24 Thread Eric S Fraga
Richard Lawrence richard.lawre...@berkeley.edu writes:

 Dear Orgsters,

 I'm hoping I can solicit a little advice about pulling email attachments
 into Org (via Gnus), since some of the folks on this list seem to have
 experience interacting with Gnus from Org.  I realize that the meat of
 my question may be better asked on the Gnus list, but if anyone here has
 knowledge and/or a similar setup that you'd be willing to share, I would
 very much appreciate hearing about it.

 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.
 (This is a pain, and requires proprietary software I don't have; and I
 find 12pt double-spaced Times New Roman much more difficult to read than
 a LaTeX article anyway.)  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:

A lot depends on what you use to read your emails.  Since you are using
gnus, I think some aspects of what you want to do are possible.  You may
need to upgrade to no-gnus (the development version of gnus which goes
under various names...).

 1) Download each student's paper into a file in my teaching
 directory.

I would avoid downloading the papers.  Simply use org-capture to create
a task for each paper you need to read that links automatically to the
gnus email.  Store a link first (org-store-link) when in the email and
then capture a task (org-capture) in which you insert the link
(org-insert-link).  You may wish to create a custom template and it may
be possible to extract the From and Subject fields from the link
information automatically (see messages in this list from a few weeks
ago, I believe -- I'm offline at the moment unfortunately).

 2) Apply some *very* simple transformations, like adding #+TITLE before
 their title, replacing Windows `smart quote' characters with ASCII ` and
 ', and generally making the files play nice with Org on a GNU box.  I
 might also like to do things like run a word count at this stage to make
 sure they are within the guidelines for the course.

Assuming you follow my suggestion for 1) above, you can read the
document in the email with appropriate transformations (by washing the
email in gnus parlance; e.g. function gnus-article-fill-long-lines and
variable gnus-treat-strip-cr, amongst others).  You can display MS Word
documents inline in the message using mm-decode functions.  I have the
following set:

#+begin_src emacs-lisp
;; --- for MS Word files
(add-to-list 'mm-attachment-override-types application/msword)
(add-to-list 'mm-attachment-override-types 
application/vnd.openxmlformats-officedocument.wordprocessingml.document)
(add-to-list 'mm-automatic-display application/msword)
(add-to-list 'mm-inline-media-tests '(application/msword mm-inline-text 
identity))
(add-to-list 'mm-automatic-display 
application/vnd.openxmlformats-officedocument.wordprocessingml.document)
(add-to-list 'mm-inline-media-tests 
'(application/vnd.openxmlformats-officedocument.wordprocessingml.document 
mm-inline-text identity))
#+end_src

I don't pretend to understand some of this incantation, mind you...  in
any case, some of this will depend on your ~/.mailcap (or /etc/mailcap)
entries.  I have:

--8---cut here---start-8---
application/msword; antiword -w 0 %s; copiousoutput
application/vnd.openxmlformats-officedocument.wordprocessingml.document; 
/home/ucecesf/s/bin/docx2txt.pl %s -; copiousoutput
--8---cut here---end---8---

where docx2txt.pl is a perl script I found on the web somewhere (I can
send it to you if you wish) that handles the latest MS Word format.

 3) Use Org's export abilities to compile each paper into a PDF (or
 perhaps a single PDF for the whole week's submissions).

 4) [Not necessary, but would be cool:] Automatically insert TODO items
 into my agenda for each paper I have to read; automatically grade
 students who don't turn in papers on time; etc.

You can tag your capture tasks created above appropriately and then use,
for instance, properties to enter marks which you can subsequently
collate (I believe -- I don't know how to do this but I believe it is
possible).

 Does anyone have any ideas about how I might go about this, and whether
 it's worth the effort to automate it?  (I will have about 100 papers to
 read this semester.)  

Enjoy!  ;-)
-- 
: Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.50.1
: using Org-mode version 7.4 (release_7.4.232.g8d003)

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] [OT] Importing plain text attachments into Org

2011-01-23 Thread Richard Lawrence
Dear Orgsters,

I'm hoping I can solicit a little advice about pulling email attachments
into Org (via Gnus), since some of the folks on this list seem to have
experience interacting with Gnus from Org.  I realize that the meat of
my question may be better asked on the Gnus list, but if anyone here has
knowledge and/or a similar setup that you'd be willing to share, I would
very much appreciate hearing about it.

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.
(This is a pain, and requires proprietary software I don't have; and I
find 12pt double-spaced Times New Roman much more difficult to read than
a LaTeX article anyway.)  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:

1) Download each student's paper into a file in my teaching directory.

2) Apply some *very* simple transformations, like adding #+TITLE before
their title, replacing Windows `smart quote' characters with ASCII ` and
', and generally making the files play nice with Org on a GNU box.  I
might also like to do things like run a word count at this stage to make
sure they are within the guidelines for the course.

3) Use Org's export abilities to compile each paper into a PDF (or
perhaps a single PDF for the whole week's submissions).

4) [Not necessary, but would be cool:] Automatically insert TODO items
into my agenda for each paper I have to read; automatically grade
students who don't turn in papers on time; etc.

Does anyone have any ideas about how I might go about this, and whether
it's worth the effort to automate it?  (I will have about 100 papers to
read this semester.)  

Thanks so much!

Best,
Richard









___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode