From: Thien-Thi Nguyen <ttn@gnuvola.org>
To: emacs-devel@gnu.org
Subject: Re: Messy VC checkouts
Date: Mon, 21 Apr 2008 20:18:52 +0200 [thread overview]
Message-ID: <877ier2hrn.fsf@ambire.localdomain> (raw)
In-Reply-To: 87prsj3z0v.fsf_-_@hagelb.org
() Phil Hagelberg <phil@hagelb.org>
() Mon, 21 Apr 2008 10:20:48 -0700
If this option doesn't currently exist in VC,
how difficult would it be to add?
Not very. One example is below. Personally, i
bind `display-previous-revision' to `C-x v p'.
thi
____________________________________________
;;; display-previous-revision.el
;;;
;;; Copyright (C) 2004, 2007, 2008 Thien-Thi Nguyen
;;;
;;; This file is part of ttn's personal elisp library, released under
;;; the terms of the GNU General Public License as published by the
;;; Free Software Foundation; either version 3, or (at your option) any
;;; later version. There is NO WARRANTY. See file COPYING for details.
;;;
;;; Description: Display previous revision of a version-controlled file.
;;;###autoload
(defun display-previous-revision (file rev checkout-switches)
"Display FILE revision REV w/ CHECKOUT-SWITCHES in a new buffer."
(interactive "fFile: \nsRevision (symbolic ok): \nsCheckout switches: ")
(let ((vc-checkout-switches (unless (string= "" checkout-switches)
checkout-switches)))
(switch-to-buffer (vc-find-revision file (if (string-equal rev "")
(vc-working-revision file)
rev))))
(delete-file buffer-file-name)
(string-match "~\\(.+\\)~$" buffer-file-name)
(setq rev (match-string 1 buffer-file-name)
buffer-file-name nil)
(rename-buffer (format "*%s:%s*" (file-name-nondirectory file) rev)))
(provide 'display-previous-revision)
;;; display-previous-revision.el ends here
next prev parent reply other threads:[~2008-04-21 18:18 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-21 7:57 backup files for files under VC Torsten Bronger
2008-04-21 8:30 ` Nick Roberts
2008-04-21 9:39 ` David Kastrup
2008-04-21 11:14 ` Torsten Bronger
2008-04-21 11:58 ` David Kastrup
2008-04-21 12:18 ` Torsten Bronger
2008-04-21 12:35 ` David Kastrup
2008-04-21 12:50 ` Torsten Bronger
2008-04-21 13:09 ` David Kastrup
2008-04-21 13:18 ` Torsten Bronger
2008-04-21 13:39 ` David Kastrup
2008-04-21 14:01 ` Torsten Bronger
2008-04-21 17:20 ` Messy VC checkouts (was: backup files for files under VC) Phil Hagelberg
2008-04-21 18:00 ` Messy VC checkouts Stefan Monnier
2008-04-21 18:18 ` Thien-Thi Nguyen [this message]
2008-04-21 19:48 ` backup files for files under VC Richard Stallman
2008-04-21 14:53 ` Stefan Monnier
2008-04-21 15:47 ` Torsten Bronger
2008-04-21 16:27 ` David Kastrup
2008-04-21 16:35 ` Torsten Bronger
2008-04-21 14:48 ` Stefan Monnier
2008-04-21 15:20 ` David Kastrup
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=877ier2hrn.fsf@ambire.localdomain \
--to=ttn@gnuvola.org \
--cc=emacs-devel@gnu.org \
/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.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.