Subject: [sup-talk] save somewhere else than temp?

From: [email-masked] (marko.myllymaki at iki.fi)
Date: Mon, 18 Feb 2008 14:04:58 +0200

Is it possible to change where sup saves the messages under editing? Sup
just crashed and I lost quite a long message editing in /tmp/ ;)

I'd like the edited messages be saved to .sup/editing/*

---

From: [email-masked] (William Morgan)
Date: Mon, 18 Feb 2008 06:34:42 -0800

Reformatted excerpts from Marko Myllym?ki's message of 2008-02-18:
> Is it possible to change where sup saves the messages under editing?
> Sup just crashed and I lost quite a long message editing in /tmp/ ;)
> 

Just because it's in /tmp doesn't mean it's automatically deleted, does
it? (Except maybe at system startup.)

-- 
William <wmorgan-sup at masanjin.net>

---

From: [email-masked] (marko.myllymaki at iki.fi)
Date: Mon, 18 Feb 2008 17:57:24 +0200

> it? (Except maybe at system startup.)

Yes, it's weird. At what stage does Sup actually delete the edited
messages (after sending I guess)? I was not able to see any edited
messages in /tmp after the crashes. Sup crashed after exiting the emacs
editor. No files in drafts or sent.mbox either...

However I was able to see file 12554-0-sup.compose-mode when I
intentionally killed Sup, trying to simulate the situation... 

Here is the exception log after one crash if it helps in any way:
--- Interrupt from thread: main

/var/lib/gems/1.8/gems/sup-0.4/lib/sup/buffer.rb:31:in `select'
/var/lib/gems/1.8/gems/sup-0.4/lib/sup/buffer.rb:31:in
`nonblocking_getch'
/var/lib/gems/1.8/gems/sup-0.4/bin/sup:213
/usr/bin/sup:19:in `load'
/usr/bin/sup:19

---

From: [email-masked] (Nicolas Pouillard)
Date: Mon, 18 Feb 2008 23:47:45 +0100

> it? (Except maybe at system startup.)

If  you're  using  Tempfile  then closing the file, delete it. And closing the
process can force it to close it's files.

I've  locally  workaround this problem by defining a custom script that keep a
copy in ~/tmp as the sup editor.

Regards,

-- 
Nicolas Pouillard aka Ertai
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 194 bytes
Desc: not available
Url : http://rubyforge.org/pipermail/sup-talk/attachments/20080218/39a69292/attachment.bin

---

From: [email-masked] (William Morgan)
Date: Tue, 19 Feb 2008 09:38:11 -0800

Reformatted excerpts from nicolas.pouillard's message of 2008-02-18:
> If  you're  using  Tempfile  then closing the file, delete it. And
> closing the process can force it to close it's files.

I am using Tempfile, which has a non-deterministic behavior (at least, I
can't figure out a pattern) upon crashing: sometimes it deletes the
files, sometimes it leaves them.

I guess the answer is to manage my own temporary files, deleting them
only upon successful shutdown.

---

From: [email-masked] (Nicolas Pouillard)
Date: Wed, 20 Feb 2008 11:54:20 +0100

> only upon successful shutdown.

Long  time  ago  (when I did more ruby stuffs), I wrote this module (attached)
that  makes  part of a package called core_ex. I found it far more useful than
the default module. Feel free to import it.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: temp_path.rb
Type: application/octet-stream
Size: 5318 bytes
Desc: not available
Url : http://rubyforge.org/pipermail/sup-talk/attachments/20080220/41dbda11/attachment.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 194 bytes
Desc: not available
Url : http://rubyforge.org/pipermail/sup-talk/attachments/20080220/41dbda11/attachment.bin