From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kevin Rodgers Newsgroups: gmane.emacs.help Subject: Re: write-file like function help needed Date: Thu, 14 Dec 2006 11:12:52 -0700 Organization: IHS Message-ID: References: <1166042237.856019.98270@n67g2000cwd.googlegroups.com> NNTP-Posting-Host: dough.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1166120142 14205 80.91.229.10 (14 Dec 2006 18:15:42 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 14 Dec 2006 18:15:42 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Dec 14 19:15:41 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by dough.gmane.org with esmtp (Exim 4.50) id 1Guv7K-0007zV-Ce for geh-help-gnu-emacs@m.gmane.org; Thu, 14 Dec 2006 19:15:38 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Guv7J-0004gC-S1 for geh-help-gnu-emacs@m.gmane.org; Thu, 14 Dec 2006 13:15:38 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Guv6t-0004Tb-3I for help-gnu-emacs@gnu.org; Thu, 14 Dec 2006 13:15:11 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Guv6r-0004Rl-Gx for help-gnu-emacs@gnu.org; Thu, 14 Dec 2006 13:15:09 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Guv6r-0004RK-12 for help-gnu-emacs@gnu.org; Thu, 14 Dec 2006 13:15:09 -0500 Original-Received: from [80.91.229.2] (helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1Guv6p-00064O-Oo for help-gnu-emacs@gnu.org; Thu, 14 Dec 2006 13:15:08 -0500 Original-Received: from root by ciao.gmane.org with local (Exim 4.43) id 1Guv6l-0007P6-R4 for help-gnu-emacs@gnu.org; Thu, 14 Dec 2006 19:15:05 +0100 Original-Received: from 207.167.42.206 ([207.167.42.206]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 14 Dec 2006 19:15:03 +0100 Original-Received: from ihs_4664 by 207.167.42.206 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 14 Dec 2006 19:15:03 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-To: help-gnu-emacs@gnu.org Original-Lines: 34 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: 207.167.42.206 User-Agent: Thunderbird 1.5.0.8 (Windows/20061025) In-Reply-To: <1166042237.856019.98270@n67g2000cwd.googlegroups.com> 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:39538 Archived-At: keithv wrote: > I need help writing a function that works like write-file but > first modifies the file name by locating and incrementing > any numbers in the file name. For example, if the buffer > name is "test1.txt", repeatedly invoking this function > would save files with the names "test2.txt", "test3.txt", > "test4.txt", etc. > > The goal being to keep all versions of a given file. > > My elisp is rusty--I know how I would do the > number locate and increment on the buffer text > but not for an arbitrary string. > > Or better yet, is there a package out there > to do something similar? ,----[ C-h v version-control RET ] | version-control is a variable defined in `files.el'. | Its value is nil | | Documentation: | *Control use of version numbers for backup files. | t means make numeric backup versions unconditionally. | nil means make them for files that have some already. | `never' means do not make them. | | You can customize this variable. | | [back] `---- -- Kevin