diff options
| author | Dan Nicolaescu | 2008-03-22 20:32:10 +0000 |
|---|---|---|
| committer | Dan Nicolaescu | 2008-03-22 20:32:10 +0000 |
| commit | e9e065e5b3af82c66716a1a3e82eea75f58d3c5e (patch) | |
| tree | fdbeb75ce7ca8a1d2876ff1a05e2f833115be642 | |
| parent | 935f7c5a64fd4fddb602e8483050c230c9c6bbc3 (diff) | |
| download | emacs-e9e065e5b3af82c66716a1a3e82eea75f58d3c5e.tar.gz emacs-e9e065e5b3af82c66716a1a3e82eea75f58d3c5e.zip | |
(vc-status-prepare-status-buffer): New function.
(vc-status): Use it.
| -rw-r--r-- | lisp/ChangeLog | 3 | ||||
| -rw-r--r-- | lisp/vc.el | 22 |
2 files changed, 22 insertions, 3 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 9573f31e790..0cb6857f250 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,8 @@ | |||
| 1 | 2008-03-22 Dan Nicolaescu <dann@ics.uci.edu> | 1 | 2008-03-22 Dan Nicolaescu <dann@ics.uci.edu> |
| 2 | 2 | ||
| 3 | * vc.el (vc-status-prepare-status-buffer): New function. | ||
| 4 | (vc-status): Use it. | ||
| 5 | |||
| 3 | * emacs-lisp/lisp-mode.el (emacs-lisp-mode-map): Add ... where | 6 | * emacs-lisp/lisp-mode.el (emacs-lisp-mode-map): Add ... where |
| 4 | appropriate. | 7 | appropriate. |
| 5 | 8 | ||
diff --git a/lisp/vc.el b/lisp/vc.el index 81d45870e64..c50b72f7d3f 100644 --- a/lisp/vc.el +++ b/lisp/vc.el | |||
| @@ -2685,13 +2685,29 @@ With prefix arg READ-SWITCHES, specify a value to override | |||
| 2685 | ;; Must be in sync with vc-status-printer. | 2685 | ;; Must be in sync with vc-status-printer. |
| 2686 | (forward-char 25)) | 2686 | (forward-char 25)) |
| 2687 | 2687 | ||
| 2688 | (defun vc-status-prepare-status-buffer (dir &optional create-new) | ||
| 2689 | "Find a *vc-status* buffer showing DIR, or create a new one." | ||
| 2690 | (setq dir (expand-file-name dir)) | ||
| 2691 | (let ((bname "*vc-status*")) | ||
| 2692 | ;; Look for another *vc-status* buffer visiting the same directory. | ||
| 2693 | (save-excursion | ||
| 2694 | (unless create-new | ||
| 2695 | (dolist (buffer (buffer-list)) | ||
| 2696 | (set-buffer buffer) | ||
| 2697 | (when (and (eq major-mode 'vc-status-mode) | ||
| 2698 | (string= default-directory dir)) | ||
| 2699 | (return buffer))))) | ||
| 2700 | ;; Create a new *vc-status* buffer. | ||
| 2701 | (with-current-buffer (create-file-buffer bname) | ||
| 2702 | (cd dir) | ||
| 2703 | (vc-setup-buffer (current-buffer)) | ||
| 2704 | (current-buffer)))) | ||
| 2705 | |||
| 2688 | ;;;###autoload | 2706 | ;;;###autoload |
| 2689 | (defun vc-status (dir) | 2707 | (defun vc-status (dir) |
| 2690 | "Show the VC status for DIR." | 2708 | "Show the VC status for DIR." |
| 2691 | (interactive "DVC status for directory: ") | 2709 | (interactive "DVC status for directory: ") |
| 2692 | (vc-setup-buffer "*vc-status*") | 2710 | (switch-to-buffer (vc-status-prepare-status-buffer dir)) |
| 2693 | (switch-to-buffer "*vc-status*") | ||
| 2694 | (cd dir) | ||
| 2695 | (vc-status-mode)) | 2711 | (vc-status-mode)) |
| 2696 | 2712 | ||
| 2697 | (defvar vc-status-menu-map | 2713 | (defvar vc-status-menu-map |