aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Nicolaescu2008-02-23 06:32:12 +0000
committerDan Nicolaescu2008-02-23 06:32:12 +0000
commit25a4ea6de0741c64b6539b8604bc67f2aadf4bcf (patch)
tree9870f4a0b482bf2fc132324cf079493b356a0507
parente50002c894825a70cec6ad54d6bdcab39bfdda5a (diff)
downloademacs-25a4ea6de0741c64b6539b8604bc67f2aadf4bcf.tar.gz
emacs-25a4ea6de0741c64b6539b8604bc67f2aadf4bcf.zip
* vc.el (vc-find-revision): Make vc-parent-buffer local before
setting it. (vc-status-menu-map): Do not define using easy-menu. (vc-status-menu-map): New defalias. (vc-status-mode-map): Hook up the menu. (top-level): Update TODO. * vc-hg.el (vc-hg-extra-status-menu): Return a keymap. * vc-bzr.el (vc-bzr-init-version): Rename to ... (vc-bzr-init-revision): ... this.
-rw-r--r--lisp/ChangeLog14
-rw-r--r--lisp/vc-bzr.el2
-rw-r--r--lisp/vc-hg.el4
-rw-r--r--lisp/vc.el146
4 files changed, 106 insertions, 60 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index a0b5f67b9d3..c22c36407a5 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,17 @@
12008-02-23 Dan Nicolaescu <dann@ics.uci.edu>
2
3 * vc.el (vc-find-revision): Make vc-parent-buffer local before
4 setting it.
5 (vc-status-menu-map): Do not define using easy-menu.
6 (vc-status-menu-map): New defalias.
7 (vc-status-mode-map): Hook up the menu.
8 (top-level): Update TODO.
9
10 * vc-hg.el (vc-hg-extra-status-menu): Return a keymap.
11
12 * vc-bzr.el (vc-bzr-init-version): Rename to ...
13 (vc-bzr-init-revision): ... this.
14
12008-02-23 Jason Rumney <jasonr@gnu.org> 152008-02-23 Jason Rumney <jasonr@gnu.org>
2 16
3 * makefile.w32-in (WINS_ALMOST): Remove term. 17 * makefile.w32-in (WINS_ALMOST): Remove term.
diff --git a/lisp/vc-bzr.el b/lisp/vc-bzr.el
index 56fada271d9..e0ce72dd31f 100644
--- a/lisp/vc-bzr.el
+++ b/lisp/vc-bzr.el
@@ -277,7 +277,7 @@ If any error occurred in running `bzr status', then return nil."
277 "Create a new Bzr repository." 277 "Create a new Bzr repository."
278 (vc-bzr-command "init" nil 0 nil)) 278 (vc-bzr-command "init" nil 0 nil))
279 279
280(defun vc-bzr-init-version (&optional file) 280(defun vc-bzr-init-revision (&optional file)
281 "Always return nil, as Bzr cannot register explicit versions." 281 "Always return nil, as Bzr cannot register explicit versions."
282 nil) 282 nil)
283 283
diff --git a/lisp/vc-hg.el b/lisp/vc-hg.el
index e73537a4bb8..db29127e4d2 100644
--- a/lisp/vc-hg.el
+++ b/lisp/vc-hg.el
@@ -475,9 +475,7 @@ REV is the revision to check out into WORKFILE."
475 475
476(defun vc-hg-extra-menu () vc-hg-extra-menu-map) 476(defun vc-hg-extra-menu () vc-hg-extra-menu-map)
477 477
478(defun vc-hg-extra-status-menu () 478(defun vc-hg-extra-status-menu () vc-hg-extra-menu-map)
479 '(["Show incoming" vc-hg-incoming]
480 ["Show outgoing" vc-hg-outgoing]))
481 479
482(define-derived-mode vc-hg-outgoing-mode vc-hg-log-view-mode "Hg-Outgoing") 480(define-derived-mode vc-hg-outgoing-mode vc-hg-log-view-mode "Hg-Outgoing")
483 481
diff --git a/lisp/vc.el b/lisp/vc.el
index c8321e816ca..c0ceff58449 100644
--- a/lisp/vc.el
+++ b/lisp/vc.el
@@ -544,13 +544,12 @@
544;; 544;;
545;; - extra-status-menu () 545;; - extra-status-menu ()
546;; 546;;
547;; Return list of menu items. The items will appear at the end of 547;; Return a menu keymap, the items in the keymap will appear at the
548;; the VC menu. The goal is to allow backends to specify extra menu 548;; end of the VC Status menu. The goal is to allow backends to
549;; items that appear in the VC Status menu. This way you can 549;; specify extra menu items that appear in the VC Status menu. This
550;; provide menu entries for functionality that is specific to your 550;; makes it possible to provide menu entries for functionality that
551;; backend and which does not map to any of the VC generic concepts. 551;; is specific to a backend and which does not map to any of the VC
552;; XXX: this should be changed to be a keymap, for consistency with 552;; generic concepts.
553;; extra-menu.
554 553
555;;; Todo: 554;;; Todo:
556 555
@@ -595,6 +594,14 @@
595;; them, or remove them from the VCS. C-x v v might also need 594;; them, or remove them from the VCS. C-x v v might also need
596;; adjustments. 595;; adjustments.
597;; 596;;
597;; - when changing a file whose directory is shown in the vc-status
598;; buffer, it should be added there are "modified". (PCL-CVS does this).
599;;
600;; - vc-status needs a toolbar.
601;;
602;; - vc-status: refresh should not completely wipe out the current
603;; contents of the vc-status buffer.
604;;
598;; - vc-diff, vc-annotate, etc. need to deal better with unregistered 605;; - vc-diff, vc-annotate, etc. need to deal better with unregistered
599;; files. Now that unregistered and ignored files are shown in 606;; files. Now that unregistered and ignored files are shown in
600;; vc-dired/vc-status, it is possible that these commands are called 607;; vc-dired/vc-status, it is possible that these commands are called
@@ -2246,7 +2253,7 @@ If `F.~REV~' already exists, use it instead of checking it out again."
2246 (with-current-buffer result-buf 2253 (with-current-buffer result-buf
2247 ;; Set the parent buffer so that things like 2254 ;; Set the parent buffer so that things like
2248 ;; C-x v g, C-x v l, ... etc work. 2255 ;; C-x v g, C-x v l, ... etc work.
2249 (setq vc-parent-buffer filebuf)) 2256 (set (make-local-variable 'vc-parent-buffer) filebuf))
2250 result-buf))) 2257 result-buf)))
2251 2258
2252;; Header-insertion code 2259;; Header-insertion code
@@ -2690,6 +2697,73 @@ With prefix arg READ-SWITCHES, specify a value to override
2690 (cd dir) 2697 (cd dir)
2691 (vc-status-mode)) 2698 (vc-status-mode))
2692 2699
2700(defvar vc-status-menu-map
2701 (let ((map (make-sparse-keymap "VC-status")))
2702 (define-key map [quit]
2703 '(menu-item "Quit" bury-buffer
2704 :help "Quit"))
2705 (define-key map [refresh]
2706 '(menu-item "Refresh" vc-status-refresh
2707 :help "Refresh the contents of the VC status buffer"))
2708
2709 ;; VC commands.
2710 (define-key map [separator-vc-commands] '("--"))
2711 (define-key map [annotate]
2712 '(menu-item "Annotate" vc-annotate
2713 :help "Display the edit history of the current file using colors"))
2714 (define-key map [diff]
2715 '(menu-item "Compare with Base Version" vc-diff
2716 :help "Compare file set with the base version"))
2717 (define-key map [register]
2718 '(menu-item "Register" vc-status-register
2719 :help "Register file set into the version control system"))
2720 ;; vc-print-log uses the current buffer, not a file.
2721 ;; (define-key map [log]
2722 ;; '(menu-item "Show history" vc-status-print-log
2723 ;; :help "List the change log of the current file set in a window"))
2724
2725 ;; Movement.
2726 (define-key map [separator-movement] '("--"))
2727 (define-key map [next-line]
2728 '(menu-item "Next line" vc-status-next-line
2729 :help "Go to the next line" :keys "n"))
2730 (define-key map [previous-line]
2731 '(menu-item "Previous line" vc-status-previous-line
2732 :help "Go to the previous line"))
2733 ;; Marking.
2734 (define-key map [separator-marking] '("--"))
2735 (define-key map [unmark-all]
2736 '(menu-item "Unmark All" vc-status-unmark-all-files
2737 :help "Unmark all files that are in the same state as the current file\
2738\nWith prefix argument unmark all files"))
2739 (define-key map [unmark-previous]
2740 '(menu-item "Unmark previous " vc-status-unmark-file-up
2741 :help "Move to the previous line and unmark the file"))
2742
2743 (define-key map [mark-all]
2744 '(menu-item "Marl All" vc-status-mark-all-files
2745 :help "Mark all files that are in the same state as the current file\
2746\nWith prefix argument mark all files"))
2747 (define-key map [unmark]
2748 '(menu-item "Unmark" vc-status-unmark
2749 :help "Unmark the current file or all files in the region"))
2750
2751 (define-key map [mark]
2752 '(menu-item "Mark" vc-status-mark
2753 :help "Mark the current file or all files in the region"))
2754
2755 (define-key map [separator-open] '("--"))
2756 (define-key map [open-other]
2757 '(menu-item "Open in other window" vc-status-find-file-other-window
2758 :help "Find the file on the current line, in another window"))
2759 (define-key map [open]
2760 '(menu-item "Open file" vc-status-find-file
2761 :help "Find the file on the current line"))
2762 map)
2763 "Menu for VC status")
2764
2765(defalias 'vc-status-menu-map vc-status-menu-map)
2766
2693(defvar vc-status-mode-map 2767(defvar vc-status-mode-map
2694 (let ((map (make-keymap))) 2768 (let ((map (make-keymap)))
2695 (suppress-keymap map) 2769 (suppress-keymap map)
@@ -2721,6 +2795,13 @@ With prefix arg READ-SWITCHES, specify a value to override
2721 ;; Not working yet. Functions like vc-status-find-file need to 2795 ;; Not working yet. Functions like vc-status-find-file need to
2722 ;; find the file from the mouse position, not `point'. 2796 ;; find the file from the mouse position, not `point'.
2723 ;; (define-key map [(down-mouse-3)] 'vc-status-menu) 2797 ;; (define-key map [(down-mouse-3)] 'vc-status-menu)
2798
2799 ;; Hook up the menu.
2800 (define-key map [menu-bar vc-status-mode]
2801 '(menu-item
2802 ;; This is used to that VC backends could add backend specific
2803 ;; menu items to vc-status-menu-map.
2804 "VC Status" vc-status-menu-map :filter vc-status-menu-map-filter))
2724 map) 2805 map)
2725 "Keymap for VC status") 2806 "Keymap for VC status")
2726 2807
@@ -2736,57 +2817,10 @@ With prefix arg READ-SWITCHES, specify a value to override
2736 '("----") 2817 '("----")
2737 ext-binding)))) 2818 ext-binding))))
2738 2819
2739(easy-menu-define vc-status-mode-menu vc-status-mode-map
2740 "Menu for vc-status."
2741 '("VC Status"
2742 ;; This is used to that VC backends could add backend specific
2743 ;; menu items to vc-status-mode-menu.
2744 :filter vc-status-menu-map-filter
2745 ["Open file" vc-status-find-file
2746 :help "Find the file on the current line"]
2747 ["Open in other window" vc-status-find-file-other-window
2748 :help "Find the file on the current line, in another window"]
2749 "----"
2750 ;; VC commands.
2751 ["Compare with Base Version" vc-diff
2752 :help "Compare file set with the base version"]
2753 ["Register" vc-status-register
2754 :help "Register file set into the version control system"]
2755 ["Annotate" vc-annotate
2756 :help "Display the edit history of the current file using colors"]
2757 ;; vc-print-log uses the current buffer, not a file.
2758 ;; ["Show history" vc-status-print-log
2759 ;; :help "List the change log of the current file set in a window"]
2760 "----"
2761 ;; Movement.
2762 ["Next line" vc-status-next-line
2763 :help "Go to the next line"]
2764 ["Previous line" vc-status-previous-line
2765 :help "Go to the previous line"]
2766 "----"
2767 ;; Marking.
2768 ["Mark" vc-status-mark
2769 :help "Mark the current file or all files in the region"]
2770 ["Marl All" vc-status-mark-all-files
2771 :help "Mark all files that are in the same state as the current file\
2772\nWith prefix argument mark all files"]
2773 ["Unmark" vc-status-unmark
2774 :help "Unmark the current file or all files in the region"]
2775 ["Unmark previous " vc-status-unmark-file-up
2776 :help "Move to the previous line and unmark the file"]
2777 ["Unmark All" vc-status-unmark-all-files
2778 :help "Unmark all files that are in the same state as the current file\
2779\nWith prefix argument unmark all files"]
2780 "----"
2781 ["Refresh" vc-status-refresh
2782 :help "Refresh the contents of the VC status buffer"]
2783 ["Quit" bury-buffer
2784 :help "Quit"]))
2785
2786(defun vc-status-menu (e) 2820(defun vc-status-menu (e)
2787 "Popup the VC status menu." 2821 "Popup the VC status menu."
2788 (interactive "e") 2822 (interactive "e")
2789 (popup-menu vc-status-mode-menu e)) 2823 (popup-menu vc-status-menu-map e))
2790 2824
2791(defvar vc-status-process-buffer nil 2825(defvar vc-status-process-buffer nil
2792 "The buffer used for the asynchronous call that computes the VC status.") 2826 "The buffer used for the asynchronous call that computes the VC status.")