(require 'vc-hooks)
(require 'ring)
+(require 'tool-bar)
+
(eval-when-compile
(require 'cl)
(require 'compile)
:help "Move to the previous line and unmark the file"))
(define-key map [mark-all]
- '(menu-item "Marl All" vc-status-mark-all-files
+ '(menu-item "Mark All" vc-status-mark-all-files
:help "Mark all files that are in the same state as the current file\
\nWith prefix argument mark all files"))
(define-key map [unmark]
(define-key map [mark]
'(menu-item "Mark" vc-status-mark
- :help "Mark the current file or all files in the region"))
+ :help "Mark the current file or all files in the region"))
(define-key map [separator-open] '("--"))
(define-key map [open-other]
(interactive "e")
(popup-menu vc-status-menu-map e))
+(defun vc-status-tool-bar-map ()
+ (if (display-graphic-p)
+ (let ((map (make-sparse-keymap)))
+ (tool-bar-local-item-from-menu 'vc-status-find-file "open"
+ map vc-status-mode-map)
+ (tool-bar-local-item "bookmark_add"
+ 'vc-status-toggle-mark 'vc-status-toggle-mark map
+ :help "Toggle mark on current item")
+ (tool-bar-local-item-from-menu 'vc-status-previous-line "left-arrow"
+ map vc-status-mode-map
+ :rtl "right-arrow")
+ (tool-bar-local-item-from-menu 'vc-status-next-line "right-arrow"
+ map vc-status-mode-map
+ :rtl "left-arrow")
+ (tool-bar-local-item-from-menu 'vc-status-refresh "refresh"
+ map vc-status-mode-map)
+ (tool-bar-local-item-from-menu 'nonincremental-search-forward
+ "search" map)
+ (tool-bar-local-item-from-menu 'bury-buffer "exit"
+ map vc-status-mode-map)
+ map)))
+
+
(defvar vc-status-process-buffer nil
"The buffer used for the asynchronous call that computes the VC status.")
(setq buffer-read-only t)
(set (make-local-variable 'vc-status-crt-marked) nil)
(use-local-map vc-status-mode-map)
+ (set (make-local-variable 'tool-bar-map) (vc-status-tool-bar-map))
(let ((buffer-read-only nil)
(backend (vc-responsible-backend default-directory))
entries)
t))
vc-status))))
+(defun vc-status-toggle-mark-file ()
+ (let* ((crt (ewoc-locate vc-status))
+ (file (ewoc-data crt)))
+ (if (vc-status-fileinfo->marked file)
+ (vc-status-unmark-file)
+ (vc-status-mark-file))))
+
+(defun vc-status-toggle-mark ()
+ (interactive)
+ (vc-status-mark-unmark 'toggle-mark-file))
+
(defun vc-status-register ()
"Register the marked files, or the current file if no marks."
(interactive)