> acme, like sam, keeps a log of changes in /tmp/*acme. I believe that
> such a file contains enough to reconstruct acme's state when (or
> shortly before) it crashed, but I don't know of an automated means of
> doing so.
i've done this, with mixed results, on a couple of occasions. it's almost
always more hassle than it's worth.
for a start acme doesn't keep all its state in the /tmp/*acme files, only that
which has been flushed out of memory. i looked into this, but can't
now remember what the criteria are. anyway, the temp file doesn't hold
all the metadata necessary for its reconstruction - it's just used as an
external
adjunct to main memory. so you tend to get old and new versions of fragments
of text in different parts of the file. also, it's worth noting that
the characters in the file are held as two-byte runes (local endian). luckily
they're
all two-byte aligned, otherwise things would be even harder.
i modified strings(1) to dump rune-based strings with no length restriction.
this provides a start, but more often than not the text you're looking for
is not in the file.
the most successful technique was when my mouse was unplugged (plugging it in
did not cause it to start working again). typing enough text in the current
window caused the text to be flushed to the temp file, enabling its retrieval
from another terminal, assuming you're using a remote fs.
acme does dump when it catches a note, but depending on the
circumstances sometimes just truncates the dump file, which can erase whatever
stuff you already had!
a couple of changes i've long contemplated:
- if you restored acme from a given dump file, it should dump to the same
file.
- dumping should be "safe" - i.e. it should create the file under another
name and dump to it
before moving the original out of the way, moving the new file to the dump
file and finally removing the original.
less chance of erasing precious data this way.
- an option to get acme to do an automatic dump every so often. (e.g. to
acme.backup.dump)
but i'm also aware that these changes might be anathema to purists...