[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How i can backup files in one particular directory?
From: |
Luis O. Silva |
Subject: |
Re: How i can backup files in one particular directory? |
Date: |
Tue, 16 Jul 2002 13:51:03 +0400 |
Hi, Shailesh
On Mon, 15 Jul 2002 21:17:23 -0700 (PDT), Shailesh Joshi writes:
Shailesh> ... How i can store backup files (which are
Shailesh> created by emacs) in one particular directory?
Shailesh> If possible please send me .emacs code too.
Dealing with emacs backup files is explained in the subsection
*Backup* within the *Saving files* section of the Emacs
Manual. Here is a quotation:
"you can customize the variable `backup-directory-alist' to
specify that files matching certain patterns should be
backed up in specific directories".
"A typical use is to add an element `("." . DIR)' to make
all backups in the directory with absolute name DIR; Emacs
modifies the backup file names to avoid clashes between
files with the same names originating in different
directories. Alternatively, adding, say, `("." . ".~")'
would make backups in the invisible subdirectory `.~' of
the original file's directory. Emacs creates the
directory, if necessary, to make the backup."
The following is a snippet of my .emacs. You must read the
*Backup* subsection in order to adapt it for you.
;; ------------------ Setting the handling of backups -------------------
(setq backup-directory-alist
'((".+\\.tex$" . "~/backup/tex")
("/[^\\./]+\\..+$" . "~/backup/code")
("/[^\\.]+$" . "~/backup")
("/\\.." . "~/backup/dotfiles")))
;; backup variables
(setq
version-control t
kept-new-versions 6
kept-old-versions 6
)
;; ---------------------- End handling of backups------------------------
Regards,
luis
--
Luis Octavio Silva P.
St. Petersburg State University.
66/3 Botanicheskaya St., Apt.119/2
Stary Peterhof
St. Petersburg, Russia.