* emacs allways asking to delete excess backup file
@ 2008-05-02 13:08 TheLonelyStar
2008-05-02 13:56 ` Peter Dyballa
0 siblings, 1 reply; 3+ messages in thread
From: TheLonelyStar @ 2008-05-02 13:08 UTC (permalink / raw)
To: Help-gnu-emacs
I hate thos *~ files all over my filesystem, I therefor added the following
to my .emacs:
;; Enable backup files.
(setq make-backup-files t)
;; Enable versioning with default values (keep five last versions, I think!)
(setq version-control t)
;; Save all backup file in this directory.
(setq backup-directory-alist (quote ((".*" . "~/.emacs_backups/"))))
Now emacs always askes me, if it should delete excess backup file when I
save a file ...
Can I make emacs to just do it without asking?
Thanks!
Nathan
--
View this message in context: http://www.nabble.com/emacs-allways-asking-to-delete-excess-backup-file-tp17019147p17019147.html
Sent from the Emacs - Help mailing list archive at Nabble.com.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: emacs allways asking to delete excess backup file
2008-05-02 13:08 TheLonelyStar
@ 2008-05-02 13:56 ` Peter Dyballa
0 siblings, 0 replies; 3+ messages in thread
From: Peter Dyballa @ 2008-05-02 13:56 UTC (permalink / raw)
To: TheLonelyStar; +Cc: Help-gnu-emacs
Am 02.05.2008 um 15:08 schrieb TheLonelyStar:
> Can I make emacs to just do it without asking?
Experiment with kept-new-versions and kept-old-versions!
--
Greetings
Pete
The human animal differs from the lesser primates in his passion for
lists of "Ten Best."
– H. Allen Smith
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: emacs allways asking to delete excess backup file
[not found] <mailman.11082.1209733728.18990.help-gnu-emacs@gnu.org>
@ 2008-05-02 14:51 ` Xah
0 siblings, 0 replies; 3+ messages in thread
From: Xah @ 2008-05-02 14:51 UTC (permalink / raw)
To: help-gnu-emacs
You might be intrested in the following:
• How to set emacs so that all backups are directed into one folder?
(such as at a directory "~/myBackups")
Use the following lisp code in init file:
; return a backup file path of a give file path
; with full directory mirroring from a root dir
; non-existant dir will be created
(defun my-backup-file-name (fpath)
"Return a new file path of a given file path.
If the new path's directories does not exist, create them."
(let (backup-root bpath)
(setq backup-root "~/.emacs.d/emacs-backup")
(setq bpath (concat backup-root fpath "~"))
(make-directory (file-name-directory bpath) bpath)
bpath
)
)
(setq make-backup-file-name-function 'my-backup-file-name)
The above will mirror all directories at the given backup dir. For
example, if you are editing a file “/Users/jane/web/xyz/myfile.txt”,
and your backup root is “/Users/jane/.emacs.d/emacs-backup”, then the
backup will be at “/Users/jane/.emacs.d/emacs-backup/Users/jane/web/
xyz/myfile.txt~”.
If you want all backup to be flat in a dir, use the following:
(setq backup-directory-alist '(("" . "~/.emacs.d/emacs-backup")))
This will create backup files flat in the given dir, and the backup
file names will have “!” characters in place of the directory
separator. For example, if you are editing a file at “/Users/jane/web/
xyz/myfile.txt”, and your backup dir is set at “/Users/jane/.emacs.d/
emacs-backup”, then the backup file will be at: “/Users/jane/.emacs.d/
emacs-backup/Users!jane!web!emacs!myfile.txt~”. If you use long file
names or many nested dirs, this scheme will reach file name length
limit quickly.
Xah
xah@xahlee.org
∑ http://xahlee.org/
☄
On May 2, 6:08 am, TheLonelyStar <nab...@lonely-star.org> wrote:
> I hate thos *~ files all over my filesystem, I therefor added the following
> to my .emacs:
>
> ;; Enable backup files.
> (setq make-backup-files t)
>
> ;; Enable versioning with default values (keep five last versions, I think!)
> (setq version-control t)
>
> ;; Save all backup file in this directory.
> (setq backup-directory-alist (quote ((".*" . "~/.emacs_backups/"))))
>
> Now emacs always askes me, if it should delete excess backup file when I
> save a file ...
> Can I make emacs to just do it without asking?
>
> Thanks!
> Nathan
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-05-02 14:51 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <mailman.11082.1209733728.18990.help-gnu-emacs@gnu.org>
2008-05-02 14:51 ` emacs allways asking to delete excess backup file Xah
2008-05-02 13:08 TheLonelyStar
2008-05-02 13:56 ` Peter Dyballa
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).