From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "keithv" Newsgroups: gmane.emacs.help Subject: write-file like function help needed Date: 13 Dec 2006 12:37:17 -0800 Organization: http://groups.google.com Message-ID: <1166042237.856019.98270@n67g2000cwd.googlegroups.com> NNTP-Posting-Host: dough.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: sea.gmane.org 1166042450 4317 80.91.229.10 (13 Dec 2006 20:40:50 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 13 Dec 2006 20:40:50 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Dec 13 21:40:49 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 1GuauC-0000tm-LL for geh-help-gnu-emacs@m.gmane.org; Wed, 13 Dec 2006 21:40:44 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GuauC-0005SH-3Q for geh-help-gnu-emacs@m.gmane.org; Wed, 13 Dec 2006 15:40:44 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!n67g2000cwd.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 21 Original-NNTP-Posting-Host: 67.104.154.42 Original-X-Trace: posting.google.com 1166042244 28132 127.0.0.1 (13 Dec 2006 20:37:24 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Wed, 13 Dec 2006 20:37:24 +0000 (UTC) User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.8) Gecko/20061025 Firefox/1.5.0.8,gzip(gfe),gzip(gfe) X-HTTP-Via: 1.1 ISAUS Complaints-To: groups-abuse@google.com Injection-Info: n67g2000cwd.googlegroups.com; posting-host=67.104.154.42; posting-account=Z2JKMw0AAACH92Sefj7zEY6iMKpV_sXm Original-Xref: shelby.stanford.edu gnu.emacs.help:143919 Original-To: help-gnu-emacs@gnu.org 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:39524 Archived-At: Hi, 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? Thanks in advance, Keith