Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to write .emacs from Emacs when I've deleted .emacs

Tags:

emacs

I have Emacs open but accidentally I've deleted the .emacs file it read when it started. This represents about 15 years of tweaking. (I know, I know, backups.)

Is there a way to get Emacs to write out the .emacs file I've deleted?

I wouldn't normally ask such a lame question on SO but I know I only have a day or so before this Emacs session ends.

like image 260
SteveRawlinson Avatar asked Aug 30 '11 22:08

SteveRawlinson


1 Answers

As ayckoster suggests, you might try a file recovery or forensics tool like The Sleuth Kit. Or, and this may seem crazy, if you're on a Unix-like system, you could search through the raw disk device (on the Mac I'm currently on, that would be /dev/rdisk1). Seriously, several times I've been too lazy to break out a full-blown recovery tool but instead used something like sudo less -f /dev/rdisk1, searched for a string I knew was in the file (global-set-key, anyone?), and succeeded in recovering the file's original content.

like image 100
ajk Avatar answered Oct 06 '22 01:10

ajk