From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Nikolaj Schumacher Newsgroups: gmane.emacs.help Subject: Re: vc-rename-file() if possible otherwise rename-file() Date: Tue, 18 Mar 2008 20:26:39 +0100 Message-ID: References: <2fd1cf38-57e5-4ce1-b79c-8eee6aa25b8e@s13g2000prd.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1205868440 14411 80.91.229.12 (18 Mar 2008 19:27:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 18 Mar 2008 19:27:20 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: =?utf-8?Q?Nordl=C3=B6w?= Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Mar 18 20:27:49 2008 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.50) id 1JbhTI-0008Dn-66 for geh-help-gnu-emacs@m.gmane.org; Tue, 18 Mar 2008 20:27:40 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JbhSh-0001Ts-Pu for geh-help-gnu-emacs@m.gmane.org; Tue, 18 Mar 2008 15:27:03 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JbhSQ-0001TP-Ip for help-gnu-emacs@gnu.org; Tue, 18 Mar 2008 15:26:46 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JbhSP-0001Sx-1A for help-gnu-emacs@gnu.org; Tue, 18 Mar 2008 15:26:46 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JbhSO-0001Ss-R5 for help-gnu-emacs@gnu.org; Tue, 18 Mar 2008 15:26:44 -0400 Original-Received: from fmmailgate01.web.de ([217.72.192.221]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JbhSO-0001uD-Eu for help-gnu-emacs@gnu.org; Tue, 18 Mar 2008 15:26:44 -0400 Original-Received: from smtp05.web.de (fmsmtp05.dlan.cinetic.de [172.20.4.166]) by fmmailgate01.web.de (Postfix) with ESMTP id 38561D772891; Tue, 18 Mar 2008 20:26:43 +0100 (CET) Original-Received: from [77.135.78.239] (helo=wednesday) by smtp05.web.de with asmtp (WEB.DE 4.109 #226) id 1JbhSK-0000ie-00; Tue, 18 Mar 2008 20:26:40 +0100 In-Reply-To: <2fd1cf38-57e5-4ce1-b79c-8eee6aa25b8e@s13g2000prd.googlegroups.com> (=?utf-8?Q?=22Nordl=C3=B6w=22's?= message of "Tue\, 18 Mar 2008 11\:23\:32 -0700 \(PDT\)") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1.92 (darwin) X-Sender: n_schumacher@web.de X-Provags-ID: V01U2FsdGVkX1+x0fQRlAjD7JdqsvTY8QY44ggmt4GflWUeW1/M cYGOy/D6eimPEUMPXljv8NwJTBwNQq54NGMHHccWSbKDHi0pOr cy4jcvR0rjkC/L6xY2HQ== X-detected-kernel: by monty-python.gnu.org: Linux 2.4-2.6 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:52502 Archived-At: Nordl=C3=B6w wrote: > Looking for a small snippet that does vc-rename-file() when possible > (source file is under version control) otherwise default to rename- > file(). The question is: How do I check if a file is under version > control or not? (if (vc-backend buffer-file-name) (vc-rename-file buffer-file-name new-name) (rename-file buffer-file-name new-name)) regards, Nikolaj Schumacher