unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* When does emacs backup files?
@ 2011-02-18 23:57 orium
  2011-02-20 19:54 ` Peter Dyballa
  2011-02-21  5:10 ` Le Wang
  0 siblings, 2 replies; 7+ messages in thread
From: orium @ 2011-02-18 23:57 UTC (permalink / raw)
  To: help-gnu-emacs

Hi,

I want my emacs to backup every file on save (with version control),
but for some reason i only have one version of each file.

My configuration is this:

(setq make-backup-files t)
(setq version-control t) ; Enable backup versioning
(setq delete-old-versions t) ; Don't ask about delete old versions of
backup
(setq kept-new-versions 1000000) ; Remember 1M versions of backup
(setq kept-old-versions 1000000)
(setq backup-directory-alist (quote ((".*" . "~/.emacs_backups/"))))

How can have one new backup version created every time i save a file?


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: When does emacs backup files?
  2011-02-18 23:57 When does emacs backup files? orium
@ 2011-02-20 19:54 ` Peter Dyballa
  2011-02-20 20:16   ` Teemu Likonen
  2011-02-21  5:10 ` Le Wang
  1 sibling, 1 reply; 7+ messages in thread
From: Peter Dyballa @ 2011-02-20 19:54 UTC (permalink / raw)
  To: orium; +Cc: help-gnu-emacs


Am 19.02.2011 um 00:57 schrieb orium:

> How can have one new backup version created every time i save a file?


My setup is this:

(setq auto-save-interval 125)
(setq make-backup-files		t ;backup my files
       backup-by-copying		t ;don't clobber symlinks
       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)
;; Backups to central location
(setq backup-directory-alist `(("." ,@(concat user-emacs-directory  
"Sicherungen"))))


--
Greetings

   Pete

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] 7+ messages in thread

* Re: When does emacs backup files?
  2011-02-20 19:54 ` Peter Dyballa
@ 2011-02-20 20:16   ` Teemu Likonen
  2011-02-20 20:44     ` Peter Dyballa
  0 siblings, 1 reply; 7+ messages in thread
From: Teemu Likonen @ 2011-02-20 20:16 UTC (permalink / raw)
  To: Peter Dyballa; +Cc: help-gnu-emacs, orium

* 2011-02-20 20:54 (+0100), Peter Dyballa wrote:

> (setq auto-save-interval 125)
> (setq make-backup-files		t ;backup my files
>       backup-by-copying		t ;don't clobber symlinks

I think backup-by-copying variable has to do with _hard_ links, not
symlinks.



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: When does emacs backup files?
  2011-02-20 20:16   ` Teemu Likonen
@ 2011-02-20 20:44     ` Peter Dyballa
  2011-02-23  4:44       ` Kevin Rodgers
  0 siblings, 1 reply; 7+ messages in thread
From: Peter Dyballa @ 2011-02-20 20:44 UTC (permalink / raw)
  To: Teemu Likonen; +Cc: help-gnu-emacs, orium


Am 20.02.2011 um 21:16 schrieb Teemu Likonen:

>> (setq auto-save-interval 125)
>> (setq make-backup-files		t ;backup my files
>>      backup-by-copying		t ;don't clobber symlinks
>
> I think backup-by-copying variable has to do with _hard_ links, not
> symlinks.


Ah, yes! I first introduced 'backup-by-copying t' when I saw that my  
clever hard links changed a bit. Years later I found that block (a  
larger one, actually) and adopted it – with the original comments  
included. And that one comment is presumingly wrong...

Thanks! I'll make an update to my init file.

--
Greetings

   Pete

These are my principles and if you don't like them... well, I have  
others.
				- Groucho Marx




^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: When does emacs backup files?
  2011-02-18 23:57 When does emacs backup files? orium
  2011-02-20 19:54 ` Peter Dyballa
@ 2011-02-21  5:10 ` Le Wang
  1 sibling, 0 replies; 7+ messages in thread
From: Le Wang @ 2011-02-21  5:10 UTC (permalink / raw)
  To: orium; +Cc: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 771 bytes --]

On Sat, Feb 19, 2011 at 7:57 AM, orium <orium69@gmail.com> wrote:

> Hi,
>
> I want my emacs to backup every file on save (with version control),
> but for some reason i only have one version of each file.
>

If you read the description of `save-buffer', you'll see that this is by
design.  I think this comes from the olden times when disk space was
precious.

How can have one new backup version created every time i save a file?
>

You can force a backup whenever you save, by mapping C-xC-s to something
like this:

(defun le::save-buffer-force-backup (arg)
  "save buffer, always with a 2 \\[universal-argument]'s

see `save-buffer'

With ARG, don't force backup.
"
  (interactive "P")
  (if (and arg (listp arg))
      (save-buffer)
    (save-buffer 16)))


-- 
Le

[-- Attachment #2: Type: text/html, Size: 1592 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: When does emacs backup files?
  2011-02-20 20:44     ` Peter Dyballa
@ 2011-02-23  4:44       ` Kevin Rodgers
  2011-02-23 20:55         ` Peter Dyballa
  0 siblings, 1 reply; 7+ messages in thread
From: Kevin Rodgers @ 2011-02-23  4:44 UTC (permalink / raw)
  To: help-gnu-emacs

On 2/20/11 1:44 PM, Peter Dyballa wrote:
>
> Am 20.02.2011 um 21:16 schrieb Teemu Likonen:
>
>>> (setq auto-save-interval 125)
>>> (setq make-backup-files t ;backup my files
>>> backup-by-copying t ;don't clobber symlinks
>>
>> I think backup-by-copying variable has to do with _hard_ links, not
>> symlinks.
>
> Ah, yes! I first introduced 'backup-by-copying t' when I saw that my clever hard
> links changed a bit. Years later I found that block (a larger one, actually) and
> adopted it – with the original comments included. And that one comment is
> presumingly wrong...
>
> Thanks! I'll make an update to my init file.

See the backup-by-copying-when-linked, -when-mismatch, and
-when-priveleged-mismatch variables for finer control over backups.

-- 
Kevin Rodgers
Denver, Colorado, USA




^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: When does emacs backup files?
  2011-02-23  4:44       ` Kevin Rodgers
@ 2011-02-23 20:55         ` Peter Dyballa
  0 siblings, 0 replies; 7+ messages in thread
From: Peter Dyballa @ 2011-02-23 20:55 UTC (permalink / raw)
  To: Kevin Rodgers; +Cc: help-gnu-emacs


Am 23.02.2011 um 05:44 schrieb Kevin Rodgers:

> See the backup-by-copying-when-linked, -when-mismatch, and
> -when-priveleged-mismatch variables for finer control over backups.


These variables (the last one actually backup-by-copying-when- 
privileged-mismatch) play only then a role when backup-by-copying is  
nil. The latter is non-nil. But it should be sufficient to let it be  
nil and set backup-by-copying-when-linked to non-nil.

--
Mit friedvollen Grüßen

   Pete

To drink without thirst and to make love all the time, madam, it is  
only these which distinguish us from the other beasts.
				– Beaumarchais




^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2011-02-23 20:55 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-18 23:57 When does emacs backup files? orium
2011-02-20 19:54 ` Peter Dyballa
2011-02-20 20:16   ` Teemu Likonen
2011-02-20 20:44     ` Peter Dyballa
2011-02-23  4:44       ` Kevin Rodgers
2011-02-23 20:55         ` Peter Dyballa
2011-02-21  5:10 ` Le Wang

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).