unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Nikolaj Schumacher <n_schumacher@web.de>
To: Nordlöw <per.nordlow@gmail.com>
Cc: help-gnu-emacs@gnu.org
Subject: Re: vc-rename-file() if possible otherwise rename-file()
Date: Tue, 18 Mar 2008 20:26:39 +0100	[thread overview]
Message-ID: <m21w67x28g.fsf@nschum.de> (raw)
In-Reply-To: <2fd1cf38-57e5-4ce1-b79c-8eee6aa25b8e@s13g2000prd.googlegroups.com> ("Nordlöw"'s message of "Tue\, 18 Mar 2008 11\:23\:32 -0700 \(PDT\)")

Nordlöw <per.nordlow@gmail.com> 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




  parent reply	other threads:[~2008-03-18 19:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-18 18:23 vc-rename-file() if possible otherwise rename-file() Nordlöw
2008-03-18 19:13 ` Thierry Volpiatto
2008-03-18 19:26 ` Nikolaj Schumacher [this message]
     [not found] ` <2fd1cf38-57e5-4ce1-b79c-8eee6aa25b8e@s13g2000prd.googlegro ups.com>
2008-03-19  0:40   ` Johan Lindström

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m21w67x28g.fsf@nschum.de \
    --to=n_schumacher@web.de \
    --cc=help-gnu-emacs@gnu.org \
    --cc=per.nordlow@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).