mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2025-01-04 11:40:22 +00:00
(vc-status-tool-bar-map, vc-status-toggle-mark-file)
(vc-status-toggle-mark): New functions. (vc-status-mode): Set tool bar map.
This commit is contained in:
parent
d0207bf38c
commit
64db3a9033
41
lisp/vc.el
41
lisp/vc.el
@ -616,6 +616,8 @@
|
||||
|
||||
(require 'vc-hooks)
|
||||
(require 'ring)
|
||||
(require 'tool-bar)
|
||||
|
||||
(eval-when-compile
|
||||
(require 'cl)
|
||||
(require 'compile)
|
||||
@ -2734,7 +2736,7 @@ With prefix arg READ-SWITCHES, specify a value to override
|
||||
: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]
|
||||
@ -2743,7 +2745,7 @@ With prefix arg READ-SWITCHES, specify a value to override
|
||||
|
||||
(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]
|
||||
@ -2815,6 +2817,29 @@ With prefix arg READ-SWITCHES, specify a value to override
|
||||
(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.")
|
||||
|
||||
@ -2829,6 +2854,7 @@ With prefix arg READ-SWITCHES, specify a value to override
|
||||
(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)
|
||||
@ -3016,6 +3042,17 @@ that share the same state."
|
||||
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)
|
||||
|
Loading…
Reference in New Issue
Block a user