emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Karl Voit <devnull@Karl-Voit.at>
To: emacs-orgmode@gnu.org
Subject: Capture from GNU screen to Org-mode (was: Email -> Org-mode: charset problem)
Date: Tue, 28 Jun 2011 19:13:33 +0200	[thread overview]
Message-ID: <2011-06-28T18-54-01@devnull.Karl-Voit.at> (raw)
In-Reply-To: 87fwmvghxa.wl%dmaus@ictsoc.de

* David Maus <dmaus@ictsoc.de> wrote:
>
> As far as I know a lot, if not most, email messages are transfered in
> 7bit for backward compatibility reasons and getting things other than
> text/plain; charset=3Dus-ascii across the net via email requires a lot
> of things to consider (RFC2045-49 in all their glory). 

Yes. The header is always 7-bit ASCII. The body has to be
interpreted by very advanced algorithms in order to show the various
types of content properly.

> So dumping the raw message won't help, you need functions for
> processing the raw message informaton.

I came to the very same conclusion. :-( I thought «formail» would be
able to handle charset for me.

> Here's an idea (or two).

Thanks for your ideas!

Those are perfectly good tips for someone who is using a MUA and
Org-mode on the same computer.

But my system is different since I am using «mutt»[1] as MUA
(running in a GNU screen[2] session) on a remote server (accessed by
ssh). 

Org-mode is (only) running on my local machine since the (very slow)
root server is an old Debian stable one (with emacs21 only).

My personal solution for the moment is following system:

Since I am using GNU screen which has the ability to dump its screen
content (non graphical!) into a file, I wrote a shell script that
generates an Org-mode entry and appends it to the input.org which
will be synchronized over all my systems anyway (by cron and
unison[3] although dvcs-autosync[4] seems to be very handy too for
building your own Dropbox[5] alternative, respectively).

,----[ *one* line from my .screenrc ]
| bind O eval "hardcopy_append off" "hardcopy
|   $HOME/screen-capture.tmp" "screen sh
|   $HOME/bin/add-screensnapshot-to-org.sh"
`----

... this one creates a screenshot when I press «Ctrl-a O» in GNU
screen. Then «$HOME/screen-capture.tmp» gets filled with the screen
content (which is the start of an email or a usenet posting[6] or
similar - whichever is shown currently in GNU screen).

Then following script generates the (simple) Org-mode entry:

,----[ $HOME/bin/add-screensnapshot-to-org.sh ]
| #!/bin/sh
| ## generates an org-file-entry from a screen capture file from GNU screen
|
| SCREENCONTENTFILE="$HOME/screen-capture.tmp"
| ORGFILE="$HOME/org-mode/inbox.org"
|
| ## not very elegant, I know:
| echo "* TODO screen "`date '+%Y-%m-%dT%H:%M'` >> ${ORGFILE}
| echo ":PROPERTIES:" >> ${ORGFILE}
| echo ":CREATED: <"`date '+%Y-%m-%d %a %H:%M'`">" >> ${ORGFILE}
| echo ":END:" >> ${ORGFILE}
| echo >> ${ORGFILE}
| echo "#+BEGIN_VERB" >> ${ORGFILE}
| cat "${SCREENCONTENTFILE}" >> ${ORGFILE}
| echo "#+END_VERB" >> ${ORGFILE}
| echo  >> ${ORGFILE}
|
| #end
`----

Probably this method could be handy for other users of GNU screen
and Org-mode too.

  1. http://www.mutt.org/
  2. https://secure.wikimedia.org/wikipedia/en/wiki/GNU_Screen
  3. http://www.cis.upenn.edu/~bcpierce/unison/
  4. http://www.mayrhofer.eu.org/dvcs-autosync
  5. https://www.dropbox.com/
  6. http://www.slrn.org/
-- 
Karl Voit

      parent reply	other threads:[~2011-06-28 17:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-27  8:30 Email -> Org-mode: charset problem Karl Voit
2011-06-27 20:04 ` David Maus
2011-06-28  4:43   ` Richard Lawrence
2011-06-28 17:13   ` Karl Voit [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2011-06-28T18-54-01@devnull.Karl-Voit.at \
    --to=devnull@karl-voit.at \
    --cc=emacs-orgmode@gnu.org \
    --cc=news1142@Karl-Voit.at \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).