[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/vc.el,v
From: |
Dan Nicolaescu |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/vc.el,v |
Date: |
Sat, 22 Mar 2008 20:32:13 +0000 |
CVSROOT: /cvsroot/emacs
Module name: emacs
Changes by: Dan Nicolaescu <dann> 08/03/22 20:32:12
Index: vc.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/vc.el,v
retrieving revision 1.553
retrieving revision 1.554
diff -u -b -r1.553 -r1.554
--- vc.el 21 Mar 2008 17:53:03 -0000 1.553
+++ vc.el 22 Mar 2008 20:32:10 -0000 1.554
@@ -2685,13 +2685,29 @@
;; Must be in sync with vc-status-printer.
(forward-char 25))
+(defun vc-status-prepare-status-buffer (dir &optional create-new)
+ "Find a *vc-status* buffer showing DIR, or create a new one."
+ (setq dir (expand-file-name dir))
+ (let ((bname "*vc-status*"))
+ ;; Look for another *vc-status* buffer visiting the same directory.
+ (save-excursion
+ (unless create-new
+ (dolist (buffer (buffer-list))
+ (set-buffer buffer)
+ (when (and (eq major-mode 'vc-status-mode)
+ (string= default-directory dir))
+ (return buffer)))))
+ ;; Create a new *vc-status* buffer.
+ (with-current-buffer (create-file-buffer bname)
+ (cd dir)
+ (vc-setup-buffer (current-buffer))
+ (current-buffer))))
+
;;;###autoload
(defun vc-status (dir)
"Show the VC status for DIR."
(interactive "DVC status for directory: ")
- (vc-setup-buffer "*vc-status*")
- (switch-to-buffer "*vc-status*")
- (cd dir)
+ (switch-to-buffer (vc-status-prepare-status-buffer dir))
(vc-status-mode))
(defvar vc-status-menu-map
- [Emacs-diffs] Changes to emacs/lisp/vc.el,v, Jan Djärv, 2008/03/06
- [Emacs-diffs] Changes to emacs/lisp/vc.el,v, Jan Djärv, 2008/03/07
- [Emacs-diffs] Changes to emacs/lisp/vc.el,v, Glenn Morris, 2008/03/10
- [Emacs-diffs] Changes to emacs/lisp/vc.el,v, Dan Nicolaescu, 2008/03/17
- [Emacs-diffs] Changes to emacs/lisp/vc.el,v, Stefan Monnier, 2008/03/18
- [Emacs-diffs] Changes to emacs/lisp/vc.el,v, Dan Nicolaescu, 2008/03/20
- [Emacs-diffs] Changes to emacs/lisp/vc.el,v, Dan Nicolaescu, 2008/03/21
- [Emacs-diffs] Changes to emacs/lisp/vc.el,v, Stefan Monnier, 2008/03/21
- [Emacs-diffs] Changes to emacs/lisp/vc.el,v,
Dan Nicolaescu <=
- [Emacs-diffs] Changes to emacs/lisp/vc.el,v, Dan Nicolaescu, 2008/03/23
- [Emacs-diffs] Changes to emacs/lisp/vc.el,v, Dan Nicolaescu, 2008/03/23
- [Emacs-diffs] Changes to emacs/lisp/vc.el,v, Dan Nicolaescu, 2008/03/24
- [Emacs-diffs] Changes to emacs/lisp/vc.el,v, Stefan Monnier, 2008/03/26
- [Emacs-diffs] Changes to emacs/lisp/vc.el,v, Dan Nicolaescu, 2008/03/27
- [Emacs-diffs] Changes to emacs/lisp/vc.el,v, Dan Nicolaescu, 2008/03/28
- [Emacs-diffs] Changes to emacs/lisp/vc.el,v, Dan Nicolaescu, 2008/03/28
- [Emacs-diffs] Changes to emacs/lisp/vc.el,v, Dan Nicolaescu, 2008/03/28
- [Emacs-diffs] Changes to emacs/lisp/vc.el,v, Dan Nicolaescu, 2008/03/28
- [Emacs-diffs] Changes to emacs/lisp/vc.el,v, Dan Nicolaescu, 2008/03/28