diff options
| author | Jan Djärv | 2008-03-06 10:58:48 +0000 |
|---|---|---|
| committer | Jan Djärv | 2008-03-06 10:58:48 +0000 |
| commit | 64db3a90334d2677af6ee8a9af24ee4fb8ace143 (patch) | |
| tree | a900fd8cbff042f9830ed5ccbab71acb4a2b13ea | |
| parent | d0207bf38cfdb53f2420c8e4a200400abc083aee (diff) | |
| download | emacs-64db3a90334d2677af6ee8a9af24ee4fb8ace143.tar.gz emacs-64db3a90334d2677af6ee8a9af24ee4fb8ace143.zip | |
(vc-status-tool-bar-map, vc-status-toggle-mark-file)
(vc-status-toggle-mark): New functions.
(vc-status-mode): Set tool bar map.
| -rw-r--r-- | lisp/vc.el | 41 |
1 files changed, 39 insertions, 2 deletions
diff --git a/lisp/vc.el b/lisp/vc.el index ab9277a35f1..57bc379035d 100644 --- a/lisp/vc.el +++ b/lisp/vc.el | |||
| @@ -616,6 +616,8 @@ | |||
| 616 | 616 | ||
| 617 | (require 'vc-hooks) | 617 | (require 'vc-hooks) |
| 618 | (require 'ring) | 618 | (require 'ring) |
| 619 | (require 'tool-bar) | ||
| 620 | |||
| 619 | (eval-when-compile | 621 | (eval-when-compile |
| 620 | (require 'cl) | 622 | (require 'cl) |
| 621 | (require 'compile) | 623 | (require 'compile) |
| @@ -2734,7 +2736,7 @@ With prefix arg READ-SWITCHES, specify a value to override | |||
| 2734 | :help "Move to the previous line and unmark the file")) | 2736 | :help "Move to the previous line and unmark the file")) |
| 2735 | 2737 | ||
| 2736 | (define-key map [mark-all] | 2738 | (define-key map [mark-all] |
| 2737 | '(menu-item "Marl All" vc-status-mark-all-files | 2739 | '(menu-item "Mark All" vc-status-mark-all-files |
| 2738 | :help "Mark all files that are in the same state as the current file\ | 2740 | :help "Mark all files that are in the same state as the current file\ |
| 2739 | \nWith prefix argument mark all files")) | 2741 | \nWith prefix argument mark all files")) |
| 2740 | (define-key map [unmark] | 2742 | (define-key map [unmark] |
| @@ -2743,7 +2745,7 @@ With prefix arg READ-SWITCHES, specify a value to override | |||
| 2743 | 2745 | ||
| 2744 | (define-key map [mark] | 2746 | (define-key map [mark] |
| 2745 | '(menu-item "Mark" vc-status-mark | 2747 | '(menu-item "Mark" vc-status-mark |
| 2746 | :help "Mark the current file or all files in the region")) | 2748 | :help "Mark the current file or all files in the region")) |
| 2747 | 2749 | ||
| 2748 | (define-key map [separator-open] '("--")) | 2750 | (define-key map [separator-open] '("--")) |
| 2749 | (define-key map [open-other] | 2751 | (define-key map [open-other] |
| @@ -2815,6 +2817,29 @@ With prefix arg READ-SWITCHES, specify a value to override | |||
| 2815 | (interactive "e") | 2817 | (interactive "e") |
| 2816 | (popup-menu vc-status-menu-map e)) | 2818 | (popup-menu vc-status-menu-map e)) |
| 2817 | 2819 | ||
| 2820 | (defun vc-status-tool-bar-map () | ||
| 2821 | (if (display-graphic-p) | ||
| 2822 | (let ((map (make-sparse-keymap))) | ||
| 2823 | (tool-bar-local-item-from-menu 'vc-status-find-file "open" | ||
| 2824 | map vc-status-mode-map) | ||
| 2825 | (tool-bar-local-item "bookmark_add" | ||
| 2826 | 'vc-status-toggle-mark 'vc-status-toggle-mark map | ||
| 2827 | :help "Toggle mark on current item") | ||
| 2828 | (tool-bar-local-item-from-menu 'vc-status-previous-line "left-arrow" | ||
| 2829 | map vc-status-mode-map | ||
| 2830 | :rtl "right-arrow") | ||
| 2831 | (tool-bar-local-item-from-menu 'vc-status-next-line "right-arrow" | ||
| 2832 | map vc-status-mode-map | ||
| 2833 | :rtl "left-arrow") | ||
| 2834 | (tool-bar-local-item-from-menu 'vc-status-refresh "refresh" | ||
| 2835 | map vc-status-mode-map) | ||
| 2836 | (tool-bar-local-item-from-menu 'nonincremental-search-forward | ||
| 2837 | "search" map) | ||
| 2838 | (tool-bar-local-item-from-menu 'bury-buffer "exit" | ||
| 2839 | map vc-status-mode-map) | ||
| 2840 | map))) | ||
| 2841 | |||
| 2842 | |||
| 2818 | (defvar vc-status-process-buffer nil | 2843 | (defvar vc-status-process-buffer nil |
| 2819 | "The buffer used for the asynchronous call that computes the VC status.") | 2844 | "The buffer used for the asynchronous call that computes the VC status.") |
| 2820 | 2845 | ||
| @@ -2829,6 +2854,7 @@ With prefix arg READ-SWITCHES, specify a value to override | |||
| 2829 | (setq buffer-read-only t) | 2854 | (setq buffer-read-only t) |
| 2830 | (set (make-local-variable 'vc-status-crt-marked) nil) | 2855 | (set (make-local-variable 'vc-status-crt-marked) nil) |
| 2831 | (use-local-map vc-status-mode-map) | 2856 | (use-local-map vc-status-mode-map) |
| 2857 | (set (make-local-variable 'tool-bar-map) (vc-status-tool-bar-map)) | ||
| 2832 | (let ((buffer-read-only nil) | 2858 | (let ((buffer-read-only nil) |
| 2833 | (backend (vc-responsible-backend default-directory)) | 2859 | (backend (vc-responsible-backend default-directory)) |
| 2834 | entries) | 2860 | entries) |
| @@ -3016,6 +3042,17 @@ that share the same state." | |||
| 3016 | t)) | 3042 | t)) |
| 3017 | vc-status)))) | 3043 | vc-status)))) |
| 3018 | 3044 | ||
| 3045 | (defun vc-status-toggle-mark-file () | ||
| 3046 | (let* ((crt (ewoc-locate vc-status)) | ||
| 3047 | (file (ewoc-data crt))) | ||
| 3048 | (if (vc-status-fileinfo->marked file) | ||
| 3049 | (vc-status-unmark-file) | ||
| 3050 | (vc-status-mark-file)))) | ||
| 3051 | |||
| 3052 | (defun vc-status-toggle-mark () | ||
| 3053 | (interactive) | ||
| 3054 | (vc-status-mark-unmark 'toggle-mark-file)) | ||
| 3055 | |||
| 3019 | (defun vc-status-register () | 3056 | (defun vc-status-register () |
| 3020 | "Register the marked files, or the current file if no marks." | 3057 | "Register the marked files, or the current file if no marks." |
| 3021 | (interactive) | 3058 | (interactive) |