* revert-buffer tragedy
@ 2005-04-23 2:16 Lowell Kirsh
2005-04-23 4:48 ` Denis Bueno
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: Lowell Kirsh @ 2005-04-23 2:16 UTC (permalink / raw)
I just lost hours of work due to a combination of auto-revert-buffer and
accidentally overwriting a file in my shell. I was working on foo.txt in
an emacs buffer and accidentally overwrote it from a shell prompt while
it was open in the buffer. When I went back to emacs, it reported that
the buffer was reverted and when I tried to undo, it said no undo
information was available. I've already checked in the ~/.backups folder
but there is nothing useful there. Any ideas how I might be able to
recover my work?
Lowell
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: revert-buffer tragedy
2005-04-23 2:16 revert-buffer tragedy Lowell Kirsh
@ 2005-04-23 4:48 ` Denis Bueno
2005-04-23 7:23 ` ken
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Denis Bueno @ 2005-04-23 4:48 UTC (permalink / raw)
Cc: help-gnu-emacs
On 4/22/05, Lowell Kirsh <lkirsh@cs.ubc.ca> wrote:
> Any ideas how I might be able to
> recover my work?
Not quite sure I can help you recover it, but, I have some very
paranoid settings in my .emacs to avoid just this situation. If you
don't have something like the following, adding them will prevent such
tragedies in the future.
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(auto-save-interval 100) ;backups every 100 keystrokes
...)
;; Backups to central location
(setq make-backup-files t ;backup my files
backup-by-copying t ;don't clobber symlinks
backup-directory-alist '(("." . "~/.emacs.d/saves")) ;don't litter
delete-old-versions t
kept-new-versions 6
kept-old-versions 2
version-control t ;use versioned backups
vc-make-backup-files t ;make backups for cvs projects
vc-follow-symlinks t)
-Denis
PGP: http://pgp.mit.edu:11371/pks/lookup?search=0xA1B51B4B&op=index
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: revert-buffer tragedy
2005-04-23 2:16 revert-buffer tragedy Lowell Kirsh
2005-04-23 4:48 ` Denis Bueno
@ 2005-04-23 7:23 ` ken
2005-04-23 8:01 ` Adrian Aichner
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: ken @ 2005-04-23 7:23 UTC (permalink / raw)
Lowell Kirsh wrote:
> I just lost hours of work due to a combination of auto-revert-buffer
> and accidentally overwriting a file in my shell. I was working on
> foo.txt in an emacs buffer and accidentally overwrote it from a shell
> prompt while it was open in the buffer. When I went back to emacs, it
> reported that the buffer was reverted and when I tried to undo, it
> said no undo information was available. I've already checked in the
> ~/.backups folder but there is nothing useful there. Any ideas how I
> might be able to recover my work?
>
> Lowell
An autosave file has saved my keister a few times. Look for a file in
the same directory with the same filename except wrapped with pound
signs (#). Doing "ls -a \#*" should show it. In emacs you could simply
visit the trashed file and do M-x recover-file and reply with the filename.
Good luck.
hth,
ken
--
A lot of us are working harder than we want, at things we don't like to
do. Why? ...In order to afford the sort of existence we don't care to live.
-- Bradford Angier
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: revert-buffer tragedy
2005-04-23 2:16 revert-buffer tragedy Lowell Kirsh
2005-04-23 4:48 ` Denis Bueno
2005-04-23 7:23 ` ken
@ 2005-04-23 8:01 ` Adrian Aichner
2005-04-24 0:32 ` Lowell Kirsh
2005-04-24 0:49 ` Luc Teirlinck
4 siblings, 0 replies; 6+ messages in thread
From: Adrian Aichner @ 2005-04-23 8:01 UTC (permalink / raw)
Lowell Kirsh <lkirsh@cs.ubc.ca> writes:
> I just lost hours of work due to a combination of auto-revert-buffer
> and accidentally overwriting a file in my shell. I was working on
> foo.txt in an emacs buffer and accidentally overwrote it from a shell
> prompt while it was open in the buffer. When I went back to emacs, it
> reported that the buffer was reverted and when I tried to undo, it
> said no undo information was available. I've already checked in the
> ~/.backups folder but there is nothing useful there. Any ideas how I
> might be able to recover my work?
Have you looked in auto-save-directory ?
If there's something there, you could try recovering by one of
following commands:
b* recover-all-files - Do recover-file for all autosave files which are current.
b* recover-file - Visit file FILE, but get contents from its last auto-save file.
b* recover-session - Recover auto save files from a previous Emacs session.
Good Luck,
Adrian
>
> Lowell
--
Adrian Aichner
mailto:adrian@xemacs.org
http://www.xemacs.org/
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: revert-buffer tragedy
2005-04-23 2:16 revert-buffer tragedy Lowell Kirsh
` (2 preceding siblings ...)
2005-04-23 8:01 ` Adrian Aichner
@ 2005-04-24 0:32 ` Lowell Kirsh
2005-04-24 0:49 ` Luc Teirlinck
4 siblings, 0 replies; 6+ messages in thread
From: Lowell Kirsh @ 2005-04-24 0:32 UTC (permalink / raw)
Thank you all for your advice. Unfortunately nothing worked. I have to
redo my work. At least I've learned a valuable lesson: backup frequently!
Lowell
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: revert-buffer tragedy
2005-04-23 2:16 revert-buffer tragedy Lowell Kirsh
` (3 preceding siblings ...)
2005-04-24 0:32 ` Lowell Kirsh
@ 2005-04-24 0:49 ` Luc Teirlinck
4 siblings, 0 replies; 6+ messages in thread
From: Luc Teirlinck @ 2005-04-24 0:49 UTC (permalink / raw)
Lowell Kirsh wrote:
I just lost hours of work due to a combination of auto-revert-buffer
and accidentally overwriting a file in my shell.
I do not know what shell you were using and how you accidentally
overwrote your file from the shell. But if you were using bash and
overwrote using output redirection, you could write:
set -C
in your .bashrc. That will only protect against accidental overwiting
using output redirection (using `>', `>&', and `<>'), however.
Sincerely,
Luc.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2005-04-24 0:49 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-04-23 2:16 revert-buffer tragedy Lowell Kirsh
2005-04-23 4:48 ` Denis Bueno
2005-04-23 7:23 ` ken
2005-04-23 8:01 ` Adrian Aichner
2005-04-24 0:32 ` Lowell Kirsh
2005-04-24 0:49 ` Luc Teirlinck
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).