From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thierry Banel Subject: Re: auto-backing up your .emacs Date: Sat, 21 Dec 2013 16:16:20 +0000 (UTC) Message-ID: References: <20131221142330.4927760a@london> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:46750) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VuPEQ-0007yo-4n for emacs-orgmode@gnu.org; Sat, 21 Dec 2013 11:16:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VuPEJ-0007LL-Cu for emacs-orgmode@gnu.org; Sat, 21 Dec 2013 11:16:50 -0500 Received: from plane.gmane.org ([80.91.229.3]:37068) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VuPEJ-0007Ku-6o for emacs-orgmode@gnu.org; Sat, 21 Dec 2013 11:16:43 -0500 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1VuPEH-00024m-8X for emacs-orgmode@gnu.org; Sat, 21 Dec 2013 17:16:41 +0100 Received: from mna75-5-82-226-29-239.fbx.proxad.net ([82.226.29.239]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 21 Dec 2013 17:16:41 +0100 Received: from tbanelwebmin by mna75-5-82-226-29-239.fbx.proxad.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 21 Dec 2013 17:16:41 +0100 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Sharon Kimble talktalk.net> writes: > > Can somebody help me please, I want to put this line into my .emacs - > 'cp ~/.emacs ~/.emacs.d/.emacs-$(date +%Y%m%d-%R)' but it works as part > of a bash script, but I don’t know elisp to get it working in my .emacs. > What it does is save a dated and timed copy of your .emacs in your > ~/.emacs.d so that when you're trying things out and learning how to > use .emacs you'll always have a backup copy. A case in point, last > night I had org2blog working, today, after fiddling its stopped > working, but if I'd had this operational I could just revert to a known > and working .emacs. So, can you help please? > > Thanks > Sharon. Hi Sharon Emacs already have a builtin file version control. If you use Emacs itself to edit your .emacs, it will most likely create a .emacs~, which is a backup. This is controlled by the variable make-backup-files. Add this line to your .emacs: (setq make-backup-files t) You may want to have several backup files. They will be numbered with names like .emacs.~7~ Then add this line to your .emacs: (setq version-control t) Of course this works for all files visited by Emacs, not only .emacs. Look at the documentation: within Emacs, type C-h i then navigate to Emacs > Files > Saving > Backup Have fun