From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Le Wang Newsgroups: gmane.emacs.help Subject: Re: When does emacs backup files? Date: Mon, 21 Feb 2011 13:10:49 +0800 Message-ID: References: <01812190-7de6-4215-a71e-a2ef1f18637f@l11g2000yqb.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=20cf3054a0071feaf5049cc3e3b4 X-Trace: dough.gmane.org 1298265441 24926 80.91.229.12 (21 Feb 2011 05:17:21 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 21 Feb 2011 05:17:21 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: orium Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Feb 21 06:17:17 2011 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PrO96-0005FI-Io for geh-help-gnu-emacs@m.gmane.org; Mon, 21 Feb 2011 06:17:16 +0100 Original-Received: from localhost ([127.0.0.1]:52147 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PrO3Q-0001Fu-OJ for geh-help-gnu-emacs@m.gmane.org; Mon, 21 Feb 2011 00:11:24 -0500 Original-Received: from [140.186.70.92] (port=37494 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PrO2v-0001FU-Ev for help-gnu-emacs@gnu.org; Mon, 21 Feb 2011 00:10:54 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PrO2s-00087a-Pi for help-gnu-emacs@gnu.org; Mon, 21 Feb 2011 00:10:53 -0500 Original-Received: from mail-iw0-f169.google.com ([209.85.214.169]:38261) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PrO2s-00087L-J4 for help-gnu-emacs@gnu.org; Mon, 21 Feb 2011 00:10:50 -0500 Original-Received: by iwl42 with SMTP id 42so2445764iwl.0 for ; Sun, 20 Feb 2011 21:10:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=lMJuOwRgpkLEBVMNZQfDyxgLz03CxsPpv7kBMQKRj9Y=; b=OOcDmO36til2zmOUsNO9Crx9ABex1W4JjwamhVYFTCkyAISk7O8/UrVW7CR2VWqRWT EI/Pt2T78xi6+DqsJfMclnYrp/xcRG/pa36gcqhxcDH4jT5+kbbcl+HljLQwnE3St2T/ U3Dv8gxFUXk+qH2zyXQMMH3IruUsZ1ZZK35IQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=AOYho5dYd/2V2bR14Paq73q6XmrhVaJEs8+8fBnJ2NHh6kO2JRqEvhmgeLCUMFiiLL C9sEqb0H/M/XHxYhn96RfiVm+ZFPhKE7vUb9tD0VvS8H+3ZsgpTEPC1ySHIIMR/5TN+O DcceNTAewWfqq4YvqmTgZgq/5sTo8HPDCcZHE= Original-Received: by 10.42.217.68 with SMTP id hl4mr1416465icb.181.1298265049917; Sun, 20 Feb 2011 21:10:49 -0800 (PST) Original-Received: by 10.42.220.2 with HTTP; Sun, 20 Feb 2011 21:10:49 -0800 (PST) In-Reply-To: <01812190-7de6-4215-a71e-a2ef1f18637f@l11g2000yqb.googlegroups.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.214.169 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:79275 Archived-At: --20cf3054a0071feaf5049cc3e3b4 Content-Type: text/plain; charset=ISO-8859-1 On Sat, Feb 19, 2011 at 7:57 AM, orium 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 --20cf3054a0071feaf5049cc3e3b4 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
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.
<= div>
If you read the description of `save-buffer', you'll = see that this is by design. =A0I 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)
= =A0=A0"save buffer, always with a 2 \\[universal-argument]'s
=

see `save-buffer'
=

With ARG, don't force backup.
"
=A0=A0(interactive "P")
=A0=A0(if (and arg (listp arg))
=A0= =A0 =A0 =A0(save-buffer)
=A0=A0 =A0(save-buffer 16)))
<= br>--
Le
--20cf3054a0071feaf5049cc3e3b4--